/* ═══════════════════════════════════════════════════════════════
   AOS IPTV — Web App CSS
   Netflix-like Dark Cinematic Theme — Responsive SPA
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   1. CSS VARIABLES
   ============================================================ */
:root {
    --bg-primary: #08060C;
    --bg-secondary: #110E18;
    --bg-tertiary: #181422;
    --bg-card: #14111E;
    --bg-elevated: #1E1A2A;
    --bg-overlay: rgba(0,0,0,0.88);

    --accent: #E11D48;
    --accent-bright: #F43F5E;
    --accent-soft: #FB7185;
    --accent-glow: rgba(225,29,72,0.30);
    --accent-subtle: rgba(225,29,72,0.08);

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --text-muted: #475569;

    --live-red: #FF3B30;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info-blue: #3B82F6;

    --glass-fill: rgba(255,255,255,0.04);
    --glass-border: rgba(255,255,255,0.06);
    --glass-highlight: rgba(255,255,255,0.08);
    --glass-heavy: rgba(255,255,255,0.12);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --safe-h: clamp(16px, 4vw, 80px);
    --safe-v: clamp(16px, 3vw, 60px);

    --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-elevated: 0 8px 40px rgba(0,0,0,0.6);
    --shadow-focus: 0 0 0 3px rgba(225,29,72,0.5), 0 8px 32px rgba(225,29,72,0.2);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, 'SF Pro Display', system-ui, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.5;
    letter-spacing: -0.01em;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 15% 10%, rgba(225,29,72,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 85%, rgba(100,50,180,0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ============================================================
   3. SPA VIEW SYSTEM
   ============================================================ */
.view { display: none; position: relative; z-index: 1; }
.view.active { display: block; }

/* ============================================================
   4. TAB BAR — Top Navigation
   ============================================================ */
.tab-bar {
    display: flex;
    align-items: center;
    padding: 16px var(--safe-h) 18px;
    gap: clamp(16px, 2.5vw, 40px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(8,6,12,0.98) 0%, rgba(8,6,12,0.85) 70%, transparent 100%);
    backdrop-filter: blur(12px);
}

.tab-item {
    font-size: clamp(14px, 1.2vw, 20px);
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 8px 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.tab-item.active {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

.tab-item:hover:not(.active) { color: var(--text-secondary); }

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-connected { background: var(--success); }
.status-disconnected { background: var(--error); }

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    letter-spacing: -0.01em;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s, background 0.25s;
}
.btn:hover { transform: scale(1.04); }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #BE123C);
    color: white;
    box-shadow: 0 4px 16px rgba(225,29,72,0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-bright), var(--accent));
    box-shadow: 0 6px 24px rgba(225,29,72,0.4);
}
.btn-secondary {
    background: var(--glass-highlight);
    color: white;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
}
.btn-secondary:hover {
    background: var(--glass-heavy);
    border-color: rgba(225,29,72,0.25);
}

/* ============================================================
   6. BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.badge-live {
    background: rgba(255,59,48,0.7);
    color: white;
    backdrop-filter: blur(4px);
}
.badge-live::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: white;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%,100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.q-badge {
    font-size: 9px;
    font-weight: 800;
    color: white;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 0.04em;
}

/* ============================================================
   7. SECTIONS & CARD ROWS
   ============================================================ */
.section {
    padding: 0 var(--safe-h);
    margin-bottom: 48px;
    animation: fadeIn 0.4s ease-out;
}
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}
.section-title {
    font-size: clamp(20px, 1.6vw, 28px);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.section-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: color 0.2s;
    cursor: pointer;
}
.section-subtitle:hover { color: var(--accent); }

.card-row {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
}
.card-row::-webkit-scrollbar { height: 0; }

/* ============================================================
   8. POSTER CARD (2:3)
   ============================================================ */
.poster-card {
    width: clamp(140px, 12vw, 200px);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), filter 0.35s;
    display: block;
    scroll-snap-align: start;
}
.poster-card:hover { transform: scale(1.08) translateY(-6px); z-index: 5; }

.poster-card .poster-img {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
    transition: box-shadow 0.35s, border-color 0.35s;
}
.poster-card:hover .poster-img {
    box-shadow: var(--shadow-focus);
    border-color: rgba(225,29,72,0.3);
}
.poster-card .poster-img img { width: 100%; height: 100%; object-fit: cover; }
.poster-card .poster-gradient {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.9) 100%);
}
.poster-card .poster-info {
    position: absolute;
    bottom: 12px; left: 12px; right: 12px;
}
.poster-card .poster-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.poster-card .poster-meta {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.poster-card .poster-meta .star { color: var(--warning); }
.poster-card .card-label {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   9. LANDSCAPE CARD (16:9)
   ============================================================ */
.landscape-card {
    width: clamp(260px, 20vw, 360px);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    display: block;
    scroll-snap-align: start;
}
.landscape-card:hover { transform: scale(1.06) translateY(-4px); z-index: 5; }

.landscape-card .landscape-img {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
    transition: box-shadow 0.35s, border-color 0.35s;
}
.landscape-card:hover .landscape-img {
    box-shadow: var(--shadow-focus);
    border-color: rgba(225,29,72,0.3);
}
.landscape-card .landscape-img img { width: 100%; height: 100%; object-fit: cover; }
.landscape-card .landscape-gradient {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 70%;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.85) 100%);
}
.landscape-card .progress-bar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.15);
}
.landscape-card .progress-fill {
    height: 100%;
    background: var(--accent);
}
.landscape-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 10px;
}
.landscape-card .card-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 3px;
}

/* ============================================================
   10. HOME VIEW
   ============================================================ */
