/* ═══════════════════════════════════════════════════════════
   FilmPlus Web - Complete Stylesheet
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --bg-input: #1e1e30;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --accent: #e50914;
    --accent-hover: #ff1a25;
    --accent-glow: rgba(229, 9, 20, 0.3);
    --gold: #f5c518;
    --green: #46d369;
    --border: #2a2a40;
    --shadow: rgba(0, 0, 0, 0.5);
    --sidebar-width: 220px;
    --sidebar-collapsed: 64px;
    --topbar-height: 60px;
    --radius: 8px;
    --radius-lg: 16px;
    --transition: 0.3s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f8;
    --bg-input: #eeeef5;
    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    --text-muted: #8888a0;
    --border: #d0d0e0;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* ═══ Luxury Theme Collection ═══ */

/* Midnight Blue - Deep navy sophistication */
[data-theme="midnight"] {
    --bg-primary: #0d1b2a;
    --bg-secondary: #1b2838;
    --bg-card: #1e3a5f;
    --bg-card-hover: #264b73;
    --bg-input: #1b3352;
    --text-primary: #e0e8f0;
    --text-secondary: #8ba7c4;
    --text-muted: #5a7d9e;
    --accent: #00b4d8;
    --accent-hover: #48cae4;
    --accent-glow: rgba(0, 180, 216, 0.3);
    --border: #2a4565;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Ocean Teal - Deep sea elegance */
[data-theme="ocean"] {
    --bg-primary: #0a1628;
    --bg-secondary: #0d2137;
    --bg-card: #122d4a;
    --bg-card-hover: #1a3d5c;
    --bg-input: #102a42;
    --text-primary: #e0f0f0;
    --text-secondary: #7fb8b8;
    --text-muted: #4d8a8a;
    --accent: #00d4aa;
    --accent-hover: #33e6c0;
    --accent-glow: rgba(0, 212, 170, 0.3);
    --border: #1a3d52;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Forest - Nature-inspired depth */
[data-theme="forest"] {
    --bg-primary: #0a1a0a;
    --bg-secondary: #112211;
    --bg-card: #1a331a;
    --bg-card-hover: #224422;
    --bg-input: #153015;
    --text-primary: #d8f0d8;
    --text-secondary: #7daa7d;
    --text-muted: #4d7a4d;
    --accent: #4caf50;
    --accent-hover: #66bb6a;
    --accent-glow: rgba(76, 175, 80, 0.3);
    --border: #2d4a2d;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Sunset - Warm amber luxury */
[data-theme="sunset"] {
    --bg-primary: #1a0e05;
    --bg-secondary: #2d1a0a;
    --bg-card: #3d2510;
    --bg-card-hover: #4a3018;
    --bg-input: #352010;
    --text-primary: #f0e0d0;
    --text-secondary: #c49a70;
    --text-muted: #8a6a42;
    --accent: #ff6b35;
    --accent-hover: #ff8555;
    --accent-glow: rgba(255, 107, 53, 0.3);
    --border: #4a3520;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Rose Gold - Elegant feminine warmth */
[data-theme="rosegold"] {
    --bg-primary: #1a0f15;
    --bg-secondary: #261620;
    --bg-card: #331f2d;
    --bg-card-hover: #402838;
    --bg-input: #2d1a28;
    --text-primary: #f0e0e8;
    --text-secondary: #c48fa5;
    --text-muted: #8a5a72;
    --accent: #e8a0bf;
    --accent-hover: #f0b8d0;
    --accent-glow: rgba(232, 160, 191, 0.3);
    --border: #40283a;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Purple Nebula - Cosmic depth */
[data-theme="nebula"] {
    --bg-primary: #120826;
    --bg-secondary: #1a0e35;
    --bg-card: #251545;
    --bg-card-hover: #302055;
    --bg-input: #201040;
    --text-primary: #e8e0f8;
    --text-secondary: #a088c8;
    --text-muted: #6a5090;
    --accent: #9b59b6;
    --accent-hover: #b370d0;
    --accent-glow: rgba(155, 89, 182, 0.3);
    --border: #35205a;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Arctic - Crisp ice-blue light theme */
[data-theme="arctic"] {
    --bg-primary: #e8ecf1;
    --bg-secondary: #f0f4f8;
    --bg-card: #ffffff;
    --bg-card-hover: #eef2f7;
    --bg-input: #e0e8f0;
    --text-primary: #1a2a3a;
    --text-secondary: #4a6580;
    --text-muted: #7a9ab5;
    --accent: #2196f3;
    --accent-hover: #42a5f5;
    --accent-glow: rgba(33, 150, 243, 0.3);
    --border: #c8d8e8;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Mocha - Rich coffee tones */
[data-theme="mocha"] {
    --bg-primary: #1a1410;
    --bg-secondary: #261e18;
    --bg-card: #332820;
    --bg-card-hover: #403228;
    --bg-input: #2d2218;
    --text-primary: #f0e8e0;
    --text-secondary: #c4a888;
    --text-muted: #8a7558;
    --accent: #d4a574;
    --accent-hover: #e0b888;
    --accent-glow: rgba(212, 165, 116, 0.3);
    --border: #403025;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Crimson - Bold dark red */
[data-theme="crimson"] {
    --bg-primary: #150808;
    --bg-secondary: #200e0e;
    --bg-card: #2d1515;
    --bg-card-hover: #3a1c1c;
    --bg-input: #281212;
    --text-primary: #f0e0e0;
    --text-secondary: #c48888;
    --text-muted: #8a5555;
    --accent: #dc143c;
    --accent-hover: #e83a5a;
    --accent-glow: rgba(220, 20, 60, 0.3);
    --border: #3a2020;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Emerald - Luxurious green depth */
[data-theme="emerald"] {
    --bg-primary: #081510;
    --bg-secondary: #0e201a;
    --bg-card: #152d25;
    --bg-card-hover: #1c3a30;
    --bg-input: #122820;
    --text-primary: #e0f0e8;
    --text-secondary: #80c0a0;
    --text-muted: #509070;
    --accent: #00c853;
    --accent-hover: #33d670;
    --accent-glow: rgba(0, 200, 83, 0.3);
    --border: #204035;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Netflix - Xeno Crimson streaming UI */
[data-theme="netflix"] {
    --bg-primary: #020202;
    --bg-secondary: #0a0a0a;
    --bg-card: rgba(20, 20, 20, 0.6);
    --bg-card-hover: rgba(40, 40, 40, 0.7);
    --bg-input: rgba(30, 30, 30, 0.8);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.25);
    --accent: #E50914;
    --accent-hover: #ff1a25;
    --accent-glow: rgba(229, 9, 20, 0.35);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.8);
    --radius: 2px;
    --radius-lg: 4px;
}

/* ═══ Netflix Theme — Global Overrides ═══ */
[data-theme="netflix"] body {
    font-weight: 600;
    letter-spacing: -0.01em;
}
[data-theme="netflix"] #sidebar {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-right: 1px solid rgba(255,255,255,0.05);
}
[data-theme="netflix"] .sidebar-logo .logo-text {
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}
[data-theme="netflix"] #topbar {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
[data-theme="netflix"] .card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 2px;
    transition: all 0.5s ease;
}
[data-theme="netflix"] .card:hover {
    border-color: rgba(229, 9, 20, 0.4);
    box-shadow: 0 0 30px rgba(229, 9, 20, 0.15);
    transform: scale(1.03);
}
[data-theme="netflix"] .card-title {
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.03em;
}
[data-theme="netflix"] .btn {
    border-radius: 2px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}
[data-theme="netflix"] .btn-primary {
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
}
[data-theme="netflix"] .hero-section {
    position: relative;
}
[data-theme="netflix"] .hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
}
[data-theme="netflix"] h1,
[data-theme="netflix"] h2,
[data-theme="netflix"] h3 {
    font-weight: 900;
    letter-spacing: -0.03em;
}
[data-theme="netflix"] .row-title {
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
[data-theme="netflix"] select,
[data-theme="netflix"] input {
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
}
[data-theme="netflix"] .settings-group {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
}
[data-theme="netflix"] .detail-hero {
    position: relative;
}
[data-theme="netflix"] .detail-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(2,2,2,0.85) 0%, transparent 60%);
    z-index: 1;
    pointer-events: none;
}
[data-theme="netflix"] .tag {
    border-radius: 2px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.6rem;
}
[data-theme="netflix"] .toast {
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 2px;
}

/* ═══ Netflix Theme — Player Overlay ═══ */
[data-theme="netflix"] .player-overlay {
    background: #020202;
}
[data-theme="netflix"] .player-overlay .player-header {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 10px 16px;
}
[data-theme="netflix"] .player-overlay .player-back {
    width: 44px;
    height: 44px;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
    transition: all 0.3s ease;
}
[data-theme="netflix"] .player-overlay .player-back:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}
[data-theme="netflix"] .player-overlay .player-title {
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    font-size: 15px;
}
[data-theme="netflix"] .player-source-select select {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 2px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 28px 8px 12px;
    backdrop-filter: blur(20px);
}
[data-theme="netflix"] .player-source-select select:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.2);
}
[data-theme="netflix"] .player-overlay .player-loading {
    background: radial-gradient(ellipse at center, rgba(2,2,2,0.98) 0%, #000 100%);
}
[data-theme="netflix"] .player-overlay .player-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.05;
    mix-blend-mode: overlay;
    pointer-events: none;
}
[data-theme="netflix"] .loader-cinema {
    filter: none;
}
[data-theme="netflix"] .cinema-orb {
    filter: blur(2px);
}
[data-theme="netflix"] .orb-1 {
    background: #E50914;
    box-shadow: 0 0 25px #E50914, 0 0 50px rgba(229,9,20,0.4);
}
[data-theme="netflix"] .orb-2 {
    background: #ff6b35;
    box-shadow: 0 0 25px #ff6b35, 0 0 50px rgba(255,107,53,0.4);
}
[data-theme="netflix"] .orb-3 {
    background: #ffffff;
    box-shadow: 0 0 25px rgba(255,255,255,0.6), 0 0 50px rgba(255,255,255,0.2);
}
[data-theme="netflix"] .cinema-icon {
    border: 2px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}
[data-theme="netflix"] .cinema-icon i {
    background: linear-gradient(135deg, #E50914, #ff6b35, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="netflix"] .cinema-ripple {
    border-color: rgba(229,9,20,0.25);
}
[data-theme="netflix"] .cinema-ripple.ripple-2 {
    border-color: rgba(255,107,53,0.2);
}
[data-theme="netflix"] .loader-status {
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.4) 30%, #fff 50%, rgba(255,255,255,0.4) 70%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="netflix"] .loader-src {
    border-radius: 2px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 9px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
}
[data-theme="netflix"] .loader-src.ready {
    border-color: rgba(229,9,20,0.4);
    background: rgba(229,9,20,0.1);
    color: #E50914;
}
[data-theme="netflix"] .loader-src.ready .src-dot {
    background: #E50914;
    box-shadow: 0 0 10px #E50914;
}
[data-theme="netflix"] .loader-bar {
    border-radius: 0;
    background: rgba(255,255,255,0.05);
}
[data-theme="netflix"] .loader-bar-fill {
    background: linear-gradient(90deg, #E50914, #ff6b35);
    border-radius: 0;
    box-shadow: 0 0 15px rgba(229,9,20,0.5);
}
[data-theme="netflix"] .player-overlay .episode-bar {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top: 1px solid rgba(255,255,255,0.06);
}
[data-theme="netflix"] .season-tab {
    border-radius: 2px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 10px;
}
[data-theme="netflix"] .season-tab.active {
    background: #E50914;
    box-shadow: 0 0 15px rgba(229,9,20,0.3);
}
[data-theme="netflix"] .ep-chip {
    border-radius: 2px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
[data-theme="netflix"] .ep-chip:hover {
    border-color: rgba(229,9,20,0.5);
    background: rgba(229,9,20,0.1);
}
[data-theme="netflix"] .ep-chip.active {
    background: #E50914;
    border-color: #E50914;
    box-shadow: 0 0 12px rgba(229,9,20,0.3);
}
/* Netflix — Subtitle controls */
[data-theme="netflix"] .subtitle-controls {
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0;
}
[data-theme="netflix"] .ctrl-btn {
    border-radius: 2px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
[data-theme="netflix"] .ctrl-btn:hover {
    background: #E50914;
    border-color: #E50914;
    box-shadow: 0 0 15px rgba(229,9,20,0.3);
}
/* Netflix — Player controls bar */
[data-theme="netflix"] .player-controls-bar {
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0;
    border-top: none;
}
[data-theme="netflix"] .player-controls-bar select {
    border-radius: 2px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    font-weight: 700;
    font-size: 0.8rem;
}
[data-theme="netflix"] .player-controls-bar label {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
}
/* Netflix — Watch page episodes */
[data-theme="netflix"] .watch-episodes {
    background: rgba(10,10,10,0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 2px;
}
[data-theme="netflix"] .watch-ep-btn {
    border-radius: 2px;
    font-weight: 800;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
[data-theme="netflix"] .watch-ep-btn:hover {
    border-color: rgba(229,9,20,0.4);
    background: rgba(229,9,20,0.1);
}
[data-theme="netflix"] .watch-ep-btn.active {
    background: #E50914;
    border-color: #E50914;
    box-shadow: 0 0 10px rgba(229,9,20,0.3);
}
/* Netflix — Scrollbars */
[data-theme="netflix"] ::-webkit-scrollbar { width: 4px; height: 4px; }
[data-theme="netflix"] ::-webkit-scrollbar-track { background: transparent; }
[data-theme="netflix"] ::-webkit-scrollbar-thumb { background: rgba(229,9,20,0.4); border-radius: 0; }
[data-theme="netflix"] ::-webkit-scrollbar-thumb:hover { background: #E50914; }
/* Netflix — Genre cards */
[data-theme="netflix"] .genre-card {
    border-radius: 2px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
/* Netflix — Loading overlay (non-player) */
[data-theme="netflix"] .player-loading-overlay {
    background: radial-gradient(ellipse at center, rgba(2,2,2,0.97) 0%, rgba(0,0,0,0.99) 100%);
}
[data-theme="netflix"] .loading-rings {
    filter: drop-shadow(0 0 20px rgba(229,9,20,0.5));
}
[data-theme="netflix"] .ring-1 {
    border-top-color: #E50914;
    border-right-color: #E50914;
}
[data-theme="netflix"] .ring-2 {
    border-bottom-color: #ff6b35;
    border-left-color: #ff6b35;
}
[data-theme="netflix"] .loading-icon {
    color: #E50914;
    filter: drop-shadow(0 0 12px rgba(229,9,20,0.6));
}
/* Netflix — Progress bars on continue watching cards */
[data-theme="netflix"] .progress-bar {
    border-radius: 0;
    background: rgba(255,255,255,0.08);
}
[data-theme="netflix"] .progress-fill {
    border-radius: 0;
    box-shadow: 0 0 8px rgba(229,9,20,0.5);
}

/* ═══════════════════════════════════════════════════════════════
   Netflix Theme — Xeno Player UI (Super Player faithful replica)
   Floating top module, center controls, bottom module,
   biometric side bars, tactical matrix drawer
   ═══════════════════════════════════════════════════════════════ */

/* --- Hide by default, show only on netflix theme --- */
.nfx-overlay, .nfx-drawer { display: none; }

[data-theme="netflix"] .nfx-overlay {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: absolute;
    inset: 0;
    z-index: 20;
    padding: 24px;
    pointer-events: none;
    cursor: default;
    overflow: hidden;
}
[data-theme="netflix"] .nfx-overlay > * { pointer-events: auto; }

/* --- Gradient Overlays (cinematic top+bottom vignette) --- */
[data-theme="netflix"] .nfx-grad-top {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}
[data-theme="netflix"] .nfx-grad-bot {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}
[data-theme="netflix"] .nfx-noise {
    position: absolute;
    inset: 0;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.05;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 0;
}

/* --- Auto-hide transitions (controls fade out) --- */
[data-theme="netflix"] .nfx-overlay.nfx-hidden .nfx-top {
    transform: translateY(-80px);
    opacity: 0;
    filter: blur(16px);
    pointer-events: none;
}
[data-theme="netflix"] .nfx-overlay.nfx-hidden .nfx-center {
    transform: translate(-50%, -50%) scale(0.75);
    opacity: 0;
    filter: blur(48px);
    pointer-events: none;
}
/* Center play/pause auto-hide when video is playing */
[data-theme="netflix"] .nfx-center.nfx-center-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.6);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-theme="netflix"] .nfx-overlay.nfx-hidden .nfx-bottom {
    transform: translateY(80px);
    opacity: 0;
    filter: blur(16px);
    pointer-events: none;
}
[data-theme="netflix"] .nfx-overlay.nfx-hidden .nfx-side {
    opacity: 0 !important;
    pointer-events: none;
}

/* Hide native video controls when Netflix UI active */
[data-theme="netflix"] #ov-player-video::-webkit-media-controls { display: none !important; }
/* Only hide cursor when controls are faded out */
[data-theme="netflix"] .nfx-overlay.nfx-hidden ~ #ov-player-video,
[data-theme="netflix"] .player-overlay.active .nfx-overlay.nfx-hidden ~ #ov-player-video { cursor: none; }

/* Hide header source selects on Netflix (moved to drawer) */
[data-theme="netflix"] .player-header { display: none !important; }

/* When iframe is active (not direct video), hide nfx interactive controls but keep gradients */
[data-theme="netflix"] .player-area iframe[style*="display: block"] ~ .nfx-overlay .nfx-center,
[data-theme="netflix"] .player-area iframe[style*="display:block"] ~ .nfx-overlay .nfx-center { display: none; }
[data-theme="netflix"] .player-area iframe[style*="display: block"] ~ .nfx-overlay .nfx-bottom,
[data-theme="netflix"] .player-area iframe[style*="display:block"] ~ .nfx-overlay .nfx-bottom { display: none; }
[data-theme="netflix"] .player-area iframe[style*="display: block"] ~ .nfx-overlay .nfx-side,
[data-theme="netflix"] .player-area iframe[style*="display:block"] ~ .nfx-overlay .nfx-side { display: none; }

/* ─── Floating Top Module ─── */
[data-theme="netflix"] .nfx-top {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}
[data-theme="netflix"] .nfx-top-left {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px;
    padding-right: 40px;
    backdrop-filter: blur(64px);
    -webkit-backdrop-filter: blur(64px);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 2px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
[data-theme="netflix"] .nfx-back-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 2px;
}
[data-theme="netflix"] .nfx-back-btn:hover { background: rgba(255,255,255,0.1); }
[data-theme="netflix"] .nfx-top-info {
    display: flex;
    flex-direction: column;
    margin-left: 16px;
}
[data-theme="netflix"] .nfx-top-title {
    font-size: 16px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    line-height: 1;
    color: white;
    margin-bottom: 4px;
}
[data-theme="netflix"] .nfx-top-status {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.3;
}
[data-theme="netflix"] .nfx-top-status i {
    font-size: 10px;
    color: #E50914;
    animation: nfxPulse 3s ease-in-out infinite;
}
[data-theme="netflix"] .nfx-top-status span {
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: rgba(255,255,255,0.5);
}

/* Top right round buttons */
[data-theme="netflix"] .nfx-top-right {
    display: flex;
    gap: 16px;
}
[data-theme="netflix"] .nfx-top-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.03);
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
    cursor: pointer;
    transition: all 0.3s;
}
[data-theme="netflix"] .nfx-top-btn:hover { opacity: 1; background: rgba(255,255,255,0.08); }

/* ─── Center Play/Pause/Skip ─── */
[data-theme="netflix"] .nfx-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 80px;
    z-index: 25;
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}
[data-theme="netflix"] .nfx-skip {
    width: 60px;
    height: 60px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.2);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-theme="netflix"] .nfx-skip:hover { color: white; }
[data-theme="netflix"] .nfx-skip:active { transform: scale(0.75); }

[data-theme="netflix"] .nfx-pp {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: #E50914;
    font-size: 48px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 80px rgba(229,9,20,0.07);
}
[data-theme="netflix"] .nfx-pp:hover {
    box-shadow: 0 0 100px rgba(229,9,20,0.15);
}
[data-theme="netflix"] .nfx-pp:hover .nfx-pp-bg { background: rgba(255,255,255,0.05); }
[data-theme="netflix"] .nfx-pp-bg {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.02);
    transition: background 0.3s;
}
[data-theme="netflix"] .nfx-pp-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border-top: 2px solid rgba(255,255,255,0.1);
    animation: nfxSpin 8s linear infinite;
    opacity: 0.2;
}
[data-theme="netflix"] .nfx-pp-icon {
    position: relative;
    z-index: 2;
    font-size: 48px;
    color: #E50914;
    filter: drop-shadow(0 0 20px rgba(229,9,20,0.6));
}

