/* ============================================
   MOVBOX - Professional Streaming CSS
   Dark glassmorphism + purple-cyan theme
   Optimized for low-end devices
   ============================================ */

:root {
    --bg: #06060b;
    --bg-card: rgba(255,255,255,0.04);
    --bg-card-hover: rgba(255,255,255,0.08);
    --bg-glass: rgba(12,12,20,0.75);
    --bg-glass-solid: #0c0c14;
    --text: #f0f0f5;
    --text-muted: #8b8b9e;
    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent2: #06b6d4;
    --accent2-light: #22d3ee;
    --gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --gradient-h: linear-gradient(90deg, #8b5cf6 0%, #06b6d4 100%);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-sm: 8px;
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
    --transition: 0.25s ease;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; }
input { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.5); }

/* ===== LOADER ===== */
.loader {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.4s, visibility 0.4s;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-logo {
    font-family: var(--font-heading);
    font-size: 2.5rem; font-weight: 700;
    background: var(--gradient-h);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    animation: loaderPulse 1.5s ease-in-out infinite;
}
.loader-bar {
    width: 200px; height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px; overflow: hidden;
}
.loader-bar-fill {
    height: 100%; width: 0;
    background: var(--gradient-h);
    border-radius: 3px;
    animation: loaderFill 1.2s ease-in-out forwards;
}
@keyframes loaderPulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes loaderFill { to { width: 100%; } }

/* ===== AMBIENT BACKGROUND ===== */
.ambient-bg {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    overflow: hidden;
}
.ambient-orb {
    position: absolute; border-radius: 50%;
    filter: blur(100px); opacity: 0.12;
    will-change: transform;
}
.ambient-orb:nth-child(1) {
    width: 500px; height: 500px;
    background: var(--accent);
    top: -150px; left: -100px;
    animation: orbFloat1 20s ease-in-out infinite;
}
.ambient-orb:nth-child(2) {
    width: 400px; height: 400px;
    background: var(--accent2);
    bottom: -100px; right: -100px;
    animation: orbFloat2 25s ease-in-out infinite;
}
@keyframes orbFloat1 {
    0%,100%{transform:translate(0,0)} 33%{transform:translate(80px,50px)} 66%{transform:translate(-40px,80px)}
}
@keyframes orbFloat2 {
    0%,100%{transform:translate(0,0)} 33%{transform:translate(-60px,-40px)} 66%{transform:translate(40px,-60px)}
}

/* ===== PAGE TRANSITIONS ===== */
.app-content {
    will-change: opacity, transform;
}
.page-enter {
    animation: pageEnter 0.35s ease forwards;
}
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: transparent;
    transition: background var(--transition), box-shadow var(--transition), backdrop-filter var(--transition);
}
.navbar.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}
.nav-inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px;
}
.nav-logo {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-heading);
    font-size: 1.5rem; font-weight: 700;
}
.logo-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: var(--gradient);
    border-radius: 10px;
    font-size: 1rem;
    box-shadow: 0 0 20px rgba(139,92,246,0.3);
}
.logo-text { letter-spacing: -0.5px; }
.logo-accent { background: var(--gradient-h); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-links {
    display: flex; gap: 8px;
}
.nav-link {
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 500;
    transition: all var(--transition);
    position: relative;
}
.nav-link:hover { background: rgba(255,255,255,0.05); }
.nav-link.active { background: rgba(139,92,246,0.15); color: var(--accent-light); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.search-toggle {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    transition: all var(--transition);
}
.search-toggle:hover { background: rgba(255,255,255,0.1); }

/* Hamburger */
.hamburger {
    display: none; flex-direction: column;
    gap: 5px; padding: 8px;
}
.hamburger span {
    display: block; width: 22px; height: 2px;
    background: var(--text); border-radius: 2px;
    transition: all var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== HERO ===== */
.hero {
    position: relative; min-height: 80vh;
    display: flex; align-items: flex-end;
    padding: 120px 24px 60px;
}
.hero-bg {
    position: absolute; inset: 0;
}
.hero-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.hero-bg::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, var(--bg) 0%, rgba(6,6,11,0.7) 40%, rgba(6,6,11,0.3) 70%, transparent 100%);
}
.hero-content {
    position: relative; z-index: 1;
    max-width: 1400px; margin: 0 auto; width: 100%;
}
.hero-badge {
    display: inline-block;
    padding: 6px 16px; border-radius: 20px;
    background: rgba(139,92,246,0.2);
    color: var(--accent-light);
    font-family: var(--font-mono);
    font-size: 0.75rem; font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700; line-height: 1.1;
    margin-bottom: 12px;
    max-width: 600px;
}
.hero-meta {
    display: flex; gap: 16px; flex-wrap: wrap;
    margin-bottom: 16px; font-size: 0.95rem;
}
.hero-meta-item { color: var(--text-muted); }
.hero-rating { color: #fbbf24; font-weight: 600; }
.hero-overview {
    font-size: 1rem; color: var(--text-muted);
    max-width: 500px; margin-bottom: 24px;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: 50px;
    font-size: 0.95rem; font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(139,92,246,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139,92,246,0.4);
}
.btn-secondary {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.14);
    transform: translateY(-2px);
}

/* ===== CARDS ===== */
.section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-family: var(--font-heading);
    font-size: 1.3rem; font-weight: 600;
}
.section-more {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.85rem; color: var(--accent-light);
    transition: color var(--transition);
}
.section-more:hover { color: var(--accent); }

