/* Improved Details Page Styles with Glassmorphism */
.details-page {
    min-height: 100vh;
    background: var(--bg-base, #0B0B0F);
    color: var(--text-hi, #fff);
    font-family: var(--font-sans, 'Inter', sans-serif);
    position: relative;
    overflow-x: hidden;
}

/* Ambient Background Blobs */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.6;
}

.blob {
    position: absolute;
    width: 540px;
    height: 540px;
    filter: blur(95px);
    border-radius: 50%;
    /* Static aurora — atmosphere without the cliché floating-orb animation. */
}

.blob-1 { top: -12%; left: -8%; background: radial-gradient(circle, var(--accent-tint-16, rgba(229, 169, 79, 0.16)) 0%, transparent 70%); }
.blob-2 { bottom: -15%; right: -10%; background: radial-gradient(circle, rgba(59, 130, 246, 0.10) 0%, transparent 70%); }
.blob-3 { top: 45%; left: 28%; background: radial-gradient(circle, rgba(91, 184, 156, 0.08) 0%, transparent 70%); }

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Glassmorphism Base Card */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* 1. Back Button - Premium Glass */
.back-to-browse {
    position: fixed;
    top: 44px; /* clear the 32px titlebar */
    left: 24px;
    z-index: 1000;
    background: var(--bg-overlay, rgba(11, 11, 15, 0.55));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    color: var(--text-hi, #fff);
    padding: 10px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-browse:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-3px);
}

/* 2. Hero Section - Cinematic Fade */
.details-hero {
    position: relative;
    width: 100%;
    height: 66vh;
    overflow: hidden;
}

/* Fine film grain over the backdrop for cinematic texture (SVG fractal noise). */
.details-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center 20%;
    filter: brightness(0.58) saturate(1.05);
}

.hero-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(11, 11, 15, 0) 0%,
        rgba(11, 11, 15, 0.2) 40%,
        rgba(11, 11, 15, 0.82) 80%,
        var(--bg-base, #0B0B0F) 100%);
}

/* Directional scrim so the left-anchored poster + title stay legible over any backdrop. */
.hero-gradient {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to right, rgba(11, 11, 15, 0.88) 0%, rgba(11, 11, 15, 0.3) 38%, transparent 62%),
        radial-gradient(130% 90% at 82% -10%, transparent 42%, rgba(11, 11, 15, 0.55) 100%);
}

/* 3. Main Content Layout */
.details-main {
    display: flex;
    gap: 60px;
    padding: 0 10% 0 14%;
    margin-top: -240px;
    position: relative;
    z-index: 10;
}

.details-poster-section {
    flex: 0 0 300px;
}

.poster-container {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.5s ease;
}

.poster-container:hover {
    transform: translateY(-10px) scale(1.02);
}

.details-poster {
    width: 100%;
    height: auto;
    display: block;
}

/* 4. Info Section Typography */
.details-info-section {
    flex: 1;
    padding-top: 20px;
}

.details-title {
    font-family: var(--font-display, 'Outfit', sans-serif);
    font-size: clamp(2.6rem, 5vw, 4.25rem);
    font-weight: 800;
    margin-bottom: 14px;
    line-height: 1.04;
    letter-spacing: -2px;
    color: var(--text-hi, #fff);
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}

.details-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    font-size: 1rem;
}

.meta-rating {
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}