/* ─── Detached Bottom Module ─── */
[data-theme="netflix"] .nfx-bottom {
    position: relative;
    z-index: 10;
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Time row */
[data-theme="netflix"] .nfx-time-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    padding: 0 24px;
}
[data-theme="netflix"] .nfx-time-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
[data-theme="netflix"] .nfx-time-right { text-align: right; align-items: flex-end; }
[data-theme="netflix"] .nfx-time-label {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    color: rgba(255,255,255,0.4);
}
[data-theme="netflix"] .nfx-time-val {
    font-size: 12px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.05em;
    color: white;
}
[data-theme="netflix"] .nfx-time-right .nfx-time-val { color: rgba(255,255,255,0.6); }

/* Streaming indicator center */
[data-theme="netflix"] .nfx-stream-ind {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    color: #E50914;
}
[data-theme="netflix"] .nfx-bolt {
    font-size: 14px;
    animation: nfxBounce 2s ease-in-out infinite;
}
[data-theme="netflix"] .nfx-stream-ind span {
    font-size: 9px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    animation: nfxPulse 2s ease-in-out infinite;
}

/* Seek bar */
[data-theme="netflix"] .nfx-seek {
    position: relative;
    height: 4px;
    width: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: 100px;
    cursor: pointer;
    margin-bottom: 24px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transition: height 0.15s;
}
[data-theme="netflix"] .nfx-seek:hover { height: 6px; }
[data-theme="netflix"] .nfx-seek:hover .nfx-seek-thumb { opacity: 1; transform: translateY(-50%) scale(1); }
[data-theme="netflix"] .nfx-seek-buf {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 100px;
    background: rgba(255,255,255,0.08);
    transition: width 0.3s ease;
}
[data-theme="netflix"] .nfx-seek-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 100px;
    background: #E50914;
    box-shadow: 0 0 20px #E50914;
    transition: width 0.1s linear;
}
[data-theme="netflix"] .nfx-seek-thumb {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    margin-left: -12px;
    border-radius: 50%;
    background: #E50914;
    border: 3px solid white;
    transform: translateY(-50%) scale(0);
    box-shadow: 0 0 30px rgba(255,255,255,1);
    transition: all 0.2s ease;
    opacity: 0;
    z-index: 3;
}