.home-hero {
    position: relative;
    height: clamp(350px, 55vh, 620px);
    overflow: hidden;
}
.home-hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.home-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.home-hero-gradient {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        linear-gradient(to right, var(--bg-primary) 0%, rgba(8,6,12,0.85) 30%, rgba(8,6,12,0.4) 55%, transparent 75%),
        linear-gradient(to top, var(--bg-primary) 0%, transparent 40%);
}
.hero-content {
    position: absolute;
    bottom: 60px;
    left: var(--safe-h);
    max-width: 680px;
    z-index: 2;
}
.hero-title {
    font-size: clamp(28px, 3.5vw, 56px);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.hero-meta {
    font-size: clamp(13px, 1vw, 17px);
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    flex-wrap: wrap;
}
.hero-meta .dot { color: var(--text-muted); }
.hero-plot {
    font-size: clamp(14px, 1vw, 18px);
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-dots {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}
.hero-dot {
    width: 32px; height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.3s;
}
.hero-dot.active {
    width: 48px;
    background: var(--accent);
}

/* Quick Access */
.quick-access {
    display: flex;
    gap: 12px;
    padding: 0 var(--safe-h);
    margin-top: -30px;
    margin-bottom: 36px;
    position: relative;
    z-index: 5;
    flex-wrap: wrap;
}
.quick-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
    text-decoration: none;
}
.quick-btn:hover {
    background: rgba(225,29,72,0.1);
    border-color: rgba(225,29,72,0.3);
    color: var(--text-primary);
}
.quick-btn .qicon { font-size: 20px; }

/* Featured Card Row */
.featured-row { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; }
.featured-row::-webkit-scrollbar { height: 0; }
.featured-card {
    width: clamp(300px, 24vw, 420px);
    aspect-ratio: 16/9;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), box-shadow 0.35s;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--glass-border);
    display: block;
}
.featured-card:hover {
    transform: scale(1.04) translateY(-4px);
    box-shadow: var(--shadow-focus);
    border-color: rgba(225,29,72,0.3);
    z-index: 5;
}
.featured-card img { width: 100%; height: 100%; object-fit: cover; }
.featured-card .fc-gradient {
    position: absolute; bottom: 0; left: 0; right: 0; height: 70%;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
}
.featured-card .fc-info { position: absolute; bottom: 16px; left: 18px; right: 18px; }
.featured-card .fc-badge {
    font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
    color: var(--accent); text-transform: uppercase; margin-bottom: 4px;
}
.featured-card .fc-title { font-size: 22px; font-weight: 700; color: white; letter-spacing: -0.02em; }
.featured-card .fc-meta { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 3px; }
.featured-card .fc-play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(225,29,72,0.85);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: white;
    opacity: 0; transition: opacity 0.3s;
}
.featured-card:hover .fc-play { opacity: 1; }

/* Live Card Row */
.live-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.live-row::-webkit-scrollbar { height: 0; }
.live-card {
    width: clamp(240px, 16vw, 280px);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    text-decoration: none;
}
.live-card:hover {
    background: var(--bg-elevated);
    border-color: rgba(225,29,72,0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-focus);
}
.live-card .lc-logo {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: var(--text-tertiary);
    flex-shrink: 0; overflow: hidden;
}
.live-card .lc-logo img { width: 100%; height: 100%; object-fit: cover; }
.live-card .lc-info { flex: 1; min-width: 0; }
.live-card .lc-name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live-card .lc-prog {
    font-size: 12px; color: var(--text-tertiary); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================
   11. LIVE TV VIEW — EPG
   ============================================================ */
.epg-wrapper {
    display: flex;
    height: calc(100vh - 70px);
    overflow: hidden;
}

/* Category Sidebar */
.pkg-sidebar {
    width: clamp(200px, 16vw, 280px);
    flex-shrink: 0;
    background: rgba(11,9,16,0.98);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}
.pkg-header {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pkg-header-title {
    font-size: 12px; font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em; text-transform: uppercase;
}
.pkg-search-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    font-family: inherit;
}
.pkg-search-btn:hover {
    background: rgba(225,29,72,0.08);
    color: var(--accent);
    border-color: rgba(225,29,72,0.2);
}
.pkg-list {
    flex: 1; overflow-y: auto; padding: 6px 0;
}
.pkg-list::-webkit-scrollbar { width: 3px; }
.pkg-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }

.pkg-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.pkg-item:hover { background: rgba(255,255,255,0.03); }
.pkg-item.active {
    background: rgba(225,29,72,0.06);
    border-left-color: var(--accent);
}
.pkg-item-name {
    font-size: 15px; font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4; flex: 1; margin-right: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pkg-item.active .pkg-item-name { color: var(--text-primary); font-weight: 600; }
.pkg-item-count {
    font-size: 12px; font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 2px 9px; border-radius: 100px;
    flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.pkg-item.active .pkg-item-count {
    background: rgba(225,29,72,0.12);
    color: var(--accent-soft);
}

/* EPG Right Area */
.epg-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}
.epg-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px 12px 24px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    background: rgba(17,14,24,0.95);
    z-index: 8;
    gap: 12px;
    flex-wrap: wrap;
}
.epg-top-left { display: flex; align-items: center; gap: 12px; }
.epg-top-title {
    font-size: clamp(16px, 1.3vw, 22px);
    font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em;
}
.epg-top-badge {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 3px 10px; border-radius: 100px;
    font-variant-numeric: tabular-nums;
}
.epg-top-right { display: flex; align-items: center; gap: 8px; }

/* NOW Button */
.now-btn {
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(225,29,72,0.3);
    background: rgba(225,29,72,0.06);
    color: var(--accent);
    font-family: inherit;
    transition: all 0.2s;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 5px;
}
.now-btn:hover { background: rgba(225,29,72,0.12); }
.now-btn::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 2s infinite;
}