.card-row {
    display: flex; gap: 14px;
    overflow-x: auto; overflow-y: hidden;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.card-row::-webkit-scrollbar { height: 4px; }

.card {
    flex: 0 0 160px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform var(--transition);
}
.card:hover { transform: translateY(-6px); }

.card-poster {
    position: relative; 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 0.4s ease;
}
.card:hover .card-poster img { transform: scale(1.05); }

.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-rating {
    position: absolute; top: 8px; left: 8px;
    display: flex; align-items: center; gap: 4px;
    padding: 4px 8px; border-radius: 6px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    font-size: 0.75rem; font-weight: 600;
}
.card-quality {
    position: absolute; top: 8px; right: 8px;
    padding: 2px 6px; border-radius: 4px;
    background: rgba(139,92,246,0.8);
    font-size: 0.65rem; font-weight: 700;
    font-family: var(--font-mono);
}
.card-info { padding: 8px 2px; }
.card-title {
    font-size: 0.85rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-year {
    font-size: 0.75rem; color: var(--text-muted);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.content-grid .card { flex: none; }

/* ===== SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
.skeleton-poster { aspect-ratio: 2/3; border-radius: var(--radius); }
.skeleton-text { height: 14px; margin-top: 8px; width: 80%; }
.skeleton-text-short { height: 12px; margin-top: 4px; width: 50%; }
.skeleton-card { padding: 0; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ===== PAGE HEADER ===== */
.page-header {
    max-width: 1400px; margin: 0 auto;
    padding: 120px 24px 24px;
}
.page-header-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
}
.page-header-sub {
    font-size: 1rem; color: var(--text-muted);
    margin-top: 8px;
}

/* ===== GENRE PILLS ===== */
.genre-pills {
    display: flex; gap: 8px; flex-wrap: wrap;
    padding-bottom: 8px;
}
.genre-pill {
    padding: 8px 18px; border-radius: 50px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.82rem; font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.genre-pill:hover {
    background: rgba(139,92,246,0.15);
    border-color: rgba(139,92,246,0.3);
}
.genre-pill.active {
    background: var(--gradient);
    border-color: transparent;
    color: white;
}

/* ===== DETAIL PAGE ===== */
.detail-page {
    padding-bottom: 80px;
}
.detail-hero {
    position: relative; height: 60vh; min-height: 400px;
}
.detail-hero-bg {
    position: absolute; inset: 0;
}
.detail-hero-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.detail-hero-bg::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, var(--bg) 5%, rgba(6,6,11,0.6) 50%, rgba(6,6,11,0.3) 100%);
}

/* Back button on detail page */
.detail-back {
    position: absolute; top: 80px; left: 24px; z-index: 10;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    border: 1px solid rgba(255,255,255,0.1);
}
.detail-back:hover {
    background: rgba(139,92,246,0.4);
    transform: translateX(-2px);
}

.detail-content {
    max-width: 1400px; margin: 0 auto;
    padding: 0 24px;
    display: flex; gap: 32px;
    margin-top: -120px;
    position: relative; z-index: 1;
}
.detail-poster {
    flex: 0 0 220px;
}
.detail-poster img {
    width: 100%; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.detail-info {
    flex: 1;
    padding-top: 8px;
}
.detail-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 700; line-height: 1.2;
    margin-bottom: 12px;
}
.detail-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 0.9rem; color: var(--text-muted);
    margin-bottom: 16px;
}
.detail-meta-sep { opacity: 0.3; }
.detail-rating-box {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: 6px;
    background: rgba(251,191,36,0.15);
    color: #fbbf24; font-weight: 700; font-size: 0.85rem;
}
.detail-genres {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 20px;
}
.detail-genre {
    padding: 5px 14px; border-radius: 50px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
}
.detail-overview {
    font-size: 1rem; line-height: 1.7;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 24px;
}
.detail-actions {
    display: flex; gap: 12px; flex-wrap: wrap;
    margin-bottom: 32px;
}
.detail-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.detail-fact {
    padding: 12px; border-radius: var(--radius-sm);
    background: var(--bg-card);
}
.detail-fact-label {
    font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 4px;
}
.detail-fact-value {
    font-size: 0.9rem; font-weight: 600;
}