.details-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.genre-tag {
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.genre-tag:hover {
    background: rgba(229, 169, 79, 0.2);
    border-color: var(--accent, #E5A94F);
    color: var(--text-hi);
}

.details-tagline {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--accent-hover, #F0BB68);
    margin-bottom: 15px;
    font-weight: 500;
    opacity: 0.8;
}

.details-overview {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 35px;
    max-width: 800px;
}

/* 5. Action Buttons */
.details-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 45px;
}

.action-btn {
    padding: 12px 30px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn.primary {
    background: var(--accent, #E5A94F);
    color: var(--accent-contrast, #0B0B0F);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-hi, #fff);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.action-btn:hover {
    transform: translateY(-4px);
    filter: brightness(1.08);
}

.action-btn.primary:hover {
    box-shadow: 0 10px 30px var(--accent-glow, rgba(229, 169, 79, 0.5));
}

.action-btn.lektor-pl-btn {
    background: linear-gradient(135deg, #DC143C 0%, #8B0000 100%);
    color: #fff;
    border: 1px solid rgba(220, 20, 60, 0.4);
    position: relative;
    overflow: hidden;
}

.action-btn.lektor-pl-btn::before {
    content: '🇵🇱';
    position: absolute;
    left: 10px;
    font-size: 14px;
    line-height: 1;
}

.action-btn.lektor-pl-btn svg {
    display: none;
}

.action-btn.lektor-pl-btn:hover {
    box-shadow: 0 10px 30px rgba(220, 20, 60, 0.45);
    border-color: rgba(220, 20, 60, 0.6);
}

.action-btn.lektor-pl-btn span,
.action-btn.lektor-pl-btn {
    padding-left: 36px;
}

/* 6. Extra Info - Simplified */
.details-extra-info {
    display: flex;
    gap: 40px;
    padding: 25px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
    letter-spacing: 1px;
}

.info-value {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* 7. Sources Section */
.sources-container {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    margin-top: 20px;
}

.sources-empty {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.sources-empty svg {
    width: 48px;
    height: 48px;
    color: rgba(255, 255, 255, 0.2);
}

.sources-empty p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
}

.search-sources-btn {
    margin-top: 10px;
    padding: 10px 25px;
    background: var(--accent, #E5A94F);
    color: var(--text-hi);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-sources-btn:hover {
    background: var(--accent-active);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 169, 79, 0.4);
}

/* Source Item Placeholder Styles */
.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.source-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(229, 169, 79, 0.3);
    transform: translateX(5px);
}

.source-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.source-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-hi);
}

.source-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.source-play-btn {
    width: 40px;
    height: 40px;
    background: var(--accent, #E5A94F);
    border: none;
    border-radius: 50%;
    color: var(--text-hi);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.source-play-btn:hover {
    transform: scale(1.1);
    background: var(--accent-active);
    box-shadow: 0 0 15px rgba(229, 169, 79, 0.5);
}

/* 8. Secondary Sections - Improved Spacing */
.details-section {
    padding: 60px 10% 20px 14%;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title svg {
    width: 24px !important;
    height: 24px !important;
    color: var(--accent, #E5A94F);
}

/* Cast, Similar, Screenshots - Unified Styles */
.cast-slider, .similar-grid, .screenshots-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0 30px;
    scrollbar-width: none;
}

.cast-slider::-webkit-scrollbar, 
.similar-grid::-webkit-scrollbar, 
.screenshots-grid::-webkit-scrollbar {
    display: none;
}

.similar-card {
    flex: 0 0 180px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

.similar-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(229, 169, 79, 0.3);
}

.similar-poster {
    width: 100%;
    height: 270px;
}

.similar-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-info {
    padding: 12px;
}

.similar-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.similar-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.similar-rating { color: #fbbf24; }

/* Cast Cards - Circles */
.cast-card {
    flex: 0 0 140px;
    text-align: center;
    cursor: pointer;
}

.cast-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.cast-card:hover .cast-photo {
    border-color: var(--accent, #E5A94F);
    transform: scale(1.05);
}

.cast-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.cast-character { font-size: 11px; color: rgba(255, 255, 255, 0.4); }

/* Screenshots */
.screenshot-item {
    flex: 0 0 280px;
    border-radius: 14px;
    overflow: hidden;
    height: 160px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.screenshot-item:hover {
    transform: scale(1.03);
    border-color: rgba(229, 169, 79, 0.3);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Season Selector */
.season-btn {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.season-btn.active {
    background: var(--accent, #E5A94F);
    color: var(--text-hi);
    border-color: var(--accent, #E5A94F);
}

/* Modals & Loading */
.details-loading {
    position: fixed;
    inset: 0;
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner-large {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(229, 169, 79, 0.2);
    border-top-color: var(--accent, #E5A94F);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile Adaptations */
@media (max-width: 1024px) {
    .details-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 5%;
        margin-top: -160px;
    }
    .details-title { font-size: 2.5rem; }
    .details-actions { justify-content: center; }
    .details-extra-info { justify-content: center; flex-wrap: wrap; }
    .back-to-browse { left: 20px; }
}

/* Improved Grids/Sliders */
.slider-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.slider-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: rgba(11, 11, 15, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-hi);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    opacity: 0;
}

.slider-container:hover .slider-nav-btn {
    opacity: 1;
}

.slider-nav-btn:hover {
    background: var(--accent, #E5A94F);
    border-color: var(--accent, #E5A94F);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(229, 169, 79, 0.4);
}

.slider-nav-btn.prev { left: -22px; }
.slider-nav-btn.next { right: -22px; }

.cast-slider, .similar-grid, .screenshots-grid {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    padding: 20px 0 40px;
    scrollbar-width: none;
    cursor: grab;
    scroll-behavior: smooth;
    width: 100%;
}

.cast-slider::-webkit-scrollbar, 
.similar-grid::-webkit-scrollbar, 
.screenshots-grid::-webkit-scrollbar {
    display: none;
}

/* 8. Similar Content Cards - CRITICAL IMPROVEMENT */
.similar-card {
    flex: 0 0 200px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
}

.similar-card:hover {
    transform: translateY(-15px) scale(1.05);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(229, 169, 79, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.similar-poster {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: hidden;
}

.similar-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.similar-card:hover .similar-poster img {
    transform: scale(1.1);
}

.similar-poster::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8, 8, 12, 0.9) 0%, transparent 60%);
    opacity: 0.8;
}

.similar-info {
    padding: 15px;
}

.similar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-hi);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.similar-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.similar-rating {
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 9. Cast Cards Improvements */
.cast-card {
    flex: 0 0 160px;
    text-align: center;
    cursor: pointer;
}

.cast-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 3px solid rgba(229, 169, 79, 0.2);
    transition: all 0.4s ease;
    background: var(--bg-elevated);
}

.cast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures the photo fills the circle properly */
    display: block;
}

.cast-card:hover .cast-photo {
    border-color: var(--accent, #E5A94F);
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(229, 169, 79, 0.5);
}

.cast-name { font-size: 15px; font-weight: 700; color: var(--text-hi); margin-bottom: 4px; }
.cast-character { font-size: 12px; color: rgba(255, 255, 255, 0.5); font-weight: 500; }

/* 10. Screenshot Items */
.screenshot-item {
    flex: 0 0 320px;
    border-radius: 16px;
    overflow: hidden;
    height: 180px;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.screenshot-item:hover {
    transform: scale(1.05);
    border-color: rgba(229, 169, 79, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    filter: brightness(1.1);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 11. Lightbox Fixes */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.lightbox.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-hi);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-hi);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    user-select: none;
}

.lightbox-nav:hover {
    background: var(--accent, #E5A94F);
    border-color: var(--accent, #E5A94F);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev { left: 40px; }
.lightbox-nav.next { right: 40px; }

.lightbox img {
    max-width: 85%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    object-fit: contain;
}
/* Season Selector Styles */
.seasons-navigation-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
}

.season-nav-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.season-nav-arrow svg {
    width: 24px;
    height: 24px;
}

.season-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-hi);
    transform: scale(1.05);
}

.season-nav-arrow:active {
    transform: scale(0.95);
}

.season-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.seasons-selector {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 5px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    scroll-behavior: smooth;
}

.seasons-selector::-webkit-scrollbar {
    display: none;
}

.season-btn {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.season-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-hi);
    transform: translateY(-2px);
}

.season-btn.active {
    background: var(--accent, #E5A94F);
    border-color: var(--accent, #E5A94F);
    color: var(--text-hi);
    box-shadow: 0 8px 20px rgba(229, 169, 79, 0.3);
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.episode-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.episode-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    border-color: rgba(229, 169, 79, 0.3);
}

.episode-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
}

.episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.episode-card:hover .episode-play-overlay {
    opacity: 1;
}

.episode-play-btn {
    width: 50px;
    height: 50px;
    background: var(--accent, #E5A94F);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hi);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.episode-card:hover .episode-play-btn {
    transform: scale(1);
}

.episode-number {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-hi);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(5px);
    z-index: 2;
}

.episode-runtime {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(229, 169, 79, 0.8);
    color: var(--text-hi);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(5px);
    z-index: 2;
}

.episode-info {
    padding: 20px;
}

.episode-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-hi);
}

.episode-overview {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modals & Loading */
.spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(229, 169, 79, 0.1);
    border-top-color: var(--accent, #E5A94F);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile Adaptations */
@media (max-width: 1024px) {
    .details-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 5%;
        margin-top: -200px;
    }
    .back-to-browse { left: 20px; }
    .details-title { font-size: 3rem; }
    .details-actions { justify-content: center; }
}

/* 8. Modals & Lightbox (CRITICAL FIX) */
.trailer-modal, .lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    display: none; /* Controlled by JS .active class */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.trailer-modal.active, .lightbox.active {
    display: flex;
}

.trailer-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(229, 169, 79, 0.3);
}

.trailer-modal-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}

.trailer-modal-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

.trailer-modal-close, .lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    font-size: 35px;
    color: var(--text-hi);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

/* Lightbox Nav Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-hi);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-nav:hover { background: var(--accent, #E5A94F); }
.lightbox-nav.prev { left: 30px; }
.lightbox-nav.next { right: 30px; }

/* Global Spinner */
.spinner-large {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(229, 169, 79, 0.2);
    border-top-color: var(--accent, #E5A94F);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Tablet */
@media (max-width: 1024px) {
    .details-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -100px;
    }
    .details-actions { justify-content: center; }
}

/* Phone — fix layout overflow reported by beta testers */
@media (max-width: 640px) {
    .details-hero { height: 48vh; }

    .details-main {
        padding: 0 4%;
        margin-top: -90px;
        gap: 16px;
    }

    /* Shrink the poster so it doesn't eat the whole screen */
    .details-poster-section {
        flex: 0 0 120px;
        width: 120px;
    }

    .details-title {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }

    /* Wrap action buttons so they don't overflow horizontally */
    .details-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .action-btn {
        padding: 10px 16px;
        font-size: 13px;
        flex: 1 1 auto;
        justify-content: center;
    }

    .details-overview {
        font-size: 0.92rem;
        line-height: 1.6;
    }

    .back-to-browse {
        left: 12px;
        top: 36px;
        padding: 7px 13px;
        font-size: 13px;
    }

    .details-extra-info {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .details-genres {
        justify-content: center;
    }
}