/* Grid Area */
.grid-area {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Channel Column */
.ch-col {
    width: clamp(140px, 10vw, 170px);
    flex-shrink: 0;
    background: rgba(11,9,16,0.95);
    border-right: 1px solid var(--glass-border);
    z-index: 6;
    display: flex;
    flex-direction: column;
}
.ch-col-head {
    height: 40px;
    display: flex; align-items: center;
    padding: 0 12px;
    font-size: 10px; font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em; text-transform: uppercase;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.ch-col-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; }
.ch-col-scroll::-webkit-scrollbar { width: 0; }

.ch-row {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    cursor: pointer;
    transition: background 0.12s;
}
.ch-row:hover { background: rgba(255,255,255,0.025); }
.ch-row.active { background: rgba(225,29,72,0.05); }
.ch-num {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    width: 24px; text-align: right; flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.ch-logo {
    width: 40px; height: 30px;
    border-radius: 5px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.04);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
}
.ch-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.ch-logo span { font-size: 8px; font-weight: 800; color: var(--text-tertiary); }
.ch-name {
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.ch-row.active .ch-name { color: var(--text-primary); font-weight: 600; }
.ch-fav { font-size: 11px; color: var(--accent); opacity: 0.6; flex-shrink: 0; }

/* Program Grid */
.pg-grid { min-width: max-content; position: relative; }
.pg-row {
    display: flex;
    height: 72px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}
.pg {
    height: 100%;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.15s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.02);
    background: rgba(20,17,30,0.5);
}
.pg:hover { background: rgba(255,255,255,0.05); z-index: 3; }
.pg.sel {
    background: rgba(225,29,72,0.07) !important;
    box-shadow: inset 0 0 0 2px rgba(225,29,72,0.4);
    border-radius: 5px;
    z-index: 4;
}
.pg .pg-t {
    font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; line-height: 1.3;
}
.pg .pg-s {
    font-size: 11px; font-weight: 400;
    color: rgba(255,255,255,0.25);
    margin-top: 2px; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
/* No-EPG: Channel Card Grid (replaces timeline when no EPG data) */
.ch-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px; padding: 16px;
    overflow-y: auto;
}
.ch-card {
    display: flex; align-items: center;
    gap: 14px; padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer; text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.ch-card:hover {
    background: var(--bg-elevated);
    border-color: rgba(225,29,72,0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.ch-card.active {
    background: rgba(225,29,72,0.06);
    border-color: rgba(225,29,72,0.4);
    box-shadow: inset 0 0 0 1px rgba(225,29,72,0.15);
}
.ch-card-num {
    font-size: 13px; font-weight: 700;
    color: var(--text-muted); width: 28px;
    text-align: center; flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.ch-card-logo {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.04);
}
.ch-card-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.ch-card-logo span { font-size: 11px; font-weight: 800; color: var(--text-tertiary); }
.ch-card-info { flex: 1; min-width: 0; }
.ch-card-name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.3;
}
.ch-card-cat {
    font-size: 12px; color: var(--text-tertiary);
    margin-top: 2px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.ch-card-actions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.ch-card-play {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(225,29,72,0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: var(--accent);
    opacity: 0; transition: opacity 0.2s;
}
.ch-card:hover .ch-card-play { opacity: 1; }
.ch-card-fav {
    font-size: 13px; color: var(--accent); opacity: 0.7;
}
/* Legacy no-epg styles kept for compatibility */
.pg.no-epg {
    width: 100% !important;
    background: rgba(20,17,30,0.3);
    border-left: none !important;
    min-width: 0;
    text-decoration: none;
}
.pg.no-epg .pg-t { color: var(--text-secondary); font-weight: 500; }
.pg.no-epg .no-epg-label { display: none; }
.pg.no-epg .pg-play { display: none; }

/* Timeline Area */
.tl-area {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    min-width: 0;
}
.tl-area::-webkit-scrollbar { height: 4px; width: 4px; }
.tl-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); border-radius: 2px; }
.tl-area::-webkit-scrollbar-corner { background: transparent; }

/* Timeline Header */
.tl-head {
    display: flex;
    height: 42px;
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(17,14,24,0.97);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--glass-border);
    min-width: max-content;
}
.tl-slot {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-left: 14px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.25);
    border-left: 1px solid rgba(255,255,255,0.03);
    font-variant-numeric: tabular-nums;
}
.tl-slot.now { color: var(--accent); font-weight: 700; }

/* NOW Line */
.now-line {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--accent);
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(225,29,72,0.35), 0 0 25px rgba(225,29,72,0.1);
}
.now-line::before {
    content: '';
    position: absolute;
    top: -1px; left: -4px;
    width: 10px; height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(225,29,72,0.5);
}
.now-pill {
    position: absolute;
    top: -34px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(225,29,72,0.4);
    letter-spacing: 0.03em;
}