/* Action buttons row */
[data-theme="netflix"] .nfx-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px 16px;
}
[data-theme="netflix"] .nfx-actions-left,
[data-theme="netflix"] .nfx-actions-right {
    display: flex;
    gap: 16px;
}
[data-theme="netflix"] .nfx-act {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: none;
    border: 1px solid transparent;
    color: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.7s ease;
    border-radius: 2px;
}
[data-theme="netflix"] .nfx-act i { font-size: 20px; transition: all 0.7s ease; }
[data-theme="netflix"] .nfx-act span {
    font-size: 7px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    opacity: 0.1;
    transition: all 0.7s ease;
}
[data-theme="netflix"] .nfx-act:hover {
    color: white;
    background: rgba(255,255,255,0.02);
}
[data-theme="netflix"] .nfx-act:hover span { opacity: 0.4; }
[data-theme="netflix"] .nfx-act.active {
    color: #E50914;
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}
[data-theme="netflix"] .nfx-act.active i { transform: scale(1.25); color: #E50914; }
[data-theme="netflix"] .nfx-act.active span { opacity: 1; color: #E50914; }

/* ─── Biometric Side Bars ─── */
[data-theme="netflix"] .nfx-side {
    position: absolute;
    width: 8px;
    top: 160px;
    bottom: 160px;
    border-radius: 100px;
    background: rgba(255,255,255,0.02);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    opacity: 0.2;
    transition: opacity 0.3s ease;
    z-index: 22;
}
[data-theme="netflix"] .nfx-side:hover { opacity: 1; }
[data-theme="netflix"] .nfx-side-l { left: 24px; }
[data-theme="netflix"] .nfx-side-r { right: 24px; }
[data-theme="netflix"] .nfx-side-fill {
    width: 100%;
    background: #E50914;
    border-radius: 100px;
    transition: height 0.3s ease;
    box-shadow: 0 0 10px rgba(229,9,20,0.5);
}

/* ─── Tactical Matrix Settings Drawer ─── */
[data-theme="netflix"] .nfx-drawer {
    display: flex;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 384px;
    max-width: 90vw;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(60px);
    -webkit-backdrop-filter: blur(60px);
    border-left: 1px solid rgba(255,255,255,0.05);
    z-index: 50;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}
[data-theme="netflix"] .nfx-drawer.open {
    transform: translateX(0);
    opacity: 1;
}
[data-theme="netflix"] .nfx-drawer-head {
    padding: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.02);
}
[data-theme="netflix"] .nfx-drawer-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}
[data-theme="netflix"] .nfx-drawer-back {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s;
    display: none;
}
[data-theme="netflix"] .nfx-drawer-back:hover { color: white; }
[data-theme="netflix"] .nfx-drawer-title {
    font-size: 12px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white;
}
[data-theme="netflix"] .nfx-drawer-x {
    background: none;
    border: none;
    color: rgba(255,255,255,0.2);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    padding: 4px;
}
[data-theme="netflix"] .nfx-drawer-x:hover { color: white; }
[data-theme="netflix"] .nfx-drawer-body {
    flex: 1;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
[data-theme="netflix"] .nfx-drawer-body::-webkit-scrollbar { display: none; }
[data-theme="netflix"] .nfx-drawer-foot {
    padding: 40px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.6em;
    text-align: center;
    color: rgba(255,255,255,0.1);
}

/* Drawer menu items (faithful to MenuItem component) */
[data-theme="netflix"] .nfx-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.2s;
}
[data-theme="netflix"] .nfx-menu-item:hover { background: rgba(255,255,255,0.05); }
[data-theme="netflix"] .nfx-menu-item:active { background: rgba(255,255,255,0.1); }
[data-theme="netflix"] .nfx-menu-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
[data-theme="netflix"] .nfx-menu-icon {
    font-size: 18px;
    color: rgba(255,255,255,0.3);
    width: 24px;
    text-align: center;
    transition: all 0.3s;
}
[data-theme="netflix"] .nfx-menu-item:hover .nfx-menu-icon { color: white; }
[data-theme="netflix"] .nfx-menu-item.active .nfx-menu-icon { color: #E50914; transform: scale(1.1); }
[data-theme="netflix"] .nfx-menu-label {
    font-size: 14px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    color: rgba(255,255,255,0.5);
    transition: color 0.3s;
}
[data-theme="netflix"] .nfx-menu-item:hover .nfx-menu-label { color: white; }
[data-theme="netflix"] .nfx-menu-item.active .nfx-menu-label { color: white; }
[data-theme="netflix"] .nfx-menu-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
[data-theme="netflix"] .nfx-menu-val {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.4);
    transition: all 0.3s;
}
[data-theme="netflix"] .nfx-menu-item:hover .nfx-menu-val { color: white; }
[data-theme="netflix"] .nfx-menu-item.active .nfx-menu-val { color: #E50914; }
[data-theme="netflix"] .nfx-menu-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #E50914;
    box-shadow: 0 0 12px #E50914;
    animation: nfxPulse 2s ease-in-out infinite;
}
[data-theme="netflix"] .nfx-menu-arrow {
    font-size: 14px;
    color: rgba(255,255,255,0.1);
}

/* SliderField in drawer (customize page) */
[data-theme="netflix"] .nfx-slider-field {
    padding: 20px 24px;
}
[data-theme="netflix"] .nfx-slider-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
[data-theme="netflix"] .nfx-slider-label {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: rgba(255,255,255,0.4);
}
[data-theme="netflix"] .nfx-slider-val {
    font-size: 10px;
    font-weight: 900;
    font-style: italic;
    color: #E50914;
}
[data-theme="netflix"] .nfx-slider-track {
    position: relative;
    height: 6px;
    width: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: 100px;
}
[data-theme="netflix"] .nfx-slider-fill {
    position: absolute;
    height: 100%;
    border-radius: 100px;
    background: #E50914;
    box-shadow: 0 0 15px rgba(255,255,255,0.3);
    transition: width 0.5s;
}
[data-theme="netflix"] .nfx-slider-thumb {
    position: absolute;
    height: 16px;
    width: 16px;
    top: -5px;
    margin-left: -8px;
    border-radius: 50%;
    border: 2px solid white;
    background: #E50914;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    transition: left 0.5s;
}

/* Drawer animate-in classes */
[data-theme="netflix"] .nfx-slide-right {
    animation: nfxSlideRight 0.5s ease-out forwards;
}
[data-theme="netflix"] .nfx-slide-left {
    animation: nfxSlideLeft 0.5s ease-out forwards;
}

/* ─── Bottom Inline Control Bar ─── */
[data-theme="netflix"] .nfx-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}
[data-theme="netflix"] .nfx-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
[data-theme="netflix"] .nfx-bar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
[data-theme="netflix"] .nfx-bar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}
[data-theme="netflix"] .nfx-bar-btn:hover { color: white; background: rgba(255,255,255,0.1); }
[data-theme="netflix"] .nfx-bar-btn.active { color: #E50914; }
[data-theme="netflix"] .nfx-bar-time {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
[data-theme="netflix"] .nfx-bar-divider {
    color: rgba(255,255,255,0.2);
    font-size: 14px;
    margin: 0 4px;
    flex-shrink: 0;
}
[data-theme="netflix"] .nfx-bar-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ─── Radio Items (Speed selector) ─── */
[data-theme="netflix"] .nfx-radio-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    cursor: pointer;
    transition: opacity 0.2s;
}
[data-theme="netflix"] .nfx-radio-item:hover { opacity: 1; }
[data-theme="netflix"] .nfx-radio-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
[data-theme="netflix"] .nfx-radio-circle.checked {
    border-color: #E50914;
}
[data-theme="netflix"] .nfx-radio-circle.checked::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #E50914;
}
[data-theme="netflix"] .nfx-radio-label {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
}
[data-theme="netflix"] .nfx-radio-item.active .nfx-radio-label { color: white; }

