/* Custom styles for Podcast Analytics Dashboard */

body {
    font-family: "Your Font", Arial, sans-serif;
}

.sidebar {
    /* Changed from fixed to allow scrolling with page */
    position: relative;
    z-index: 100;
    padding: 20px 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    min-height: calc(100vh - 56px); /* Maintain minimum height */
}

.sidebar .nav-link {
    color: #333;
    padding: 10px 20px;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
}

.sidebar .nav-link.active {
    color: #ff2ed7;
    background-color: #e9ecef;
}

/* Current Podcast Display */
.current-podcast {
    padding: 0 20px;
}

.current-podcast-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: #e9ecef;
    border-radius: 8px;
    cursor: pointer;
}

.current-podcast-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    margin-right: 12px;
    object-fit: cover;
}

.current-podcast-item .podcast-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Podcasts List */
.podcasts-list {
    padding: 0 20px;
}

.podcast-list-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.podcast-list-item:hover {
    background-color: #f8f9fa;
}

.podcast-list-item.selected {
    background-color: #e7f3ff;
}

.podcast-list-item img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    margin-right: 10px;
    object-fit: cover;
}

.podcast-list-item .podcast-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-heading {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

main {
    /* Removed margin-top since sidebar isn't fixed anymore */
    padding-top: 20px;
}

.navbar-brand {
    font-weight: bold;
    color: #ff2ed7 !important;
}

/* Ensure navbar button is clickable */
.navbar .btn-outline-light {
    position: relative;
    z-index: 1000;
    pointer-events: auto;
}

/* Chart containers */
.chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Metric cards - Standardized styling across all pages */
.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.metric-header {
    margin-bottom: 1rem;
}

.metric-title {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    text-align: center;
}

.metric-body {
    text-align: center;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: Georgia, 'Times New Roman', serif;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.metric-comparisons {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comparison-item {
    display: flex;
    justify-content: center;
    align-items: center;
}

.comparison-change {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Comparison status colors */
.text-about-same {
    color: #6066FA !important;
}

.text-up {
    color: #7ADA09 !important;
}

.text-down {
    color: #6c757d !important;
}

.text-muted {
    color: #6c757d !important;
}

/* All-time metric cards styling */
.metric-card.all-time-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e0e6eb;
}

.metric-card.all-time-card .metric-value {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.all-time-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Clickable cards styling */
.clickable-card {
    cursor: pointer;
}

.metric-card-link:hover {
    text-decoration: none !important;
}

@media (max-width: 768px) {
    .metric-value {
        font-size: 2rem;
    }
}

/* User dropdown menu styling */
.user-dropdown-toggle {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.user-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-dropdown-toggle:focus {
    box-shadow: none;
}

.user-dropdown-toggle .user-name {
    font-size: 14px;
    font-weight: 500;
}

.dropdown-menu {
    margin-top: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    padding: 10px 20px;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item i {
    width: 20px;
}

/* Top Episode Cards Styling */
.top-episode-card .metric-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.top-episode-body {
    padding-top: 0.5rem;
}

.top-episode-image {
    max-height: 2.5rem; /* Same height as metric-value font size */
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.top-episode-title {
    font-size: 1.25rem; /* Half of 2.5rem metric-value */
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.top-episode-card .period-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    margin-top: 0.5rem;
}

.top-episode-card.all-time-card .top-episode-title {
    color: #2c3e50;
}

/* Mobile navigation adjustments */
@media (max-width: 768px) {
    /* Smaller logo on mobile */
    .navbar-brand img {
        height: 24px !important;
    }
    
    /* Hide user name on mobile */
    .user-dropdown-toggle .user-name {
        display: none;
    }
    
    /* Center logo on mobile */
    .navbar .container-fluid {
        position: relative;
    }
    
    .navbar-brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Menu toggle button styling */
    #sidebarToggle {
        padding: 0.25rem 0.5rem;
        font-size: 1.25rem;
    }
    
    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        top: 56px;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 56px);
        z-index: 1000;
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
    }
    
    /* Show sidebar when active */
    .sidebar.show {
        left: 0;
    }
    
    /* Overlay for sidebar */
    .sidebar-overlay {
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        height: calc(100vh - 56px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Full width main content on mobile */
    main.col-md-9 {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Smaller font sizes for mobile */
    h1 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .metric-title {
        font-size: 0.75rem !important;
    }
    
    .metric-value {
        font-size: 1.75rem !important;
    }
    
    .comparison-change {
        font-size: 10px !important;
    }
    
    .all-time-label {
        font-size: 10px !important;
    }
    
    .metric-card {
        padding: 1rem !important;
    }
    
    .top-episode-title {
        font-size: 0.95rem !important;
    }
}