/* Detail Panel */
.det-panel {
    min-height: 140px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, rgba(17,14,24,0.98), rgba(11,9,16,0.99));
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 24px;
    z-index: 10;
    animation: panelUp 0.25s cubic-bezier(0.4,0,0.2,1);
}
@keyframes panelUp {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.det-thumb {
    width: 172px; height: 98px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.04);
}
.det-thumb img { width: 100%; height: 100%; object-fit: cover; }
.det-thumb .play-ov {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.25);
    opacity: 0; transition: opacity 0.15s;
    cursor: pointer;
}
.det-thumb:hover .play-ov { opacity: 1; }
.play-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: white;
    border: 1px solid rgba(255,255,255,0.12);
}
.det-info { flex: 1; overflow: hidden; }
.det-ch {
    font-size: 11px; font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.06em; text-transform: uppercase;
    margin-bottom: 3px;
}
.det-title {
    font-size: 22px; font-weight: 700; color: var(--text-primary);
    letter-spacing: -0.02em; margin-bottom: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.det-meta {
    font-size: 12px; color: var(--text-tertiary);
    display: flex; align-items: center; gap: 6px;
    font-weight: 500; margin-bottom: 4px;
}
.det-meta .live-d {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--accent); font-weight: 700; font-size: 11px;
}
.det-meta .live-d::before {
    content: ''; width: 6px; height: 6px;
    border-radius: 50%; background: var(--accent);
    animation: pulse-dot 2s infinite;
}
.det-desc {
    font-size: 12px; color: var(--text-secondary);
    line-height: 1.5; max-width: 500px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.det-actions {
    display: flex; flex-direction: column; gap: 7px; flex-shrink: 0;
}

/* Search Overlay */
.src-ov {
    position: absolute;
    top: 70px; left: clamp(200px, 16vw, 290px);
    width: 380px;
    background: rgba(17,14,24,0.97);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 80px rgba(0,0,0,0.7);
    z-index: 30;
    overflow: hidden;
}
.src-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
}
.src-bar input {
    flex: 1; background: none; border: none;
    font-size: 14px; font-weight: 500;
    color: var(--text-primary); font-family: inherit; outline: none;
}
.src-bar input::placeholder { color: var(--text-muted); }
.src-x {
    font-size: 14px; color: var(--text-muted);
    cursor: pointer; padding: 4px; transition: color 0.15s;
}
.src-x:hover { color: var(--text-primary); }
.src-list { max-height: 320px; overflow-y: auto; padding: 4px; }
.sr {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: var(--radius-xs);
    cursor: pointer; transition: background 0.1s;
}
.sr:hover { background: rgba(255,255,255,0.04); }
.sr-n { font-size: 11px; font-weight: 700; color: var(--text-muted); width: 26px; text-align: center; }
.sr-l { width: 30px; height: 22px; border-radius: 4px; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; font-size: 7px; font-weight: 800; color: var(--text-tertiary); flex-shrink: 0; }
.sr-nm { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.sr-c { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   12. MOVIES & SERIES VIEW
   ============================================================ */
.mov-wrap {
    display: flex;
    height: calc(100vh - 70px);
    overflow: hidden;
}

/* Sidebar */
.mov-sidebar {
    width: clamp(200px, 15vw, 260px);
    flex-shrink: 0;
    background: rgba(11,9,16,0.98);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}
.mov-sb-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.mov-sb-title {
    font-size: 12px; font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em; text-transform: uppercase;
}
.mov-sb-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.mov-sb-list::-webkit-scrollbar { width: 3px; }
.mov-sb-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); border-radius: 2px; }

.sb-cat {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer; transition: all 0.15s;
    border-left: 3px solid transparent;
}
.sb-cat:hover { background: rgba(255,255,255,0.03); }
.sb-cat.active {
    background: rgba(225,29,72,0.06);
    border-left-color: var(--accent);
}
.sb-cat-name { font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.sb-cat.active .sb-cat-name { color: var(--text-primary); font-weight: 600; }
.sb-cat-count {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 2px 8px; border-radius: 100px;
    font-variant-numeric: tabular-nums;
}
.sb-cat.active .sb-cat-count {
    background: rgba(225,29,72,0.12);
    color: var(--accent-soft);
}

/* Content Area */
.mov-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mov-top-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 32px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0; gap: 12px; flex-wrap: wrap;
}
.mov-top-left { display: flex; align-items: center; gap: 12px; }
.mov-top-title {
    font-size: clamp(16px, 1.3vw, 22px);
    font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em;
}
.mov-top-badge {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 3px 10px; border-radius: 100px;
}

/* Search */
.mov-search {
    flex: 1; max-width: 340px;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
}
.mov-search:focus-within {
    border-color: rgba(225,29,72,0.3);
    background: rgba(255,255,255,0.04);
}
.mov-search-icon { font-size: 14px; color: var(--text-muted); }
.mov-search input {
    flex: 1; background: none; border: none;
    font-size: 14px; font-weight: 500;
    color: var(--text-primary); font-family: inherit; outline: none;
}
.mov-search input::placeholder { color: var(--text-muted); }

/* Sort */
.mov-sort { display: flex; gap: 6px; flex-shrink: 0; }
.sort-chip {
    padding: 7px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    transition: all 0.15s;
}
.sort-chip:hover { background: var(--glass-fill); color: var(--text-secondary); }
.sort-chip.active { background: var(--glass-highlight); color: var(--text-primary); border-color: rgba(255,255,255,0.1); }

/* Movie Grid */
.mov-grid-wrap {
    flex: 1; overflow-y: auto;
    padding: 20px 24px 40px;
}
.mov-grid-wrap::-webkit-scrollbar { width: 4px; }
.mov-grid-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); border-radius: 2px; }
.mov-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px 16px;
}