/* ─── Customize Drawer Page ─── */
[data-theme="netflix"] .nfx-customize-section {
    margin-bottom: 24px;
}
[data-theme="netflix"] .nfx-customize-label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-bottom: 16px;
}
[data-theme="netflix"] .nfx-color-row {
    display: flex;
    gap: 16px;
}
[data-theme="netflix"] .nfx-color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}
[data-theme="netflix"] .nfx-color-circle:hover { opacity: 1; }
[data-theme="netflix"] .nfx-color-circle.selected {
    border-color: white;
    opacity: 1;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
    transform: scale(1.1);
}
[data-theme="netflix"] .nfx-timing-btns {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: center;
}
[data-theme="netflix"] .nfx-timing-btn {
    padding: 10px 24px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
[data-theme="netflix"] .nfx-timing-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

/* --- Animations --- */
@keyframes nfxSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes nfxPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes nfxBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes nfxSlideRight { from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes nfxSlideLeft { from { transform: translateX(-50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Responsive: smaller screens --- */
@media (max-width: 768px) {
    [data-theme="netflix"] .nfx-overlay { padding: 12px; }
    [data-theme="netflix"] .nfx-center { gap: 30px; }
    [data-theme="netflix"] .nfx-pp { width: 80px; height: 80px; }
    [data-theme="netflix"] .nfx-pp-icon { font-size: 32px; }
    [data-theme="netflix"] .nfx-skip { font-size: 20px; }
    [data-theme="netflix"] .nfx-bottom { padding: 0; }
    [data-theme="netflix"] .nfx-bar { padding: 4px 0; }
    [data-theme="netflix"] .nfx-bar-left { gap: 8px; }
    [data-theme="netflix"] .nfx-bar-title { display: none; }
    [data-theme="netflix"] .nfx-bar-divider { display: none; }
    [data-theme="netflix"] .nfx-bar-btn { width: 32px; height: 32px; font-size: 14px; }
    [data-theme="netflix"] .nfx-bar-time { font-size: 11px; }
    [data-theme="netflix"] .nfx-drawer { width: 300px; }
    [data-theme="netflix"] .nfx-side { display: none; }
    [data-theme="netflix"] .nfx-top-right { display: none; }
    [data-theme="netflix"] .nfx-top-left { padding-right: 16px; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
select, input { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Sidebar ─── */
#sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition);
}

.sidebar-logo {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    min-height: 60px;
}
.sidebar-logo i { font-size: 1.6rem; }

.sidebar-menu {
    list-style: none;
    padding: 12px 8px;
    flex: 1;
    overflow-y: auto;
}
.sidebar-menu li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 2px;
    font-weight: 500;
    white-space: nowrap;
}
.sidebar-menu li:hover { background: var(--bg-card); color: var(--text-primary); }
.sidebar-menu li.active { background: var(--accent); color: #fff; }
.sidebar-menu li i { width: 20px; text-align: center; font-size: 1.1rem; }

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
}
.sidebar-plan-badge {
    margin-left: auto;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.sidebar-plan-badge.premium-active {
    background: rgba(70,211,105,0.15);
    color: #46d369;
    border: 1px solid rgba(70,211,105,0.3);
}
.sidebar-plan-badge.trial-active {
    background: rgba(255,159,67,0.15);
    color: #ff9f43;
    border: 1px solid rgba(255,159,67,0.3);
    animation: trialPulse 2s ease-in-out infinite;
}
.sidebar-plan-badge.trial-expired {
    background: rgba(231,76,60,0.15);
    color: #e74c3c;
    border: 1px solid rgba(231,76,60,0.3);
}
@keyframes trialPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.sidebar-settings {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 500;
}
.sidebar-settings:hover { background: var(--bg-card); color: var(--text-primary); }

/* ─── Main Content ─── */
#main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

/* ─── Top Bar ─── */
#topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 90;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 15, 0.85);
}
[data-theme="light"] #topbar { background: rgba(255, 255, 255, 0.9); }

#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.search-bar {
    position: relative;
    flex: 1;
    max-width: 500px;
}
.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition);
}
.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 10px 40px var(--shadow);
}
.search-suggestions.hidden { display: none; }
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition);
}
.suggestion-item:hover { background: var(--bg-card); }
.suggestion-item img {
    width: 40px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-card);
}
.suggestion-info { flex: 1; }
.suggestion-info h4 { font-size: 0.9rem; font-weight: 500; }
.suggestion-info span { font-size: 0.8rem; color: var(--text-muted); }

.topbar-right { display: flex; gap: 8px; }
.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-card-hover); }

/* ─── Utility ─── */
.hidden { display: none !important; }

/* ─── Pages ─── */
.page { display: none; padding-bottom: 40px; min-height: 60vh; }
.page.active { display: block; }

/* ─── Hero Banner ─── */
.hero-banner {
    position: relative;
    height: 70vh;
    min-height: 450px;
    max-height: 700px;
    background-size: cover;
    background-position: center 20%;
    display: flex;
    align-items: flex-end;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        transparent 30%,
        rgba(10,10,15,0.25) 55%,
        rgba(10,10,15,0.6) 75%,
        var(--bg-primary) 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 48px 48px;
    max-width: 700px;
}
.hero-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.hero-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}
.hero-meta .fas.fa-star { color: var(--gold); }
.hero-actions { display: flex; gap: 12px; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #ef4444; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-icon-lg {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.btn-icon-lg:hover { background: var(--bg-card-hover); }
.btn-icon-lg.active { color: var(--accent); border-color: var(--accent); }

/* ─── Content Row (Horizontal Scroll) ─── */
.content-sections { padding: 0 24px; }
.content-row { margin-bottom: 32px; position: relative; }
.row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 4px;
}
.row-header h2 { font-size: 1.3rem; font-weight: 700; }
.see-all {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition);
}
.see-all:hover { color: var(--accent); }

.row-scroll-wrap {
    position: relative;
    overflow: visible;
}
.row-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    overflow-x: auto !important;
    overflow-y: hidden;
    padding-bottom: 14px;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #e50914 rgba(255,255,255,0.12);
}
.row-scroll:active { cursor: grabbing; }
.row-scroll.dragging { cursor: grabbing; }
/* Webkit scrollbar (Chrome, Edge, Safari) */
.row-scroll::-webkit-scrollbar { height: 8px !important; display: block !important; }
.row-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.1) !important; border-radius: 4px; }
.row-scroll::-webkit-scrollbar-thumb { background: #e50914 !important; border-radius: 4px; }
.row-scroll::-webkit-scrollbar-thumb:hover { background: #ff1a25 !important; }

/* Row Navigation Arrows */
.row-nav {
    position: absolute;
    top: calc(50% - 10px);
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(10,10,15,0.85);
    border: 2px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.row-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 4px 20px var(--accent-glow);
}
.row-nav.left { left: 4px; }
.row-nav.right { right: 4px; }
.row-nav.hidden { opacity: 0; pointer-events: none; }

[data-theme="light"] .row-nav {
    background: rgba(255,255,255,0.9);
    border-color: rgba(0,0,0,0.15);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
[data-theme="light"] .row-scroll { scrollbar-color: #e50914 rgba(0,0,0,0.08); }
[data-theme="light"] .row-scroll::-webkit-scrollbar-track { background: rgba(0,0,0,0.08) !important; }

/* ─── Card ─── */
.card {
    flex: 0 0 auto;
    width: 160px;
    cursor: pointer;
    transition: transform var(--transition);
}
.card:hover { transform: translateY(-6px); }
.card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}
.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}
.card:hover .card-poster img { transform: scale(1.08); }
.card-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.75);
    color: var(--gold);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
}
.card-type {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.card-badge-4k {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
}
.card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity var(--transition);
}
.card:hover .card-play { opacity: 1; }
.card-play i { font-size: 2.5rem; color: #fff; }
.card-info { padding: 8px 2px; }
.card-info h3 {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── Continue Watching ─── */
#continue-watching .row-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
}
#continue-watching .row-header h2 i {
    font-size: 1.1rem;
}
.cw-clear {
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color var(--transition);
    font-weight: 500;
}
.cw-clear:hover { color: var(--accent); }

.cw-card .card-poster { position: relative; }
.cw-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 40%, transparent 70%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 8px 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.cw-card:hover .cw-overlay { opacity: 1; }
.cw-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: transform 0.2s ease;
}
.cw-card:hover .cw-play { transform: translate(-50%, -50%) scale(1.1); }
.cw-play i { font-size: 1.2rem; color: #fff; margin-left: 2px; }
.cw-time {
    color: rgba(255,255,255,0.9);
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.cw-ep {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 2px;
}
.cw-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255,255,255,0.2);
    z-index: 5;
}
.cw-progress {
    height: 100%;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--accent-glow);
}
.cw-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
}
.cw-card:hover .cw-remove { opacity: 1; }
.cw-remove:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.cw-meta {
    font-size: 0.75rem !important;
    color: var(--accent) !important;
    font-weight: 500;
}

/* ─── Content Grid ─── */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 0 24px;
}
.content-grid .card {
    width: 100%;
}

/* ─── Browse Header ─── */
.browse-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.browse-header h1 { font-size: 1.8rem; font-weight: 700; }
.browse-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.browse-filters select,
.season-selector select,
.source-selector select,
.subtitle-selector select,
.server-selector select,
.watch-ep-header select,
.settings-group select {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}
.browse-filters select:focus,
select:focus {
    border-color: var(--accent);
}

/* Direct stream badge (shown when ad-free extraction succeeds) */
.direct-stream-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb, 99, 102, 241), 0.15), rgba(var(--accent-rgb, 99, 102, 241), 0.05));
    border: 1px solid var(--accent);
    border-radius: 20px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    animation: glowPulse 2s ease-in-out infinite;
}

.load-more {
    text-align: center;
    padding: 24px;
}
.load-more.hidden { display: none; }

/* ─── Genres Grid ─── */
.genre-tabs {
    display: flex;
    gap: 8px;
    padding: 0 24px;
    margin-bottom: 20px;
}
.genre-tab {
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    transition: all var(--transition);
}
.genre-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.genre-tab:hover:not(.active) { background: var(--bg-card-hover); }

.genres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 0 24px;
}
.genre-card {
    padding: 28px 20px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-hover) 100%);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all var(--transition);
    font-size: 1.05rem;
    font-weight: 600;
}
.genre-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 30px var(--accent-glow);
}
.genre-card i {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--accent);
}