/* Cast */
.cast-row {
    display: flex; gap: 16px;
    overflow-x: auto; padding-bottom: 8px;
}
.cast-item {
    flex: 0 0 90px; text-align: center;
}
.cast-avatar {
    width: 64px; height: 64px;
    border-radius: 50%; object-fit: cover;
    margin: 0 auto 8px;
}
.cast-name {
    font-size: 0.75rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cast-char {
    font-size: 0.65rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Season selector */
.season-selector {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.season-btn {
    padding: 8px 20px; border-radius: 50px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
    transition: all var(--transition);
}
.season-btn:hover { background: rgba(139,92,246,0.15); }
.season-btn.active {
    background: var(--gradient);
    border-color: transparent;
    color: white;
}

/* Episode list */
.episode-list {
    display: flex; flex-direction: column; gap: 10px;
}
.episode-item {
    display: flex; gap: 16px; padding: 12px;
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer;
    transition: all var(--transition);
}
.episode-item:hover { background: var(--bg-card-hover); }
.episode-item.playing { background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.25); }
.episode-still {
    flex: 0 0 160px; aspect-ratio: 16/9;
    border-radius: var(--radius-sm); overflow: hidden;
    background: rgba(255,255,255,0.03);
}
.episode-still img { width: 100%; height: 100%; object-fit: cover; }
.episode-info { flex: 1; min-width: 0; }
.episode-num {
    font-size: 0.8rem; color: var(--accent-light);
    font-weight: 600; margin-bottom: 2px;
}
.episode-name {
    font-size: 0.9rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 4px;
}
.episode-overview {
    font-size: 0.8rem; color: var(--text-muted);
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex; gap: 6px; justify-content: center;
    padding: 32px 0;
}
.page-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
    transition: all var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { background: rgba(139,92,246,0.2); }
.page-btn.active {
    background: var(--gradient);
    border-color: transparent;
    color: white; font-weight: 600;
}

/* ===== NO RESULTS ===== */
.no-results {
    text-align: center; padding: 80px 24px;
}
.no-results-icon { font-size: 4rem; margin-bottom: 16px; }
.no-results h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
}
.no-results p { color: var(--text-muted); margin-top: 8px; }

/* ===== PLAYER MODAL ===== */
.player-modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.3s;
}
.player-modal.active { opacity: 1; visibility: visible; }

.player-container {
    width: 95%; max-width: 1100px;
    max-height: 90vh;
    background: var(--bg-glass-solid);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex; flex-direction: column;
    border: 1px solid rgba(255,255,255,0.06);
}

.player-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.player-header-left {
    display: flex; align-items: center; gap: 12px;
    min-width: 0; flex: 1;
}
.player-back {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}
.player-back:hover { background: rgba(139,92,246,0.3); }
.player-title {
    font-family: var(--font-heading);
    font-size: 1rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}
.player-close:hover { background: rgba(255,255,255,0.15); }

.player-body { flex: 1; overflow-y: auto; }

.player-iframe-wrap {
    position: relative;
    width: 100%; padding-top: 56.25%;
    background: #000;
}
.player-iframe-wrap iframe {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
}