/* Movie Card */
.m-card {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    display: block;
}
.m-card:hover { transform: scale(1.06) translateY(-4px); z-index: 5; }
.m-poster {
    width: 100%; aspect-ratio: 2/3;
    border-radius: var(--radius-sm);
    overflow: hidden; position: relative;
    background: var(--bg-tertiary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.04);
    transition: box-shadow 0.3s, border-color 0.3s;
}
.m-card:hover .m-poster {
    box-shadow: var(--shadow-focus);
    border-color: rgba(225,29,72,0.3);
}
.m-poster img { width: 100%; height: 100%; object-fit: cover; }
.m-poster .m-grad {
    position: absolute; bottom: 0; left: 0; right: 0; height: 55%;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    pointer-events: none;
}
.m-poster .m-info { position: absolute; bottom: 10px; left: 10px; right: 10px; }
.m-poster .m-name {
    font-size: 14px; font-weight: 600; color: white;
    line-height: 1.3; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.m-poster .m-meta {
    font-size: 11px; color: rgba(255,255,255,0.55);
    margin-top: 2px; display: flex; align-items: center; gap: 4px;
}
.m-poster .m-meta .star { color: var(--warning); }
.m-poster .m-badge { position: absolute; top: 8px; right: 8px; }
.m-poster .m-fav { position: absolute; top: 8px; left: 8px; font-size: 14px; color: var(--accent); }
.m-poster .m-play {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0; transition: opacity 0.2s;
}
.m-card:hover .m-play { opacity: 1; }
.m-play-btn {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(225,29,72,0.85);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white;
    box-shadow: 0 4px 16px rgba(225,29,72,0.4);
}

/* Load More */
.load-more {
    text-align: center;
    padding: 24px 0;
}

/* ============================================================
   13. MOVIE DETAIL MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-overlay);
    z-index: 200;
    overflow-y: auto;
    backdrop-filter: blur(8px);
}

/* Detail Hero */
.detail-hero {
    position: relative;
    min-height: clamp(400px, 50vh, 580px);
}
.detail-hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100%;
    overflow: hidden;
}
.detail-hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
.detail-hero-gradient {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background:
        linear-gradient(to bottom, rgba(8,6,12,0.4) 0%, rgba(8,6,12,0.7) 60%, var(--bg-primary) 100%),
        linear-gradient(to right, var(--bg-primary) 0%, transparent 45%);
}
.detail-content {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 36px;
    padding: 80px var(--safe-h) 40px;
    align-items: flex-start;
}
.detail-poster {
    width: clamp(180px, 15vw, 260px);
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    flex-shrink: 0;
    box-shadow: var(--shadow-elevated), 0 0 60px rgba(225,29,72,0.1);
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; padding-bottom: 8px; }
.detail-title {
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 800; line-height: 1.08;
    margin-bottom: 12px; letter-spacing: -0.03em;
}
.detail-meta {
    font-size: 15px; color: rgba(255,255,255,0.65);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px; font-weight: 500;
    flex-wrap: wrap;
}
.detail-meta .star { color: var(--warning); }
.detail-meta .dot { color: var(--text-muted); }
.detail-plot {
    font-size: 15px; color: rgba(255,255,255,0.5);
    line-height: 1.6; margin-bottom: 20px; max-width: 680px;
}
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Cast */
.md-cast-row { display: flex; gap: 14px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.md-cast-row::-webkit-scrollbar { height: 0; }
.md-cast-card { width: 90px; text-align: center; flex-shrink: 0; }
.md-cast-photo {
    width: 72px; height: 72px; border-radius: 50%;
    overflow: hidden; margin: 0 auto 6px;
    border: 2px solid rgba(255,255,255,0.06);
    background: var(--bg-tertiary);
}
.md-cast-photo img { width: 100%; height: 100%; object-fit: cover; }
.md-cast-name { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.7); line-height: 1.3; }
.md-cast-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.related-section { padding: 0 var(--safe-h); margin-bottom: 48px; }

/* ============================================================
   14. SERIES DETAIL VIEW
   ============================================================ */
.sv-hero { position: relative; min-height: clamp(400px, 55vh, 620px); overflow: hidden; }
.sv-hero-bg {
    position: absolute; top: 0; left: 0; right: 0; height: 580px; overflow: hidden;
}
.sv-hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
.sv-hero-grad1 {
    position: absolute; top: 0; left: 0; right: 0; height: 580px;
    background: linear-gradient(to bottom, rgba(8,6,12,0.4) 0%, rgba(8,6,12,0.7) 50%, var(--bg-primary) 100%);
}
.sv-hero-grad2 {
    position: absolute; top: 0; left: 0; right: 0; height: 580px;
    background: linear-gradient(to right, var(--bg-primary) 0%, transparent 45%);
}
.sv-hero-content {
    position: relative; z-index: 2;
    display: flex; gap: 40px;
    padding: 20px var(--safe-h) 40px;
    align-items: flex-start;
}
.sv-poster {
    width: clamp(180px, 15vw, 260px);
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    flex-shrink: 0; overflow: hidden;
    box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 0 50px rgba(225,29,72,0.08);
    border: 1px solid rgba(255,255,255,0.06);
    background: var(--bg-tertiary);
}
.sv-poster img { width: 100%; height: 100%; object-fit: cover; }
.sv-info { flex: 1; padding-top: 12px; }
.sv-label {
    font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
    color: var(--accent); text-transform: uppercase; margin-bottom: 10px;
}
.sv-title {
    font-size: clamp(28px, 3vw, 48px);
    font-weight: 800; line-height: 1.05;
    letter-spacing: -0.03em; margin-bottom: 12px;
}
.sv-meta {
    font-size: 16px; color: rgba(255,255,255,0.6);
    display: flex; align-items: center; gap: 8px;
    font-weight: 500; margin-bottom: 14px; flex-wrap: wrap;
}
.sv-meta .dot { color: var(--text-muted); }
.sv-meta .q-tag {
    padding: 2px 8px; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px; font-size: 12px; font-weight: 600;
    color: rgba(255,255,255,0.7);
}
.sv-plot {
    font-size: 16px; color: rgba(255,255,255,0.45);
    line-height: 1.65; margin-bottom: 16px; max-width: 600px;
}
.sv-credits { margin-bottom: 18px; }
.sv-credit-row { font-size: 15px; margin-bottom: 4px; display: flex; }
.sv-credit-label { font-weight: 600; color: var(--text-tertiary); width: 75px; flex-shrink: 0; }
.sv-credit-value { color: rgba(255,255,255,0.65); }
/* Resume Banner */
.sv-resume {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    background: rgba(225,29,72,0.06);
    border: 1px solid rgba(225,29,72,0.12);
    border-radius: var(--radius-sm);
    margin-bottom: 20px; max-width: 440px;
    cursor: pointer; transition: all 0.3s;
}
.sv-resume:hover {
    background: rgba(225,29,72,0.1);
    border-color: rgba(225,29,72,0.25);
}
.sv-resume-play { font-size: 15px; color: var(--accent); }
.sv-resume-info { flex: 1; }
.sv-resume-title { font-size: 15px; color: var(--text-primary); font-weight: 500; }
.sv-resume-bar {
    width: 100%; height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px; margin-top: 6px; overflow: hidden;
}
.sv-resume-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.sv-resume-left { font-size: 13px; color: var(--text-tertiary); white-space: nowrap; }
.sv-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Season Tabs — exact match from 10_SeriesView.html mockup */
.sv-seasons-area { padding: 0 var(--safe-h); margin-top: 10px; position: relative; z-index: 5; background: var(--bg-primary); }
.sv-season-tabs {
    display: flex; gap: 8px; margin-bottom: 24px;
    overflow-x: auto; padding-bottom: 4px;
}
.sv-season-tabs::-webkit-scrollbar { height: 0; }
.sv-season-tab {
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all 0.25s;
    border: 1px solid var(--glass-border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    white-space: nowrap; text-align: center;
    min-width: 110px; flex-shrink: 0;
}
.sv-season-tab:hover {
    background: var(--bg-elevated);
    border-color: rgba(225,29,72,0.2);
    color: var(--text-primary);
}
.sv-season-tab.active {
    background: linear-gradient(135deg, var(--accent), #BE123C);
    color: white; border-color: transparent;
    box-shadow: 0 4px 16px rgba(225,29,72,0.3);
}
.sv-season-tab .st-count {
    display: block; font-size: 12px; font-weight: 500;
    margin-top: 2px; opacity: 0.7;
}

/* Season Info Bar — exact match from 10_SeriesView.html mockup */
.sv-season-info {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 18px; padding: 0 2px;
}
.sv-season-left { display: flex; align-items: center; gap: 12px; }
.sv-season-name {
    font-size: 22px;
    font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em;
}
.sv-season-badge {
    font-size: 13px; font-weight: 600; color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 3px 12px; border-radius: 100px;
}
.sv-season-right {
    display: flex; align-items: center; gap: 14px;
    font-size: 14px; color: var(--text-tertiary);
}
.sv-watched-count {
    display: flex; align-items: center; gap: 6px;
}
.sv-watched-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success);
}