/* ─── Detail Page ─── */
.detail-backdrop {
    height: 50vh;
    min-height: 350px;
    background-size: cover;
    background-position: center top;
    position: relative;
}
.detail-backdrop-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, var(--bg-primary) 100%);
}
.detail-content {
    display: flex;
    gap: 32px;
    padding: 0 48px;
    margin-top: -180px;
    position: relative;
    z-index: 2;
}
.detail-poster {
    flex: 0 0 220px;
}
.detail-poster img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px var(--shadow);
}
.detail-info { flex: 1; padding-top: 60px; }
.detail-info h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}
.detail-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-wrap: wrap;
}
.detail-rating { color: var(--gold); font-weight: 600; }
.detail-genres {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.detail-genres .genre-tag {
    padding: 4px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.detail-genres .genre-tag.clickable {
    cursor: pointer;
    transition: all 0.25s ease;
}
.detail-genres .genre-tag.clickable:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb, 99,102,241), 0.3);
}
.detail-overview {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.detail-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

/* Cast */
.detail-cast { margin-top: 8px; }
.detail-cast h3 { margin-bottom: 12px; font-size: 1.1rem; }
.cast-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.cast-scroll::-webkit-scrollbar { display: none; }
.cast-card {
    flex: 0 0 auto;
    width: 80px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.cast-card:hover {
    transform: translateY(-4px);
}
.cast-card img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 6px;
    background: var(--bg-card);
    transition: box-shadow 0.2s ease, border 0.2s ease;
    border: 2px solid transparent;
}
.cast-card:hover img {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.cast-card h4 { font-size: 0.75rem; font-weight: 500; }
.cast-card span { font-size: 0.7rem; color: var(--text-muted); }

/* Seasons/Episodes */
.detail-seasons {
    padding: 32px 48px;
}
.detail-seasons h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
}
.season-selector {
    margin-bottom: 16px;
}
.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.episode-item {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    align-items: center;
}
.episode-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}
.episode-still {
    flex: 0 0 180px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-primary);
    position: relative;
}
.episode-still img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.episode-still .ep-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity var(--transition);
}
.episode-item:hover .ep-play-icon { opacity: 1; }
.ep-play-icon i { font-size: 1.8rem; color: #fff; }
.episode-info { flex: 1; }
.episode-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.episode-info .ep-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.episode-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Watch / Player Page ─── */
.watch-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
.player-wrapper { margin-bottom: 0; }
.player-area {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}
.player-area iframe,
.player-area video {
    width: 100%;
    height: 100%;
    border: none;
}
.player-area video {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}
.player-area video.hidden { display: none; }

/* ─── Player Loading Overlay ─── */
.player-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center, rgba(10,10,15,0.95) 0%, rgba(0,0,0,0.98) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease;
}
.player-loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}
.player-loading-overlay.hidden {
    display: none;
}
.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loading-rings {
    position: relative;
    width: 110px;
    height: 110px;
    filter: drop-shadow(0 0 15px rgba(229, 9, 20, 0.4));
}
.ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}
.ring-1 {
    top: 0; left: 0; right: 0; bottom: 0;
    border-top-color: var(--accent);
    border-right-color: var(--accent);
    animation: spin 1.2s linear infinite;
    box-shadow: inset 0 0 12px rgba(229, 9, 20, 0.15);
}
.ring-2 {
    top: 12px; left: 12px; right: 12px; bottom: 12px;
    border-bottom-color: #ff6b35;
    border-left-color: #ff6b35;
    animation: spin-reverse 1s linear infinite;
    box-shadow: inset 0 0 10px rgba(255, 107, 53, 0.15);
}
.ring-3 {
    top: 24px; left: 24px; right: 24px; bottom: 24px;
    border-top-color: #ffd700;
    border-right-color: rgba(255, 215, 0, 0.4);
    animation: spin 0.8s linear infinite;
    box-shadow: inset 0 0 8px rgba(255, 215, 0, 0.15);
}
.loading-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    color: var(--accent);
    animation: pulse-glow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(229, 9, 20, 0.5));
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes spin-reverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}
@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}
.loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 2px;
}
.loading-dots span {
    animation: dot-blink 1.4s infinite both;
    font-size: 1.2rem;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}
.loading-progress {
    width: 180px;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.loading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #ff6b35, #ffd700);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.loading-stage {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ─── Source Unavailable Overlay ─── */
#source-unavailable-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10,10,15,0.95) 0%, rgba(20,20,40,0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: var(--radius-lg);
}
.source-unavail-content {
    text-align: center;
    padding: 40px;
    max-width: 420px;
}
.source-unavail-content i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}
.source-unavail-content h3 {
    font-size: 1.3rem;
    color: #e8e8f0;
    margin-bottom: 8px;
}
.source-unavail-content p {
    color: #8888a0;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 24px;
}
.source-unavail-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Player Extra Controls ─── */
.player-extra-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.player-extra-controls .ctrl-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    padding: 6px 10px;
    white-space: nowrap;
}
.player-extra-controls .ctrl-btn i {
    font-size: 0.75rem;
}

/* ─── Quality Selector ─── */
.quality-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}
.quality-selector label {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.quality-selector select {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}
.quality-selector select:focus { border-color: var(--accent); }

/* ─── Subtitle Settings Button ─── */
.ctrl-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm, 6px);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.ctrl-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.ctrl-btn-sm {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm, 6px);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
}
.ctrl-btn-sm:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ─── Subtitle Controls Panel ─── */
.subtitle-controls {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 16px 20px;
    margin-top: -1px;
}
.subtitle-controls.hidden { display: none; }
.sub-ctrl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}
.sub-ctrl-header i { color: var(--accent); margin-right: 6px; }
.sub-ctrl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.sub-ctrl-row label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}
.sub-sync-controls,
.sub-size-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
#sub-sync-value,
#sub-size-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 48px;
    text-align: center;
}
.subtitle-controls select {
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}
.subtitle-controls select:focus { border-color: var(--accent); }

.player-controls-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-wrap: wrap;
}
.source-selector,
.subtitle-selector,
.server-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}
.source-selector label,
.subtitle-selector label,
.server-selector label {
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
.player-info {
    margin-left: auto;
    text-align: right;
}
.player-info span {
    display: block;
    font-size: 0.85rem;
}
#watch-title { font-weight: 600; }
#watch-ep-info { color: var(--text-muted); font-size: 0.8rem; }

/* Watch Episodes Panel */
.watch-episodes {
    margin-top: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
}
.watch-episodes.hidden { display: none; }
.watch-ep-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.watch-ep-header h3 { font-size: 1.1rem; }
.watch-ep-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
}
.watch-ep-btn {
    padding: 10px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}
.watch-ep-btn:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.watch-ep-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Favorites / Watchlist / History ─── */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 2;
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; }
.empty-state.hidden { display: none; }

#page-favorites h1,
#page-watchlist h1,
#page-history h1 {
    padding: 24px 24px 16px;
    font-size: 1.8rem;
}
#clear-history {
    margin: 0 24px 16px;
}
#page-search h1 {
    padding: 24px 24px 8px;
}
#search-query-display {
    padding: 0 24px 16px;
    color: var(--text-muted);
}

/* ─── Settings ─── */
#page-settings h1 {
    padding: 24px 24px 0;
    font-size: 1.8rem;
}
.settings-group {
    margin: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.settings-group h3 {
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: var(--text-primary);
}
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-wrap: wrap;
}
.setting-item:last-child { border-bottom: none; }
.setting-item label { color: var(--text-secondary); font-weight: 500; }
.setting-item .btn { margin-right: 8px; }

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 26px;
    transition: var(--transition);
}
.slider:before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* ─── Loading / Spinner ─── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.loading-overlay.hidden { display: none; }
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Inline loading */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ─── Toast ─── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-shadow: 0 8px 30px var(--shadow);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: #dc2626; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } }

/* ─── Modal ─── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal.hidden { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
}
.modal-content {
    position: relative;
    z-index: 1;
}
.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}
.trailer-modal-content {
    width: 80vw;
    max-width: 900px;
    aspect-ratio: 16/9;
}
.trailer-modal-content iframe {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    border: none;
}

/* ─── Person Filmography Modal ─── */
.person-modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 800px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.person-header {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.person-photo {
    width: 120px;
    height: 180px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 20px var(--shadow);
}
.person-details {
    flex: 1;
    min-width: 0;
}
.person-details h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.person-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.person-meta span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.person-meta i {
    color: var(--accent);
    font-size: 0.8rem;
}
.person-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.filmography-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.filmography-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}
.filmography-card {
    cursor: pointer;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.filmography-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
    border-color: var(--accent);
}
.filmography-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}
.filmography-info {
    padding: 8px 10px;
}
.filmography-info h4 {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.filmography-info span {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .person-header { flex-direction: column; align-items: center; text-align: center; }
    .person-photo { width: 100px; height: 150px; }
    .person-meta { justify-content: center; }
    .person-modal-content { padding: 20px; }
    .filmography-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ─── Responsive ─── */

/* Ensure full viewport fit */
html, body { height: 100%; overflow-x: hidden; }
#main-content {
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}
#page-container { overflow-x: hidden; max-width: 100%; }
.page { max-width: 100%; overflow-x: hidden; }

/* ─── Premium Animations ─── */

/* Fade-in on page load */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 15px var(--accent-glow); }
    50% { box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(229, 9, 20, 0.15); }
}

/* Page transitions */
.page.active {
    animation: fadeIn 0.4s ease-out;
}

/* Hero banner premium entrance */
.hero-content {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}
.hero-badge {
    animation: scaleIn 0.5s ease-out 0.4s both;
}
.hero-actions .btn {
    animation: fadeInUp 0.5s ease-out 0.6s both;
}

/* Card animations on scroll */
.card {
    animation: fadeInUp 0.4s ease-out both;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}
.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }

/* Card play button enhanced */
.card-play {
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
    backdrop-filter: blur(4px);
}
.card-play i {
    transition: transform 0.3s ease, color 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.card:hover .card-play i {
    transform: scale(1.2);
    color: var(--accent);
}

/* Card poster enhanced hover */
.card-poster {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: box-shadow 0.35s ease;
}
.card:hover .card-poster {
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* Genre card premium hover */
.genre-card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.4s ease-out both;
    position: relative;
    overflow: hidden;
}
.genre-card::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    transition: all 0.5s ease;
    opacity: 0;
}
.genre-card:hover::before {
    top: -50%;
    left: -50%;
    opacity: 1;
}
.genre-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 40px var(--accent-glow);
}

/* Detail page animations */
.detail-poster {
    animation: slideInLeft 0.7s ease-out both;
}
.detail-info {
    animation: slideInRight 0.7s ease-out 0.15s both;
}
.detail-cast .cast-card {
    animation: fadeInUp 0.3s ease-out both;
}
.detail-cast .cast-card:nth-child(2) { animation-delay: 0.05s; }
.detail-cast .cast-card:nth-child(3) { animation-delay: 0.1s; }
.detail-cast .cast-card:nth-child(4) { animation-delay: 0.15s; }
.detail-cast .cast-card:nth-child(5) { animation-delay: 0.2s; }

/* Premium button effects */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.35s ease;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}
.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}
.btn-primary:active {
    transform: translateY(0);
}

/* Premium sidebar transitions */
.sidebar-menu li {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.sidebar-menu li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}
.sidebar-menu li:hover::before {
    transform: scaleY(1);
}
.sidebar-menu li:hover {
    padding-left: 22px;
}

/* Player area premium appearance */
.player-area {
    box-shadow: 0 10px 60px rgba(0,0,0,0.6);
    transition: box-shadow 0.3s ease;
}
.player-controls-bar {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

/* Source selector premium */
.source-selector select,
.quality-selector select,
.subtitle-selector select,
.server-selector select {
    transition: all 0.3s ease;
}
.source-selector select:hover,
.quality-selector select:hover,
.subtitle-selector select:hover,
.server-selector select:hover {
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Episode item premium */
.episode-item {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.episode-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Watch episode buttons premium */
.watch-ep-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.watch-ep-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px var(--accent-glow);
}
.watch-ep-btn.active {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Filmography card premium hover */
.filmography-card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.filmography-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 35px var(--shadow);
}

/* Person modal premium entrance */
.person-modal-content {
    animation: scaleIn 0.35s ease-out both;
}

/* Toast animation enhanced */
.toast {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

/* Settings group premium */
.settings-group {
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out both;
}
.settings-group:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* Topbar premium glass effect */
#topbar {
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
}

/* Search bar premium focus */
.search-bar input {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 4px 20px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

/* Hero banner parallax-like shimmer */
.hero-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.03) 50%, transparent 60%);
    background-size: 200% 200%;
    animation: shimmerHero 8s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}