/* Player Episode Quick-Select */
.player-episodes {
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    max-height: 200px;
    overflow-y: auto;
}
.player-ep-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 10px;
}
.pe-label {
    font-size: 0.75rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
}
.player-season-select {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.player-season-btn {
    padding: 4px 14px; border-radius: 50px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.78rem;
    transition: all var(--transition);
}
.player-season-btn:hover { background: rgba(139,92,246,0.15); }
.player-season-btn.active {
    background: var(--gradient);
    border-color: transparent;
    color: white;
}
.player-ep-list {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.player-ep-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.78rem; font-weight: 500;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.player-ep-btn:hover { background: rgba(139,92,246,0.15); }
.player-ep-btn.active {
    background: var(--gradient);
    border-color: transparent;
    color: white;
    font-weight: 600;
}

.player-servers {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.server-label {
    font-size: 0.75rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 8px;
}
.server-list {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.server-btn {
    padding: 6px 16px; border-radius: 50px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.8rem;
    transition: all var(--transition);
}
.server-btn:hover { background: rgba(139,92,246,0.15); }
.server-btn.active {
    background: var(--gradient);
    border-color: transparent;
    color: white;
}

.player-info { padding: 12px 20px 20px; }
.player-info-text {
    font-size: 0.8rem; color: var(--text-muted);
    line-height: 1.5;
}

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
    position: fixed; inset: 0; z-index: 150;
    background: rgba(6,6,11,0.95);
    backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden;
    transition: all 0.3s;
}
.search-overlay.active { opacity: 1; visibility: visible; }

.search-container {
    max-width: 700px; margin: 0 auto;
    padding: 80px 24px 24px;
    height: 100vh;
    display: flex; flex-direction: column;
}
.search-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50px;
}
.search-header svg { flex-shrink: 0; color: var(--text-muted); }
.search-header input {
    flex: 1; border: none; outline: none;
    background: transparent; color: var(--text);
    font-size: 1rem;
}
.search-header input::placeholder { color: var(--text-muted); }
.search-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.search-results {
    flex: 1; overflow-y: auto;
    margin-top: 16px;
}
.search-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 200px; color: var(--text-muted);
}
.search-result-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px; border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.search-result-item:hover { background: rgba(255,255,255,0.05); }
.search-result-poster {
    width: 48px; height: 72px;
    border-radius: var(--radius-sm); object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-info h4 {
    font-size: 0.95rem; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-result-info p {
    font-size: 0.8rem; color: var(--text-muted);
}
.search-result-type {
    padding: 4px 10px; border-radius: 50px;
    background: rgba(139,92,246,0.15);
    font-size: 0.7rem; font-weight: 600;
    color: var(--accent-light);
    flex-shrink: 0;
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 90;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 8px 0 calc(8px + var(--safe-bottom));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu.active { transform: translateY(0); }
.mobile-menu-inner {
    display: flex; justify-content: space-around;
    max-width: 600px; margin: 0 auto;
}
.mobile-link {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    padding: 8px 12px;
    font-size: 0.65rem; font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
}
.mobile-link:hover { color: var(--text); }
.mobile-link svg { color: inherit; }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 100px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 24px; border-radius: 50px;
    background: rgba(139,92,246,0.9);
    backdrop-filter: blur(10px);
    font-size: 0.85rem; font-weight: 500;
    opacity: 0; visibility: hidden;
    transition: all 0.3s;
    z-index: 300;
    pointer-events: none;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed; bottom: 24px; right: 24px;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(139,92,246,0.3);
    opacity: 0; visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition);
    z-index: 50;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }

/* ===== FOOTER ===== */
.footer {
    margin-top: 60px;
    padding: 40px 24px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-inner {
    max-width: 1400px; margin: 0 auto;
    text-align: center;
}
.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem; font-weight: 700;
    margin-bottom: 12px;
}
.footer-brand span { background: var(--gradient-h); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.footer-text {
    font-size: 0.85rem; color: var(--text-muted);
    max-width: 500px; margin: 0 auto 16px;
}
.footer-links {
    display: flex; gap: 24px; justify-content: center;
}
.footer-links a {
    font-size: 0.85rem; color: var(--text-muted);
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent-light); }

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered fade for sections */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }

    .hero { min-height: 60vh; padding: 100px 20px 40px; }
    .hero-title { font-size: 1.8rem; }
    .hero-overview { font-size: 0.9rem; -webkit-line-clamp: 2; }

    .detail-content { flex-direction: column; gap: 20px; margin-top: -80px; }
    .detail-poster { flex: none; max-width: 200px; }
    .detail-back { top: 70px; left: 16px; }

    .card { flex: 0 0 130px; }
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }

    .episode-item { flex-direction: column; }
    .episode-still { flex: none; width: 100%; }

    .player-container { width: 100%; max-width: none; max-height: 100vh; border-radius: 0; height: 100vh; }
}

@media (max-width: 480px) {
    .nav-inner { padding: 12px 16px; }
    .section { padding: 0 16px; }
    .hero { padding: 80px 16px 32px; }
    .hero-content { padding: 0; }
    .page-header { padding: 100px 16px 16px; }

    .btn { padding: 10px 20px; font-size: 0.85rem; }

    .card { flex: 0 0 110px; }
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

    .detail-poster { max-width: 160px; }
    .detail-title { font-size: 1.3rem; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