/* Season Content Container */
.sv-season-content {
    padding-top: 4px;
}
.sv-season-content:not(.active) { display: none; }

/* Episode Row — exact match from 10_SeriesView.html mockup */
.sv-ep {
    display: flex; align-items: center;
    gap: 18px; padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.sv-ep:hover {
    background: var(--bg-elevated);
    border-color: rgba(225,29,72,0.2);
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(225,29,72,0.06);
}
.sv-ep.watching {
    border-color: rgba(225,29,72,0.2);
    background: rgba(225,29,72,0.03);
}
.sv-ep-num {
    width: 36px; text-align: center;
    font-size: 16px; font-weight: 700;
    color: var(--text-muted); flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.sv-ep.watching .sv-ep-num { color: var(--accent); }
.sv-ep.watched .sv-ep-num { color: var(--success); }
.sv-ep-thumb {
    width: clamp(120px, 10vw, 170px);
    aspect-ratio: 16/9;
    border-radius: 8px; overflow: hidden;
    flex-shrink: 0; position: relative;
    background: var(--bg-tertiary);
}
.sv-ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sv-ep-thumb .ep-play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.35);
    opacity: 0; transition: opacity 0.2s;
}
.sv-ep:hover .ep-play-overlay { opacity: 1; }
.ep-play-circle {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(225,29,72,0.85);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: white;
}
/* Watched overlay on thumb */
.sv-ep-thumb .ep-watched-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--success);
}
.sv-ep-thumb .ep-progress {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 3px; background: rgba(255,255,255,0.15);
}
.sv-ep-thumb .ep-progress-fill { height: 100%; background: var(--accent); }
/* Episode Info — exact match from mockup */
.sv-ep-info { flex: 1; min-width: 0; }
.sv-ep-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.sv-ep-title {
    font-size: 17px; font-weight: 600; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    letter-spacing: -0.01em;
}
.sv-ep.watched .sv-ep-title { color: var(--text-secondary); }
.sv-ep-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.ep-badge {
    font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 4px; letter-spacing: 0.03em;
}
.ep-badge-new { background: rgba(16,185,129,0.15); color: var(--success); }
.ep-badge-watched { background: rgba(16,185,129,0.1); color: var(--success); }
.ep-badge-watching { background: rgba(225,29,72,0.12); color: var(--accent-soft); }
.ep-badge-finale { background: rgba(245,158,11,0.15); color: var(--warning); }
.sv-ep-sub {
    font-size: 13px; color: var(--text-tertiary);
    margin-bottom: 4px;
    display: flex; align-items: center; gap: 6px;
}
.sv-ep-plot {
    font-size: 14px; color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sv-ep-duration {
    font-size: 14px; color: var(--text-muted);
    font-weight: 500; flex-shrink: 0; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Cast Section */
.sv-cast-section { padding: 40px var(--safe-h) 0; position: relative; z-index: 5; background: var(--bg-primary); }
.sv-cast-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.sv-cast-row::-webkit-scrollbar { height: 0; }
.sv-cast-card { width: 100px; text-align: center; flex-shrink: 0; }
.sv-cast-photo {
    width: 80px; height: 80px; border-radius: 50%;
    overflow: hidden; margin: 0 auto 8px;
    border: 2px solid rgba(255,255,255,0.06);
    background: var(--bg-tertiary);
}
.sv-cast-photo img { width: 100%; height: 100%; object-fit: cover; }
.sv-cast-name { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.7); line-height: 1.3; }
.sv-cast-role { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.sv-related { padding: 40px var(--safe-h) 0; margin-bottom: 48px; position: relative; z-index: 5; background: var(--bg-primary); }

/* ============================================================
   15. FAVORITES VIEW
   ============================================================ */
.fav-tabs {
    display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap;
}
.fav-tab {
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 16px; font-weight: 600;
    cursor: pointer; transition: all 0.3s;
    border: 1px solid var(--glass-border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 8px;
}
.fav-tab:hover { background: var(--bg-elevated); color: var(--text-primary); }
.fav-tab.active {
    background: linear-gradient(135deg, var(--accent), #BE123C);
    color: white; border-color: transparent;
    box-shadow: 0 4px 16px rgba(225,29,72,0.3);
}
.fav-tab .fav-count {
    font-size: 12px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
    background: rgba(255,255,255,0.15);
}
.fav-tab.active .fav-count { background: rgba(255,255,255,0.25); }

.fav-grid {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.fav-ch-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.fav-ch-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    text-decoration: none;
}
.fav-ch-card:hover {
    background: var(--bg-elevated);
    border-color: rgba(225,29,72,0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-focus);
}
.fav-ch-logo {
    width: 56px; height: 56px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800; color: var(--text-tertiary);
    flex-shrink: 0; overflow: hidden;
}
.fav-ch-info { flex: 1; min-width: 0; }
.fav-ch-name {
    font-size: 16px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fav-ch-prog {
    font-size: 12px; color: var(--text-tertiary); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fav-heart {
    position: absolute; top: 10px; right: 10px;
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(225,29,72,0.8);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: white;
    backdrop-filter: blur(4px); z-index: 2;
}
.fav-poster { position: relative; }
.fav-poster .fav-remove {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
    opacity: 0; transition: opacity 0.3s;
    border-radius: var(--radius-md); z-index: 3;
}
.fav-poster:hover .fav-remove { opacity: 1; }
.fav-remove-btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: none; font-family: inherit;
    font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}

.empty-fav { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-fav .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-fav .empty-title {
    font-size: 20px; font-weight: 600;
    color: var(--text-tertiary); margin-bottom: 8px;
}
.empty-fav .empty-desc {
    font-size: 15px; color: var(--text-muted);
    max-width: 400px; margin: 0 auto;
}

/* ============================================================
   16. SETTINGS VIEW
   ============================================================ */
.settings-layout {
    display: flex; gap: 36px;
    padding: 20px var(--safe-h);
}
.settings-nav { width: clamp(200px, 15vw, 260px); flex-shrink: 0; }
.settings-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.25s;
    margin-bottom: 3px; border: 1px solid transparent;
}
.settings-nav-item:hover { background: var(--bg-elevated); }
.settings-nav-item.active {
    background: rgba(225,29,72,0.08);
    border-color: rgba(225,29,72,0.15);
}
.settings-nav-item .sn-icon {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
}
.settings-nav-item .sn-label {
    font-size: 16px; font-weight: 500; color: var(--text-secondary);
}
.settings-nav-item.active .sn-label { color: var(--text-primary); font-weight: 600; }

.settings-content { flex: 1; max-width: 720px; overflow-y: auto; }
.settings-section-panel { animation: fadeIn 0.2s ease; }
.settings-section-panel:not(.active) { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Profile */
.profile-card {
    display: flex; align-items: center; gap: 20px;
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 28px;
}
.profile-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #BE123C);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; color: white; flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name {
    font-size: 22px; font-weight: 700;
    color: var(--text-primary); letter-spacing: -0.02em;
}
.profile-sub { font-size: 14px; color: var(--text-tertiary); margin-top: 3px; }

/* Stats */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px; margin-bottom: 28px;
}
.stat-card {
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-align: center;
}
.stat-value {
    font-size: 28px; font-weight: 700;
    color: var(--text-primary); letter-spacing: -0.02em;
}
.stat-label { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; font-weight: 500; }
.stat-icon { font-size: 16px; margin-bottom: 6px; }

/* Settings Rows */
.settings-section { margin-bottom: 24px; }
.settings-section-title {
    font-size: 12px; font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em; text-transform: uppercase;
    margin-bottom: 10px; padding-left: 4px;
}
.settings-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 3px; cursor: pointer;
    transition: all 0.25s;
    border: 1px solid transparent;
}
.settings-row:hover { background: var(--bg-elevated); border-color: rgba(225,29,72,0.2); }
.settings-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
}
.settings-label { flex: 1; font-size: 16px; font-weight: 500; }
.settings-value { font-size: 14px; color: var(--text-tertiary); }
.settings-chevron { color: var(--text-muted); font-size: 16px; }
.settings-row .settings-label > div:first-child { font-weight: 500; }

/* Storage Bar */
.storage-bar {
    width: 100%; height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px; overflow: hidden;
    margin-top: 8px;
}
.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #BE123C);
    border-radius: 4px;
    transition: width 0.5s ease;
}
.storage-detail {
    display: flex; justify-content: space-between;
    font-size: 12px; color: var(--text-muted);
    margin-top: 4px;
}

/* Accent Color Picker */
.color-picker {
    display: flex; gap: 10px; align-items: center;
}
.color-dot {
    width: 28px; height: 28px; border-radius: 50%;
    cursor: pointer; transition: all 0.2s;
    border: 2px solid transparent;
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: white; box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }

/* Settings Select */
.settings-select {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px; font-weight: 500;
    cursor: pointer;
}

/* Toggle */
.toggle {
    width: 48px; height: 28px;
    border-radius: 14px; position: relative;
    cursor: pointer; transition: background 0.3s; flex-shrink: 0;
}
.toggle.off { background: rgba(255,255,255,0.12); }
.toggle.on { background: var(--accent); }
.toggle::after {
    content: ''; width: 22px; height: 22px;
    border-radius: 50%; background: white;
    position: absolute; top: 3px;
    transition: left 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toggle.off::after { left: 3px; }
.toggle.on::after { left: 23px; }


/* Storage Bar */
.storage-bar {
    height: 8px; border-radius: 4px;
    background: rgba(255,255,255,0.08);
    overflow: hidden; margin-top: 10px;
}
.storage-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright));
}