@keyframes shimmerHero {
    0% { background-position: 200% 200%; }
    50% { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

/* Genre tab premium */
.genre-tab {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.genre-tab:hover:not(.active) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.genre-tab.active {
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* Cast card premium */
.cast-card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.cast-card:hover {
    transform: translateY(-6px);
}
.cast-card img {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.cast-card:hover img {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: scale(1.05);
}

/* Loading overlay premium */
.loading-rings {
    filter: drop-shadow(0 0 20px rgba(229, 9, 20, 0.5));
}
.loading-content {
    animation: scaleIn 0.5s ease-out both;
}

/* ─── Desktop Large (1200px+) ─── */
@media (min-width: 1200px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    .hero-banner { max-height: 750px; }
}

/* ─── Desktop/Tablet (1024px) ─── */
@media (max-width: 1024px) {
    .detail-content { padding: 0 24px; gap: 24px; }
    .detail-poster { flex: 0 0 180px; }
    .detail-seasons { padding: 24px; }
    .genres-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ─── Tablet / Small Desktop (768px) ─── */
@media (max-width: 768px) {
    /* Sidebar mobile drawer */
    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: var(--sidebar-width);
        box-shadow: 4px 0 30px rgba(0,0,0,0.5);
    }
    #sidebar.open { transform: translateX(0); }
    #sidebar.open::after {
        content: '';
        position: fixed;
        top: 0; left: var(--sidebar-width); right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
    #main-content { margin-left: 0; }
    #menu-toggle { display: flex; }

    /* Hero compact */
    .hero-banner { height: 50vh; min-height: 300px; }
    .hero-content { padding: 0 20px 28px; }
    .hero-content h1 { font-size: 1.6rem; }
    .hero-content p { -webkit-line-clamp: 2; }
    .hero-actions { flex-wrap: wrap; gap: 8px; }
    .hero-actions .btn { flex: 1; min-width: 120px; justify-content: center; }

    /* Content grid responsive */
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
        padding: 0 16px;
    }
    .content-sections { padding: 0 8px; }

    /* Genre grid responsive */
    .genres-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 0 16px; }
    .genre-card { padding: 20px 14px; font-size: 0.95rem; }
    .genre-card i { font-size: 1.6rem; margin-bottom: 8px; }
    .genre-tabs { padding: 0 16px; }

    /* Detail page stack layout */
    .detail-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 16px;
    }
    .detail-poster { flex: 0 0 auto; width: 160px; }
    .detail-info { padding-top: 16px; }
    .detail-info h1 { font-size: 1.5rem; }
    .detail-meta { justify-content: center; flex-wrap: wrap; }
    .detail-genres { justify-content: center; }
    .detail-actions { justify-content: center; flex-wrap: wrap; }
    .detail-seasons { padding: 16px; }
    .detail-backdrop { height: 40vh; min-height: 280px; }

    /* Episodes stack */
    .episode-item { flex-direction: column; }
    .episode-still { flex: none; width: 100%; height: 160px; }
    .episode-info p { -webkit-line-clamp: 3; }

    /* Browse header stack */
    .browse-header { padding: 16px; flex-direction: column; gap: 12px; }
    .browse-filters { width: 100%; }
    .browse-filters select { flex: 1; min-width: 0; }

    /* Player controls responsive */
    .player-controls-bar { 
        flex-direction: column; 
        align-items: stretch; 
        gap: 10px; 
        padding: 12px; 
    }
    .player-extra-controls {
        justify-content: center;
        flex-wrap: wrap;
        border-bottom: 1px solid var(--border);
        padding-bottom: 10px;
    }
    .source-selector, .quality-selector, .subtitle-selector, .server-selector {
        width: 100%;
        justify-content: space-between;
    }
    .source-selector select, .quality-selector select, .subtitle-selector select, .server-selector select {
        flex: 1;
        min-width: 0;
    }
    .player-info { text-align: center; margin-left: 0; }

    /* Subtitle controls responsive */
    .subtitle-controls { padding: 12px 16px; }
    .sub-ctrl-row { flex-direction: column; gap: 8px; align-items: flex-start; }

    /* Player area full width */
    .player-area { 
        aspect-ratio: 16/9; 
        border-radius: 0;
    }
    .watch-container { padding: 0; }
    .player-wrapper { border-radius: 0; }
    .player-controls-bar { border-radius: 0; }

    /* Search bar */
    .search-bar { flex: 1; min-width: 0; }
    .search-bar input { width: 100%; font-size: 0.9rem; }

    /* Settings responsive */
    .settings-group { margin: 12px; padding: 16px; }
    .setting-item { flex-direction: column; align-items: flex-start; gap: 8px; }
    .setting-item select, .setting-item .btn { width: 100%; }

    /* Cast scroll fit */
    .cast-scroll { gap: 14px; padding-bottom: 12px; }
    .cast-card { min-width: 80px; width: 80px; }
    .cast-card img { width: 65px; height: 65px; }

    /* Person modal responsive */
    .person-header { flex-direction: column; align-items: center; text-align: center; }
    .person-photo { width: 100px; height: 150px; }
    .person-meta { justify-content: center; }
    .person-modal-content { padding: 20px; width: 95vw; }
    .filmography-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

    /* Watch episodes panel responsive */
    .watch-episodes { margin-top: 0; border-radius: 0; border-left: none; border-right: none; }
    .watch-ep-list { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
    .watch-ep-btn { padding: 8px; font-size: 0.85rem; }

    /* Topbar responsive */
    #topbar { padding: 0 12px; gap: 8px; }
    
    /* Row sections padding */
    .row-header { padding: 0 8px; }
    .row-header h2 { font-size: 1.1rem; }
}

/* ─── Mobile Small (480px) ─── */
@media (max-width: 480px) {
    html { font-size: 13px; }

    /* Cards smaller */
    .card { width: 110px; }
    
    /* Hero ultra compact */
    .hero-banner { height: 42vh; min-height: 240px; }
    .hero-content { padding: 0 16px 20px; }
    .hero-content h1 { font-size: 1.25rem; }
    .hero-content p { font-size: 0.82rem; -webkit-line-clamp: 2; }
    .hero-actions .btn { font-size: 0.8rem; padding: 8px 14px; }
    .hero-meta { font-size: 0.82rem; gap: 10px; }
    .hero-badge { font-size: 0.7rem; padding: 3px 10px; }

    /* Detail ultra compact */
    .detail-backdrop { height: 30vh; min-height: 200px; }
    .detail-poster { width: 130px; }
    .detail-info h1 { font-size: 1.3rem; }
    .detail-overview { font-size: 0.9rem; }
    .detail-content { margin-top: -120px; }
    .detail-actions .btn { font-size: 0.82rem; padding: 10px 16px; }

    /* Grid ultra compact */
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; padding: 0 10px; }
    .genres-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 10px; }
    .genre-card { padding: 16px 10px; font-size: 0.88rem; }
    .genre-card i { font-size: 1.4rem; margin-bottom: 6px; }

    /* Topbar tight */
    .topbar-right { gap: 4px; }
    #topbar { padding: 0 8px; gap: 6px; height: 50px; }
    .search-bar input { padding: 8px 12px 8px 36px; font-size: 0.85rem; }
    .search-bar i { left: 10px; }
    .btn-icon { width: 34px; height: 34px; font-size: 0.9rem; }

    /* Player controls ultra compact */
    .player-controls-bar { padding: 8px 10px; gap: 8px; }
    .player-controls-bar select { font-size: 0.78rem; padding: 6px 10px; }
    .player-controls-bar label { font-size: 0.78rem; }
    .player-extra-controls .ctrl-btn { font-size: 0.72rem; padding: 5px 8px; }

    /* Source unavailable compact */
    .source-unavail-content { padding: 24px 16px; }
    .source-unavail-content i { font-size: 2.2rem; }
    .source-unavail-content h3 { font-size: 1.1rem; }
    .source-unavail-content p { font-size: 0.82rem; }

    /* Cast compact */
    .cast-card { width: 70px; min-width: 70px; }
    .cast-card img { width: 56px; height: 56px; }
    .cast-card h4 { font-size: 0.68rem; }
    .cast-card span { font-size: 0.62rem; }

    /* Episode items compact */
    .episode-still { height: 120px; }
    .episode-info h4 { font-size: 0.88rem; }
    .episode-info .ep-meta { font-size: 0.75rem; }

    /* Person modal compact */
    .person-modal-content { padding: 16px; width: 98vw; max-height: 90vh; }
    .person-photo { width: 80px; height: 120px; }
    .person-details h2 { font-size: 1.3rem; }
    .filmography-grid { grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); gap: 8px; }
    .filmography-info { padding: 6px 8px; }
    .filmography-info h4 { font-size: 0.72rem; }

    /* Settings compact */
    .settings-group { margin: 8px; padding: 14px; }
    #page-settings h1 { padding: 16px 16px 0; font-size: 1.4rem; }

    /* Loading overlay compact */
    .loading-rings { width: 80px; height: 80px; }
    .ring-2 { top: 10px; left: 10px; right: 10px; bottom: 10px; }
    .ring-3 { top: 20px; left: 20px; right: 20px; bottom: 20px; }
    .loading-icon { font-size: 1.2rem; }
    .loading-text { font-size: 0.88rem; }
    .loading-progress { width: 140px; }
    .loading-stage { font-size: 0.68rem; }

    /* Rows smaller cards */
    .row-scroll { gap: 10px; }

    /* Page titles */
    #page-favorites h1,
    #page-watchlist h1,
    #page-history h1 { padding: 16px 16px 12px; font-size: 1.4rem; }
    #page-search h1 { padding: 16px 16px 4px; font-size: 1.4rem; }
    .browse-header h1 { font-size: 1.4rem; }
}

/* ─── Mobile Ultra Small (360px) ─── */
@media (max-width: 360px) {
    html { font-size: 12px; }
    .card { width: 95px; }
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
    .genres-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .hero-content h1 { font-size: 1.1rem; }
    .hero-banner { height: 38vh; }
    .detail-poster { width: 110px; }
    .filmography-grid { grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); }
}

/* ─── Landscape Mobile ─── */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-banner { height: 100vh; min-height: unset; }
    .hero-content { padding: 0 16px 16px; }
    .hero-content h1 { font-size: 1.3rem; }
    .player-area { aspect-ratio: unset; height: calc(100vh - 60px); }
    .detail-backdrop { height: 40vh; min-height: unset; }
    .person-modal-content { max-height: 95vh; }
}