/* ============================================================
   17. PLAYER OVERLAY
   ============================================================ */
#player-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
    z-index: 300;
}
.player-screen {
    position: relative;
    width: 100%; height: 100%;
    background: #000;
}
.player-screen video {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #12081A, #06030A, #120810);
}
.player-top-gradient {
    position: absolute;
    top: 0; left: 0; right: 0; height: 180px;
    background: linear-gradient(rgba(0,0,0,0.7) 0%, transparent 100%);
    z-index: 2; pointer-events: none;
}
.player-bottom-gradient {
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 260px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0.9) 100%);
    z-index: 2; pointer-events: none;
}
.player-back {
    position: absolute;
    top: 20px; left: 24px; z-index: 3;
    font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.7);
    cursor: pointer; transition: color 0.2s;
    display: flex; align-items: center; gap: 6px;
}
.player-back:hover { color: white; }
.player-back span { font-size: 24px; font-weight: 300; }
.player-top-bar {
    position: absolute;
    top: 36px; left: 60px; z-index: 3;
}
.player-series-info {
    font-size: 16px; font-weight: 600;
    color: rgba(255,255,255,0.6);
    margin-bottom: 4px;
}
.player-channel-name {
    font-size: 24px; font-weight: 700; color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    letter-spacing: -0.02em;
}
.player-top-right {
    position: absolute;
    top: 36px; right: 60px; z-index: 3;
    display: flex; gap: 8px;
}
.quality-pill {
    padding: 4px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
}

.player-controls {
    position: absolute;
    bottom: 36px; left: 40px; right: 40px; z-index: 3;
}
.player-seek-bar { margin-bottom: 14px; }
.player-seek-track {
    height: 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    position: relative; cursor: pointer;
    transition: height 0.2s;
}
.player-seek-track:hover { height: 7px; }
.player-seek-buffer {
    position: absolute; top: 0; left: 0;
    height: 100%;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}
.player-seek-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    position: relative;
    transition: width 0.1s;
}
.player-seek-thumb {
    width: 14px; height: 14px;
    border-radius: 50%; background: white;
    position: absolute; right: -7px; top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    opacity: 0; transition: opacity 0.2s;
}
.player-seek-track:hover .player-seek-thumb { opacity: 1; }
.player-times {
    display: flex; justify-content: space-between; margin-top: 8px;
}
.player-time {
    font-size: 14px; font-weight: 500;
    color: rgba(255,255,255,0.6);
    font-variant-numeric: tabular-nums;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}
.player-time.current { color: rgba(255,255,255,0.9); font-weight: 600; }

.player-buttons {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.player-btn {
    width: 52px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
    color: white; font-size: 20px;
    cursor: pointer; border: none; font-family: inherit;
    transition: all 0.25s;
    backdrop-filter: blur(4px);
}
.player-btn:hover { background: rgba(255,255,255,0.16); transform: scale(1.06); }
.player-btn.play { width: 60px; font-size: 26px; background: rgba(255,255,255,0.12); }
.player-btn-label {
    font-size: 14px; font-weight: 500; color: white;
    padding: 0 14px; height: 48px;
    display: flex; align-items: center; gap: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.08);
    cursor: pointer; border: none; font-family: inherit;
    transition: all 0.25s;
}
.player-btn-label:hover { background: rgba(255,255,255,0.16); }

.player-loading {
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    z-index: 5;
}

/* ============================================================
   18. LOADING SCREEN
   ============================================================ */
#loading-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-primary);
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s;
}
#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}
.loading-content { text-align: center; }
.loading-logo {
    font-size: 48px; font-weight: 900;
    color: var(--accent);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}
.loading-text {
    font-size: 16px; color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Section Loading */
.section-loading {
    display: flex; justify-content: center; align-items: center;
    padding: 60px; grid-column: 1 / -1;
}

/* Spinner */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   19. TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
    position: fixed;
    top: 80px; right: 24px;
    z-index: 400;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    color: white;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease-out;
    max-width: 360px;
    border: 1px solid rgba(255,255,255,0.06);
}
.toast-success { background: rgba(16,185,129,0.9); }
.toast-error { background: rgba(239,68,68,0.9); }
.toast-info { background: rgba(59,130,246,0.9); }
.toast-warning { background: rgba(245,158,11,0.9); }
.toast.show { opacity: 1; }
.toast.hide { opacity: 0; transform: translateX(40px); transition: all 0.3s; }
.toast-icon { margin-right: 8px; font-weight: 700; }
.toast-msg { flex: 1; }
@keyframes toastIn {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   20. ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   21. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .pkg-sidebar { width: 220px; }
    .mov-sidebar { width: 200px; }
    .ch-col { width: 130px; }
    .settings-layout { gap: 24px; }
    .settings-nav { width: 200px; }
    .detail-content { gap: 24px; }
    .sv-hero-content { gap: 24px; }
    .det-panel { padding: 12px 16px; gap: 14px; }
    .det-thumb { width: 130px; height: 74px; }
}

/* Mobile landscape */
@media (max-width: 768px) {
    .tab-bar { padding: 12px 16px 14px; gap: 12px; overflow-x: auto; }
    .tab-item { font-size: 14px; }

    .pkg-sidebar,
    .mov-sidebar { display: none; }
    .ch-col { width: 110px; }

    .epg-wrapper,
    .mov-wrap { height: calc(100vh - 60px); }

    .settings-layout { flex-direction: column; gap: 16px; }
    .settings-nav {
        width: 100%;
        display: flex; gap: 6px;
        overflow-x: auto;
    }
    .settings-nav-item { flex-shrink: 0; }

    .detail-content,
    .sv-hero-content { flex-direction: column; align-items: center; text-align: center; }
    .detail-poster,
    .sv-poster { width: 200px; }
    .detail-actions,
    .sv-actions { justify-content: center; }

    .hero-content { max-width: 100%; right: var(--safe-h); }

    .det-panel { flex-wrap: wrap; }
    .det-thumb { width: 100px; height: 56px; }

    .player-controls { left: 16px; right: 16px; bottom: 20px; }
    .player-top-bar { left: 20px; }
    .player-top-right { right: 20px; }

    .sv-ep { flex-wrap: wrap; gap: 10px; }
    .sv-ep-thumb { width: 100%; max-width: 200px; }

    .fav-ch-grid { grid-template-columns: 1fr; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .home-hero { height: 300px; }
    .hero-title { font-size: 24px; }
    .quick-access { gap: 8px; }
    .quick-btn { padding: 10px 14px; font-size: 13px; }

    .ch-col { display: none; }
    .mov-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
    .fav-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

    .detail-poster,
    .sv-poster { width: 160px; }

    .player-buttons { gap: 8px; }
    .player-btn { width: 44px; height: 40px; font-size: 18px; }
    .player-btn.play { width: 52px; font-size: 22px; }
}