/* ─── Skeleton loading ─── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-card {
    width: 160px;
    flex: 0 0 auto;
}
.skeleton-poster {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius);
}
.skeleton-text {
    height: 14px;
    margin-top: 8px;
    width: 80%;
    border-radius: 4px;
}

/* ─── Genre Card Colors (cyclical for any number of genres) ─── */
.genre-card:nth-child(10n+1) { background: linear-gradient(135deg, #1a1a3e 0%, #2d1b69 100%); color: #e8e8f0; }
.genre-card:nth-child(10n+2) { background: linear-gradient(135deg, #1a2e1a 0%, #1b6927 100%); color: #e8e8f0; }
.genre-card:nth-child(10n+3) { background: linear-gradient(135deg, #2e1a1a 0%, #691b1b 100%); color: #e8e8f0; }
.genre-card:nth-child(10n+4) { background: linear-gradient(135deg, #1a2e2e 0%, #1b5569 100%); color: #e8e8f0; }
.genre-card:nth-child(10n+5) { background: linear-gradient(135deg, #2e2e1a 0%, #696b1b 100%); color: #e8e8f0; }
.genre-card:nth-child(10n+6) { background: linear-gradient(135deg, #2e1a2e 0%, #691b69 100%); color: #e8e8f0; }
.genre-card:nth-child(10n+7) { background: linear-gradient(135deg, #1a1a3e 0%, #4b1b69 100%); color: #e8e8f0; }
.genre-card:nth-child(10n+8) { background: linear-gradient(135deg, #1a2e1a 0%, #1b6960 100%); color: #e8e8f0; }
.genre-card:nth-child(10n+9) { background: linear-gradient(135deg, #2e1a1a 0%, #69401b 100%); color: #e8e8f0; }
.genre-card:nth-child(10n+10) { background: linear-gradient(135deg, #1a2e2e 0%, #1b3569 100%); color: #e8e8f0; }

/* Light theme genre cards - elegant pastel gradients */
[data-theme="light"] .genre-card:nth-child(10n+1) { background: linear-gradient(135deg, #e8e0ff 0%, #c4b5fd 100%); color: #2d1b69; }
[data-theme="light"] .genre-card:nth-child(10n+2) { background: linear-gradient(135deg, #dcfce7 0%, #86efac 100%); color: #166534; }
[data-theme="light"] .genre-card:nth-child(10n+3) { background: linear-gradient(135deg, #ffe4e6 0%, #fda4af 100%); color: #9f1239; }
[data-theme="light"] .genre-card:nth-child(10n+4) { background: linear-gradient(135deg, #e0f7fa 0%, #80deea 100%); color: #155e75; }
[data-theme="light"] .genre-card:nth-child(10n+5) { background: linear-gradient(135deg, #fef9c3 0%, #fde047 100%); color: #854d0e; }
[data-theme="light"] .genre-card:nth-child(10n+6) { background: linear-gradient(135deg, #fce7f3 0%, #f0abfc 100%); color: #86198f; }
[data-theme="light"] .genre-card:nth-child(10n+7) { background: linear-gradient(135deg, #ede9fe 0%, #c084fc 100%); color: #581c87; }
[data-theme="light"] .genre-card:nth-child(10n+8) { background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%); color: #065f46; }
[data-theme="light"] .genre-card:nth-child(10n+9) { background: linear-gradient(135deg, #ffedd5 0%, #fdba74 100%); color: #9a3412; }
[data-theme="light"] .genre-card:nth-child(10n+10) { background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%); color: #1e40af; }
/* Arctic theme also gets pastel genre cards */
[data-theme="arctic"] .genre-card:nth-child(10n+1) { background: linear-gradient(135deg, #e0e8ff 0%, #a5b4fc 100%); color: #312e81; }
[data-theme="arctic"] .genre-card:nth-child(10n+2) { background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%); color: #065f46; }
[data-theme="arctic"] .genre-card:nth-child(10n+3) { background: linear-gradient(135deg, #ffe4e6 0%, #fda4af 100%); color: #9f1239; }
[data-theme="arctic"] .genre-card:nth-child(10n+4) { background: linear-gradient(135deg, #cffafe 0%, #67e8f9 100%); color: #155e75; }
[data-theme="arctic"] .genre-card:nth-child(10n+5) { background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%); color: #92400e; }
[data-theme="arctic"] .genre-card:nth-child(10n+6) { background: linear-gradient(135deg, #fce7f3 0%, #f9a8d4 100%); color: #9d174d; }
[data-theme="arctic"] .genre-card:nth-child(10n+7) { background: linear-gradient(135deg, #ede9fe 0%, #a78bfa 100%); color: #5b21b6; }
[data-theme="arctic"] .genre-card:nth-child(10n+8) { background: linear-gradient(135deg, #d1fae5 0%, #34d399 100%); color: #065f46; }
[data-theme="arctic"] .genre-card:nth-child(10n+9) { background: linear-gradient(135deg, #fed7aa 0%, #fb923c 100%); color: #9a3412; }
[data-theme="arctic"] .genre-card:nth-child(10n+10) { background: linear-gradient(135deg, #dbeafe 0%, #60a5fa 100%); color: #1e40af; }
[data-theme="light"] .genre-card i,
[data-theme="arctic"] .genre-card i { color: inherit; opacity: 0.8; }

/* ═══════ PLAYER OVERLAY (HDOBox-style) ═══════ */

.player-overlay {
    position: fixed; inset: 0; background: #000;
    z-index: 2000; display: none; flex-direction: column;
}
.player-overlay.active { display: flex; animation: fadeIn 0.3s ease; }

.player-overlay .player-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10; flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.player-overlay .player-back {
    width: 36px; height: 36px; display: flex;
    align-items: center; justify-content: center;
    border-radius: 8px; transition: var(--transition);
    background: none; border: none; color: #fff; cursor: pointer; font-size: 18px;
}
.player-overlay .player-back:hover { background: rgba(255,255,255,0.1); }

.player-overlay .player-title { flex: 1; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }

.player-source-select { display: flex; gap: 8px; align-items: center; }

.player-source-select select {
    padding: 6px 12px; background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
    color: white; font-size: 13px; outline: none; cursor: pointer;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
    padding-right: 28px;
}
.player-source-select select option {
    background: #1a1a2e; color: #fff; padding: 8px 12px;
}
.player-source-select select option:hover,
.player-source-select select option:checked {
    background: #6366f1; color: #fff;
}

.player-overlay .player-area { flex: 1; position: relative; background: #000; overflow: hidden; min-height: 0; }

#ov-player-iframe { width: 100%; height: 100%; border: none; display: none; }
#ov-player-video { width: 100%; height: 100%; display: none; background: #000; }

.player-overlay .player-loading {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(10,10,15,0.97) 0%, rgba(0,0,0,0.99) 100%);
    z-index: 25; gap: 16px; transition: opacity 0.5s ease;
}
.player-overlay .player-loading.hidden { opacity: 0; pointer-events: none; }

/* ── Modern Cinematic Loader ── */
.loader-cinema {
    position: relative; width: 120px; height: 120px;
    display: flex; align-items: center; justify-content: center;
}
.cinema-orbs { position: absolute; inset: 0; animation: orbsRotate 3s linear infinite; }
.cinema-orb {
    position: absolute; width: 14px; height: 14px; border-radius: 50%;
    filter: blur(1px);
}
.orb-1 {
    top: 0; left: 50%; transform: translateX(-50%);
    background: #6366f1;
    box-shadow: 0 0 20px #6366f1, 0 0 40px rgba(99,102,241,0.4);
    animation: orbPulse 1.5s ease-in-out infinite;
}
.orb-2 {
    bottom: 8px; left: 8px;
    background: #e040fb;
    box-shadow: 0 0 20px #e040fb, 0 0 40px rgba(224,64,251,0.4);
    animation: orbPulse 1.5s ease-in-out 0.5s infinite;
}
.orb-3 {
    bottom: 8px; right: 8px;
    background: #00e5ff;
    box-shadow: 0 0 20px #00e5ff, 0 0 40px rgba(0,229,255,0.4);
    animation: orbPulse 1.5s ease-in-out 1s infinite;
}
.cinema-icon {
    position: relative; z-index: 2;
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    animation: iconBreath 2s ease-in-out infinite;
}
.cinema-icon i {
    font-size: 24px;
    background: linear-gradient(135deg, #6366f1, #e040fb, #00e5ff);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.cinema-ripple {
    position: absolute; inset: -10px;
    border: 2px solid rgba(99,102,241,0.3);
    border-radius: 50%;
    animation: rippleExpand 2.5s ease-out infinite;
}
.cinema-ripple.ripple-2 {
    animation-delay: 1.25s;
    border-color: rgba(224,64,251,0.25);
}
@keyframes orbsRotate { 100% { transform: rotate(360deg); } }
@keyframes orbPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 1; }
}
@keyframes iconBreath {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99,102,241,0.2); }
    50% { transform: scale(1.06); box-shadow: 0 0 30px 5px rgba(99,102,241,0.15); }
}
@keyframes rippleExpand {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.loader-status {
    font-size: 14px; color: var(--text-secondary);
    letter-spacing: 0.5px; text-transform: uppercase;
    animation: loaderTextShimmer 2s ease-in-out infinite;
    background: linear-gradient(90deg, var(--text-secondary) 30%, #fff 50%, var(--text-secondary) 70%);
    background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
@keyframes loaderTextShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.loader-sources {
    display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
    max-width: 400px; margin-top: 4px;
}
.loader-src {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
    font-size: 11px; color: var(--text-secondary);
    transition: all 0.4s ease;
}
.loader-src .src-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.4s ease;
}
.loader-src.testing .src-dot {
    background: #ffc107;
    box-shadow: 0 0 6px #ffc107;
    animation: dotBlink 0.8s ease-in-out infinite;
}
.loader-src.ready .src-dot {
    background: #00e676;
    box-shadow: 0 0 8px #00e676;
}
.loader-src.ready {
    border-color: rgba(0,230,118,0.3);
    background: rgba(0,230,118,0.08);
    color: #00e676;
}
.loader-src.failed .src-dot {
    background: #ff5252;
    box-shadow: 0 0 4px #ff5252;
}
.loader-src.failed {
    opacity: 0.4;
    border-color: rgba(255,82,82,0.2);
}
@keyframes dotBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.loader-bar {
    width: 200px; height: 3px; border-radius: 3px;
    background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 4px;
}
.loader-bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--accent), #e040fb, #00e5ff);
    border-radius: 3px; transition: width 0.4s ease;
    box-shadow: 0 0 8px var(--accent);
}

/* ── Episode Bar ── */
.player-overlay .episode-bar {
    flex-shrink: 0; max-height: 180px;
    background: linear-gradient(0deg, rgba(0,0,0,0.95) 0%, rgba(10,10,15,0.9) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.08); overflow-y: auto;
}
.player-overlay .season-tabs { display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.season-tab {
    padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); white-space: nowrap; cursor: pointer; transition: var(--transition);
}
.season-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.season-tab.active { color: white; background: var(--accent); }
.player-overlay .episode-list { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; }
.ep-chip {
    flex-shrink: 0; padding: 6px 14px; border-radius: 6px;
    font-size: 12px; font-weight: 500;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.ep-chip:hover { border-color: var(--accent); color: var(--text-primary); }
.ep-chip.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ═══════════════════════════════════════════════════════════
   DOWNLOAD PAGE — SanuFlix-style particles + glassmorphism
   ═══════════════════════════════════════════════════════════ */

#page-download {
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a14 0%, #0d0d1a 30%, #12081f 60%, #0a0a14 100%);
}

/* Animated gradient overlay */
#page-download::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(229, 9, 20, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: dlGradientShift 15s ease-in-out infinite alternate;
}

@keyframes dlGradientShift {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.7; transform: scale(1); }
}

/* Particles canvas */
.dl-bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.dl-particles-cvs {
    width: 100%;
    height: 100%;
    display: block;
}

/* Container */
.dl-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* Hero */
.dl-hero {
    text-align: center;
    margin-bottom: 36px;
}
.dl-icon-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(229, 9, 20, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dlHeroFloat 4s ease-in-out infinite;
    backdrop-filter: blur(12px);
}
.dl-icon-wrap i {
    font-size: 32px;
    background: linear-gradient(135deg, #E50914, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
@keyframes dlHeroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.dl-title {
    font-size: 2.2em;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #c4b5fd 50%, #E50914 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.dl-subtitle {
    color: rgba(255, 255, 255, 0.45);
    font-size: 1em;
    font-weight: 400;
}

/* Search Box */
.dl-search-box {
    max-width: 600px;
    margin: 0 auto 32px;
}
.dl-search-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 4px 6px 4px 18px;
    backdrop-filter: blur(16px);
    transition: all 0.3s ease;
}
.dl-search-input-wrap:focus-within {
    border-color: rgba(229, 9, 20, 0.5);
    box-shadow: 0 0 25px rgba(229, 9, 20, 0.12), 0 4px 20px rgba(0,0,0,0.3);
    background: rgba(255, 255, 255, 0.08);
}
.dl-search-icon {
    color: rgba(255, 255, 255, 0.35);
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}
#dl-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    flex: 1;
    padding: 12px 0;
    font-family: inherit;
}
#dl-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.dl-search-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #E50914, #a855f7);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.dl-search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

/* Status */
.dl-status {
    text-align: center;
    padding: 24px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
}
.dl-status.hidden { display: none; }

/* Spinner */
.dl-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dl-spin-ring {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #E50914;
    border-radius: 50%;
    animation: dlSpin 0.8s linear infinite;
}
@keyframes dlSpin {
    100% { transform: rotate(360deg); }
}

/* Back to Browse Button */
.dl-search-back {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
}
.dl-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid rgba(229, 9, 20, 0.4);
    border-radius: 10px;
    background: rgba(229, 9, 20, 0.1);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}
.dl-back-btn:hover {
    background: rgba(229, 9, 20, 0.3);
    border-color: rgba(229, 9, 20, 0.7);
    transform: translateX(-3px);
}
.dl-back-btn i { font-size: 13px; }

/* Country flag images */
.country-flag-img {
    display: inline-block;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    vertical-align: middle;
}

/* Results Grid */
.dl-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Card */
.dl-card {
    cursor: pointer;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}
.dl-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(229, 9, 20, 0.4);
    box-shadow: 0 12px 40px rgba(229, 9, 20, 0.15), 0 4px 20px rgba(0, 0, 0, 0.4);
}
.dl-card-img {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}
.dl-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.dl-card:hover .dl-card-img img {
    transform: scale(1.08);
}
.dl-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.dl-card:hover .dl-card-overlay {
    opacity: 1;
    pointer-events: auto;
}
.dl-card-dl-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(229, 9, 20, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.7);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.5);
}
.dl-card:hover .dl-card-dl-icon { transform: scale(1); }
.dl-card-dl-icon i { color: #fff; font-size: 18px; }

.dl-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.85), rgba(168, 85, 247, 0.85));
    backdrop-filter: blur(8px);
    color: #fff;
}

.dl-card-info {
    padding: 10px 12px 14px;
}
.dl-card-info h4 {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Skeleton loading */
.dl-loading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}
.dl-card-skeleton {
    border-radius: 14px;
    aspect-ratio: 2 / 3;
    background: linear-gradient(110deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 37%, rgba(255,255,255,0.04) 63%);
    background-size: 200% 100%;
    animation: dlShimmer 1.5s ease-in-out infinite;
}
@keyframes dlShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty state */
.dl-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 20px;
    color: rgba(255, 255, 255, 0.35);
}
.dl-empty i {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.4;
}
.dl-empty p {
    font-size: 14px;
}

/* Pagination */
.dl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 40px;
}
.dl-pagination.hidden { display: none; }
.dl-page-info {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* Trending / Section Title */
.dl-section-title {
    font-size: 1.3em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dl-section-title i {
    color: #E50914;
}

/* ─── Download Links Modal ─── */
.dl-links-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dl-links-modal.hidden { display: none; }

.dl-links-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.dl-links-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    background: linear-gradient(135deg, rgba(18, 18, 32, 0.98), rgba(12, 12, 22, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.dl-links-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dl-links-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 12px;
}

.dl-links-list {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    min-height: 100px;
}
.dl-links-list .dl-spinner {
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.dl-loading-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.dl-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
}
.dl-link-item:hover {
    background: rgba(229, 9, 20, 0.1);
    border-color: rgba(229, 9, 20, 0.3);
    transform: translateX(4px);
}
.dl-link-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dl-link-info i {
    font-size: 18px;
    color: #E50914;
    width: 20px;
    text-align: center;
}
.dl-link-host {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}
.dl-link-num {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin-left: 4px;
}
.dl-link-size {
    font-size: 11px;
    font-weight: 700;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    letter-spacing: 0.3px;
}
/* ─── Source Section Headers ─── */
.dl-source-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #E50914;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(229, 9, 20, 0.15);
}
.dl-source-header:first-child { margin-top: 0; }
.dl-source-header.vidsrc { color: #60a5fa; border-bottom-color: rgba(96, 165, 250, 0.15); }
.dl-source-header.subtitles { color: #fbbf24; border-bottom-color: rgba(251, 191, 36, 0.15); font-size: 12px; }
/* VidSrc link items */
.dl-link-item.vidsrc-link:hover { border-color: rgba(96, 165, 250, 0.3); background: rgba(96, 165, 250, 0.05); }
.dl-link-item.vidsrc-link .fa-bolt { color: #60a5fa; }
.dl-link-item.vidsrc-link .fa-download { color: rgba(96, 165, 250, 0.4); font-size: 13px; transition: color 0.3s; }
.dl-link-item.vidsrc-link:hover .fa-download { color: #60a5fa; }
.dl-link-quality {
    font-size: 10px;
    font-weight: 700;
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.12);
    padding: 2px 7px;
    border-radius: 8px;
    letter-spacing: 0.3px;
}
.dl-link-quality.quality-hd { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.dl-link-format {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 6px;
}
/* Subtitle link items */
.dl-link-item.subtitle-link:hover { border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.05); }
.dl-link-item.subtitle-link .fa-language { color: #fbbf24; }
.dl-link-item.subtitle-link .fa-download { color: rgba(251, 191, 36, 0.4); font-size: 13px; transition: color 0.3s; }
.dl-link-item.subtitle-link:hover .fa-download { color: #fbbf24; }
.dl-link-item > .fa-external-link-alt {
    color: rgba(255, 255, 255, 0.25);
    font-size: 13px;
    transition: color 0.3s;
}
.dl-link-item:hover > .fa-external-link-alt {
    color: #E50914;
}

/* ─── TV Card Type Badge & Year ─── */
.dl-card-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background: #E50914;
    z-index: 2;
}
.dl-card-year {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

/* ─── TV Season/Episode Picker ─── */
.dl-tv-picker {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    background: linear-gradient(135deg, rgba(18, 18, 32, 0.98), rgba(12, 12, 22, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}
.dl-tv-picker.hidden { display: none; }

.dl-tv-picker-header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}
.dl-tv-picker-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    padding-right: 40px;
}
.dl-tv-picker-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}
.dl-tv-picker-header .btn-icon {
    position: absolute;
    top: 14px;
    right: 16px;
}

.dl-tv-picker-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 300px;
}

/* Seasons sidebar */
.dl-tv-seasons {
    width: 160px;
    min-width: 140px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dl-season-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    border-left: 3px solid transparent;
}
.dl-season-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}
.dl-season-btn.active {
    color: #fff;
    background: rgba(229, 9, 20, 0.12);
    border-left-color: #E50914;
}
.dl-season-dot {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    margin-left: 8px;
}

/* Episodes list */
.dl-tv-episodes {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dl-episodes-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.dl-episode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s;
}
.dl-episode-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.dl-episode-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.dl-episode-num {
    font-size: 11px;
    font-weight: 700;
    color: #E50914;
    background: rgba(229, 9, 20, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    min-width: 40px;
    text-align: center;
}
.dl-episode-text {
    flex: 1;
    min-width: 0;
}
.dl-episode-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dl-episode-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dl-episode-dl-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(229, 9, 20, 0.3);
    background: rgba(229, 9, 20, 0.1);
    color: #E50914;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.dl-episode-dl-btn:hover {
    background: rgba(229, 9, 20, 0.2);
    border-color: #E50914;
    color: #fff;
}
.dl-episode-dl-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.dl-episode-dl-btn .dl-spin-ring.small {
    width: 14px;
    height: 14px;
    border-width: 2px;
}
.dl-ep-no-links {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
}

/* Back to episodes button */
.dl-back-to-episodes {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
}
.dl-back-to-episodes:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .dl-container { padding: 20px 14px 40px; }
    .dl-title { font-size: 1.5em; }
    .dl-icon-wrap { width: 60px; height: 60px; border-radius: 16px; }
    .dl-icon-wrap i { font-size: 24px; }
    .dl-results { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
    .dl-loading-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
    .dl-links-content { border-radius: 16px; max-height: 85vh; }
    .dl-search-input-wrap { border-radius: 12px; }
    /* TV Picker responsive */
    .dl-tv-picker { max-width: 100%; border-radius: 16px; max-height: 90vh; }
    .dl-tv-seasons { width: 120px; min-width: 100px; }
    .dl-season-btn { padding: 10px 12px; font-size: 12px; }
    .dl-episode-row { padding: 10px 10px; flex-wrap: wrap; }
    .dl-episode-dl-btn { padding: 6px 12px; font-size: 11px; }
}
@media (max-width: 480px) {
    .dl-results { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dl-loading-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dl-hero { margin-bottom: 24px; }
    /* TV Picker small screen */
    .dl-tv-picker-body { flex-direction: column; }
    .dl-tv-seasons { width: 100%; min-width: auto; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 8px; border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.06); max-height: 120px; }
    .dl-season-btn { border-left: none; border-bottom: 2px solid transparent; padding: 8px 12px; font-size: 11px; }
    .dl-season-btn.active { border-left-color: transparent; border-bottom-color: #E50914; }
    .dl-tv-episodes { max-height: 50vh; }
}
