:root {
    --bg: #050508;
    --bg-card: #12121a;
    --bg-elevated: #1c1c28;
    --text: #f4f4f5;
    --text-muted: #9ca3af;
    --primary: #e50914;
    --primary-hover: #f40612;
    --accent: #f5c518;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 14px;
    --shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --navbar-bg: rgba(5, 5, 8, 0.92);
    --footer-bg: rgba(8, 8, 14, 0.75);
    --hero-overlay: linear-gradient(to top, #050508 0%, rgba(5,5,8,0.75) 45%, rgba(5,5,8,0.25) 100%);
    --nav-height: 68px;
    --glow: rgba(229, 9, 20, 0.35);
    --modal-backdrop: rgba(0, 0, 0, 0.8);
    --chip-hover: rgba(229, 9, 20, 0.12);
}

[data-theme="light"] {
    --bg: #f4f6fa;
    --bg-card: #ffffff;
    --bg-elevated: #eef1f6;
    --text: #111827;
    --text-muted: #6b7280;
    --border: rgba(17, 24, 39, 0.1);
    --shadow: 0 20px 40px -12px rgba(17, 24, 39, 0.12);
    --navbar-bg: rgba(255, 255, 255, 0.94);
    --footer-bg: #ffffff;
    --hero-overlay: linear-gradient(to top, #f4f6fa 0%, rgba(244,246,250,0.88) 45%, rgba(244,246,250,0.55) 100%);
    --glow: rgba(229, 9, 20, 0.2);
    --modal-backdrop: rgba(17, 24, 39, 0.45);
    --chip-hover: rgba(229, 9, 20, 0.08);
}

[data-theme="light"] .btn-light { background: var(--primary); color: white; }
[data-theme="light"] .btn-outline { color: var(--text); border-color: var(--border); background: rgba(255,255,255,0.6); }
[data-theme="light"] .bg-glow { opacity: 0.2; }
[data-theme="light"] .hero-overlay { background: var(--hero-overlay); }
[data-theme="light"] .hero-bg,
[data-theme="light"] #hero-bg {
    filter: saturate(0.95) brightness(1.05);
}
[data-theme="light"] #hero-bg {
    background-blend-mode: normal;
}
[data-theme="light"] .modal-domain-hint { background: rgba(245,197,24,0.12); color: #92400e; }
[data-theme="light"] .modal-domain-hint code { background: rgba(0,0,0,0.06); }
[data-theme="light"] .admin-table tr:hover td { background: rgba(0,0,0,0.03); }
[data-theme="light"] .social-btn:hover { background: var(--bg-elevated); }
[data-theme="light"] .movie-card:hover { box-shadow: 0 12px 32px rgba(229, 9, 20, 0.12); }

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}
.bg-glow-1 { width: 560px; height: 560px; background: rgba(229, 9, 20, 0.12); top: -120px; right: -80px; }
.bg-glow-2 { width: 420px; height: 420px; background: rgba(245, 197, 24, 0.08); bottom: 10%; left: -80px; }

/* Navbar */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: var(--navbar-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.navbar-inner,
.navbar-top {
    display: flex; align-items: center; justify-content: space-between;
    height: 68px; gap: 0.75rem;
}
.nav-search-wrap {
    flex: 1; max-width: 420px; min-width: 0;
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.35rem 0.75rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-search-wrap:focus-within {
    border-color: rgba(229, 9, 20, 0.45);
    box-shadow: 0 0 0 3px var(--chip-hover);
}
.nav-search-icon { opacity: 0.55; font-size: 0.95rem; flex-shrink: 0; }
.nav-search-input {
    flex: 1; min-width: 0; border: none; background: transparent;
    color: var(--text); font-size: 0.9rem; font-family: inherit;
    outline: none;
}
.nav-search-input::placeholder { color: var(--text-muted); }
.nav-search-advanced {
    background: var(--bg-elevated); border: none; color: var(--text-muted);
    width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
    font-size: 0.85rem; flex-shrink: 0;
}
.nav-search-advanced:hover { color: var(--primary); }
.logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.logo-icon {
    width: 40px; height: 40px; border-radius: 11px;
    background: linear-gradient(135deg, var(--primary), #b20710);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.8rem; letter-spacing: -0.03em;
    box-shadow: 0 4px 16px var(--glow);
}
.logo-text { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.03em; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color var(--transition); }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

@keyframes cardIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE — mobile / tablet / desktop
   ============================================================ */

.hide-xs { display: inline; }
.nav-toggle { display: none; }
.mobile-search { display: none; }
.search-wrap-mobile { width: 100%; display: flex; }
.icon-btn { min-width: 40px; padding: 0.45rem 0.65rem; }

/* Mobile drawer */
.mobile-drawer {
    position: fixed; inset: 0; z-index: 250;
    pointer-events: none; visibility: hidden;
    transition: visibility 0.3s;
}
.mobile-drawer.open { pointer-events: auto; visibility: visible; }
.mobile-drawer-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0; transition: opacity 0.3s;
}
.mobile-drawer.open .mobile-drawer-backdrop { opacity: 1; }
.mobile-drawer-panel {
    position: absolute; top: 0; left: 0; bottom: 0; width: min(85vw, 320px);
    background: var(--bg-card); border-right: 1px solid var(--border);
    padding: 1.5rem; transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}
.mobile-drawer.open .mobile-drawer-panel { transform: translateX(0); }
.mobile-drawer-close {
    background: var(--bg-elevated); border: none; color: var(--text);
    width: 40px; height: 40px; border-radius: 10px; font-size: 1.2rem;
    cursor: pointer; margin-bottom: 1.5rem;
}
.mobile-nav-links { display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-nav-links a {
    display: block; padding: 0.85rem 1rem; color: var(--text);
    text-decoration: none; font-weight: 500; border-radius: 10px;
    transition: background 0.2s;
}
.mobile-nav-links a:hover { background: var(--bg-elevated); }

@media (max-width: 767px) {
    :root { --nav-height: 64px; }
    .container { padding: 0 1rem; }

    .hide-xs { display: none; }
    .nav-toggle {
        display: flex; align-items: center; justify-content: center;
        background: var(--bg-card); border: 1px solid var(--border);
        color: var(--text); width: 40px; height: 40px; border-radius: 10px;
        font-size: 1.25rem; cursor: pointer; flex-shrink: 0;
    }

    .navbar-top {
        height: auto; min-height: 56px;
        padding: 0.5rem 0; flex-wrap: nowrap; gap: 0.5rem;
    }

    .nav-search-wrap {
        order: 0; flex: 1; max-width: none;
        padding: 0.45rem 0.65rem;
    }
    .nav-search-input { font-size: 16px; }

    .logo { flex-shrink: 0; }
    .nav-actions {
        gap: 0.35rem; flex-shrink: 0;
    }

    .nav-actions .btn-sm {
        padding: 0.4rem 0.75rem; font-size: 0.8rem;
    }

    .user-chip {
        font-size: 0.75rem; padding: 0.25rem 0.5rem;
    }
    .user-chip span { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .hero {
        min-height: 50vh;
        padding-bottom: 2rem;
    }
    .hero-content { padding-top: 0.5rem; }
    .hero-title { font-size: clamp(1.75rem, 8vw, 2.5rem); }
    .hero-desc { font-size: 0.95rem; margin-bottom: 1.25rem; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; text-align: center; }

    .main-content { padding: 1.5rem 0 3rem; }

    .filter-bar {
        flex-wrap: nowrap; overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; margin-bottom: 1.25rem;
        padding-bottom: 0.25rem;
    }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter-chip { flex-shrink: 0; padding: 0.45rem 0.85rem; font-size: 0.8rem; }

    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .card-body { padding: 0.75rem; }
    .card-title { font-size: 0.85rem; }
    .card-meta { font-size: 0.7rem; }
    .card-badge { font-size: 0.6rem; padding: 0.2rem 0.45rem; }

    .movie-card:hover { transform: none; }
    .card-play { opacity: 1; background: rgba(0,0,0,0.25); }
    .card-play svg { width: 36px; height: 36px; }

    .section-title { font-size: 1.25rem; margin-bottom: 1rem; }

    /* Watch page mobile */
    .watch-page { padding: 1rem 0 2rem; }
    .player-meta h1 { font-size: 1.25rem; }
    .player-wrap video { max-height: 50vh; }
    .sidebar-block { padding: 1rem; }
    .chip { padding: 0.5rem 0.75rem; min-height: 44px; }

    /* Footer mobile */
    .site-footer { padding: 2.5rem 0 1.5rem; }
    .footer-grid { gap: 1.5rem; }
    .footer-social { gap: 0.5rem; }
    .social-btn { width: 40px; height: 40px; }

    /* Legal */
    .legal-page { padding: 5rem 0 2rem; }
    .legal-page h1 { font-size: 1.5rem; }
    .pricing-cards { grid-template-columns: 1fr; }

    /* Admin mobile */
    .admin-page { padding: 5rem 0 2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-table { font-size: 0.75rem; }
    .admin-table th, .admin-table td { padding: 0.5rem; }
    .content-item { flex-direction: column; gap: 0.25rem; align-items: flex-start; }

    /* Modal */
    .modal-card { padding: 1.5rem; margin: 0.5rem; max-height: 90vh; overflow-y: auto; }

    .bg-glow-1 { width: 250px; height: 250px; }
    .bg-glow-2 { width: 200px; height: 200px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .catalog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .hero { min-height: 65vh; }
}

@media (min-width: 768px) {
    .search-wrap {
        position: relative; display: flex;
    }
    .search-wrap input {
        background: var(--bg-card); border: 1px solid var(--border);
        border-radius: 999px; padding: 0.5rem 2.2rem 0.5rem 1rem;
        color: var(--text); font-size: 0.85rem; width: 200px;
        transition: border-color var(--transition), width var(--transition);
    }
    .search-wrap input:focus { outline: none; border-color: var(--primary); width: 260px; }
    .search-wrap svg {
        position: absolute; right: 0.75rem; top: 50%;
        transform: translateY(-50%); color: var(--text-muted); pointer-events: none;
    }
}

@media (min-width: 1024px) {
    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* Touch devices — hover effektlarini yumshatish */
@media (hover: none) {
    .movie-card:active { transform: scale(0.98); }
    .btn:active { transform: scale(0.97); }
}

/* Safe area (iPhone notch) */
@supports (padding: env(safe-area-inset-top)) {
    .navbar { padding-top: env(safe-area-inset-top); }
    body { padding-bottom: env(safe-area-inset-bottom); }
}


/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: none; border-radius: 999px; font-weight: 600; cursor: pointer;
    transition: all var(--transition); text-decoration: none; font-family: inherit;
}
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 16px var(--glow); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 24px var(--glow); }
.btn-light { background: white; color: #111; font-weight: 700; }
.btn-light:hover { background: #eee; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.3); }
.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.05); }
.btn-ghost { background: var(--bg-elevated); color: var(--text); }

.user-chip {
    display: flex; align-items: center; gap: 0.5rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 999px; padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    font-size: 0.85rem;
}
.user-chip img { width: 28px; height: 28px; border-radius: 50%; }

/* Hero */
.hero {
    position: relative; min-height: 82vh; margin-top: var(--nav-height);
    display: flex; align-items: flex-end; padding-bottom: 4rem;
}
.hero-bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center top;
    transition: background-image 1.2s ease;
    filter: saturate(1.15);
}
.hero-overlay {
    position: absolute; inset: 0;
    background: var(--hero-overlay);
}
.hero-content { position: relative; z-index: 2; padding-top: 6rem; animation: fadeUp 0.8s ease; max-width: 680px; }
.hero-badge {
    display: inline-block; background: var(--accent); color: #111;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em;
    padding: 0.4rem 0.9rem; border-radius: 6px; margin-bottom: 1.25rem;
}
.hero-title {
    font-size: clamp(2.25rem, 5.5vw, 3.75rem); font-weight: 800;
    line-height: 1.08; letter-spacing: -0.04em; margin-bottom: 1rem;
    text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.hero-desc { font-size: 1.05rem; color: var(--text-muted); max-width: 520px; margin-bottom: 1.75rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* Catalog */
.main-content { padding: 3rem 0 4rem; position: relative; z-index: 1; }
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem;
    overflow-x: auto; padding-bottom: 0.5rem;
}
.filter-chip {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); padding: 0.55rem 1.1rem; border-radius: 999px;
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
    transition: all var(--transition); white-space: nowrap;
}
.filter-chip:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }
.filter-chip.active {
    background: var(--primary); border-color: var(--primary); color: white;
    box-shadow: 0 4px 20px var(--glow);
}
.section-title {
    font-size: 1.35rem; font-weight: 800; margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 1rem;
}

.movie-card {
    position: relative; border-radius: var(--radius); overflow: hidden;
    background: var(--bg-card); border: 1px solid var(--border);
    cursor: pointer; text-decoration: none; color: inherit;
    transform: translateY(16px); opacity: 0;
    animation: cardIn 0.55s ease forwards;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.movie-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 16px 40px rgba(229, 9, 20, 0.2);
    border-color: rgba(229, 9, 20, 0.45);
}
.movie-card:nth-child(1) { animation-delay: 0.05s; }
.movie-card:nth-child(2) { animation-delay: 0.1s; }
.movie-card:nth-child(3) { animation-delay: 0.15s; }
.movie-card:nth-child(4) { animation-delay: 0.2s; }
.movie-card:nth-child(5) { animation-delay: 0.25s; }
.movie-card:nth-child(n+6) { animation-delay: 0.3s; }

.card-poster {
    aspect-ratio: 2/3; position: relative; overflow: hidden;
}
.card-poster-inner {
    width: 100%; height: 100%;
    display: flex; align-items: flex-end; padding: 0.85rem;
    transition: transform 0.6s ease;
    position: relative;
}
.card-poster-inner::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 55%);
}
.movie-card:hover .card-poster-inner { transform: scale(1.06); }
.card-play {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.4); opacity: 0; transition: opacity var(--transition);
}
.movie-card:hover .card-play { opacity: 1; }
.card-play svg { width: 48px; height: 48px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }
.card-body { padding: 0.85rem 0.75rem 1rem; }
.card-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.2rem; line-height: 1.35; letter-spacing: -0.01em; }
.card-meta { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }
.card-badge {
    position: absolute; top: 0.65rem; left: 0.65rem; z-index: 1;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
    padding: 0.22rem 0.55rem; border-radius: 5px; font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.04em;
}

/* Watch page */
.page-watch .navbar { position: sticky; top: 0; }
.page-watch .mobile-search { display: none; }
.watch-page { padding: 1rem 0 4rem; position: relative; z-index: 1; }
.watch-layout { display: grid; gap: 2rem; }
@media (min-width: 1024px) {
    .watch-layout { grid-template-columns: 1fr 320px; }
}
.player-wrap {
    border-radius: var(--radius); overflow: hidden;
    background: #0a0a0a url('/static/img/playerbanner.jpg') center / cover no-repeat;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: relative;
}
.player-wrap video { width: 100%; display: block; max-height: 70vh; background: transparent; }
.plyr--video { border-radius: var(--radius); }
.player-meta { margin-top: 1.25rem; }
.player-meta h1 { font-size: 1.75rem; font-weight: 800; }
.player-meta p { color: var(--text-muted); margin-top: 0.35rem; }
.watch-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
}
.sidebar-block h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.75rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
    background: var(--bg-elevated); border: 1px solid var(--border);
    padding: 0.45rem 0.9rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
}
.chip:hover:not(.locked) { border-color: var(--primary); color: var(--text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: white; }
.chip.locked { opacity: 0.45; cursor: not-allowed; }

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 0.4rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.episode-grid::-webkit-scrollbar { width: 4px; }
.episode-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.ep-btn {
    aspect-ratio: 1; min-height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 8px; font-size: 0.78rem; font-weight: 700;
    cursor: pointer; transition: all var(--transition); color: var(--text-muted);
}
.ep-btn.available { color: var(--text); }
.ep-btn.available:hover { border-color: var(--primary); background: var(--chip-hover); }
.ep-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.ep-btn.locked { opacity: 0.35; cursor: not-allowed; font-size: 0.72rem; }

.sidebar-hint { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.modal-domain-hint {
    font-size: 0.78rem; color: var(--accent); background: rgba(245,197,24,0.08);
    border: 1px solid rgba(245,197,24,0.2); border-radius: 10px;
    padding: 0.75rem 1rem; margin: 1rem 0 0; line-height: 1.5;
}
.modal-domain-hint code { background: rgba(0,0,0,0.3); padding: 0.1rem 0.35rem; border-radius: 4px; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem; margin-top: 2rem;
    position: relative; z-index: 1;
    background: var(--footer-bg);
}
.footer-grid {
    display: grid; gap: 2rem;
    grid-template-columns: 1fr;
    margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-desc { color: var(--text-muted); font-size: 0.9rem; margin: 1rem 0; max-width: 320px; }
.footer-domain { color: var(--primary); font-weight: 600; font-size: 0.85rem; }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 0.5rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--text); }
.footer-social { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-bottom: 2rem; }
.social-btn {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--bg-card); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: all var(--transition);
}
.social-btn svg { width: 20px; height: 20px; }
.social-btn:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-3px); }
.footer-bottom { text-align: center; color: var(--text-muted); font-size: 0.8rem; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: var(--modal-backdrop); backdrop-filter: blur(4px); }
.modal-card {
    position: relative; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem; max-width: 400px; width: 100%;
    box-shadow: var(--shadow); animation: fadeUp 0.3s ease;
}
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.modal-sub { color: var(--text-muted); margin: 0.5rem 0 1.5rem; font-size: 0.9rem; }
.modal-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 1rem; text-align: center; }
.login-widget-wrap { display: flex; justify-content: center; min-height: 44px; }

/* Legal */
.legal-page { padding: calc(var(--nav-height) + 2rem) 0 4rem; max-width: 800px; position: relative; z-index: 1; }
.legal-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.legal-updated { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; }
.legal-page section { margin-bottom: 2rem; }
.legal-page h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text); }
.legal-page p, .legal-page li { color: var(--text-muted); margin-bottom: 0.75rem; }
.legal-page a { color: var(--primary); }
.legal-page ul { padding-left: 1.25rem; }

.pricing-cards { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; margin: 1rem 0; }
.pricing-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.pricing-card.featured { border-color: var(--primary); }
.pricing-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.pricing-card .price { color: var(--primary); font-weight: 700; margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }

/* Admin */
.admin-page { padding: calc(var(--nav-height) + 2rem) 0 4rem; position: relative; z-index: 1; }
.admin-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.badge { background: var(--primary); padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-card .value { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.admin-section { margin-bottom: 2.5rem; }
.admin-section h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th, .admin-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { background: var(--bg-card); color: var(--text-muted); font-weight: 600; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.content-list { display: grid; gap: 0.5rem; }
.content-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 0.85rem 1rem; font-size: 0.85rem; display: flex; justify-content: space-between; }
.admin-denied { text-align: center; padding: 4rem 0; }
.admin-denied-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin: 1.25rem 0; }
.admin-denied-hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 1rem; }
.auth-webadmin { margin: 0.75rem auto 0; display: inline-flex; }
.profile-tariff { margin: 1.25rem 0; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.profile-tariff h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.tariff-plans { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.tariff-plan-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.tariff-plan-btn small { opacity: 0.85; font-weight: 600; }
.admin-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-tab {
    padding: 0.55rem 1.1rem; border-radius: var(--radius-pill);
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text-muted); cursor: pointer; font-weight: 600; font-family: inherit;
}
.admin-tab.active { background: var(--gradient); color: #fff; border-color: transparent; }
.admin-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
}
.admin-card h2 { font-size: 1rem; margin-bottom: 1rem; }
.admin-form { display: flex; flex-direction: column; gap: 0.75rem; }
.admin-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--text-muted); }
.admin-form input, .admin-form select, .admin-form textarea {
    padding: 0.6rem 0.75rem; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text);
    font-family: inherit; font-size: 0.9rem;
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin: -0.25rem 0 0.5rem; }
.upload-status { margin-top: 0.75rem; font-size: 0.88rem; padding: 0.65rem; border-radius: 8px; }
.upload-status.ok { background: rgba(76,175,80,0.15); color: #8bc34a; }
.upload-status.err { background: rgba(244,67,54,0.15); color: #ef5350; }
.content-item { align-items: center; }
.content-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }
.hidden { display: none !important; }
.empty-state, .loading-state { text-align: center; padding: 3rem; color: var(--text-muted); }
@media (max-width: 767px) {
    .hide-mobile-footer { display: none; }
}
body.drawer-open,
body.search-open { overflow: hidden; }

/* Bottom navigation (mobile) */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 120;
    display: flex; justify-content: space-around; align-items: center;
    background: var(--navbar-bg); border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
    height: calc(56px + env(safe-area-inset-bottom));
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    background: transparent; border: none; color: var(--text-muted);
    text-decoration: none; font-size: 0.65rem; cursor: pointer; padding: 0.35rem 0.5rem;
    font-family: inherit; -webkit-appearance: none; appearance: none;
    flex: 1; min-width: 0; max-width: 25%;
}
button.bottom-nav-item { color: var(--text-muted); }
.bottom-nav-item:hover, .bottom-nav-item:active { color: var(--primary); }
.bottom-nav-item small { color: inherit; font-size: 0.65rem; }
.bottom-nav-item span { font-size: 1.15rem; line-height: 1; }
.bottom-nav-item.active { color: var(--primary); }

/* Drawer tools */
.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.drawer-close-btn {
    width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-elevated); color: var(--text); font-size: 1.4rem; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.drawer-tool-btn {
    width: 100%; padding: 0.65rem; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--text); cursor: pointer; text-align: left; font-weight: 600;
    font-family: inherit; margin-bottom: 0.75rem;
}
.drawer-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.drawer-select {
    width: 100%; padding: 0.65rem; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
}
.drawer-auth { margin: 0.75rem 0; }
.drawer-profile-link { color: var(--text); text-decoration: none; font-weight: 700; }
.drawer-profile-link:hover { color: var(--primary); }
.drawer-divider { border: none; border-top: 1px solid var(--border); margin: 0.75rem 0; }
.nav-toggle {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); width: 40px; height: 40px; border-radius: 10px;
    font-size: 1.25rem; cursor: pointer; margin-left: auto;
}

/* Search overlay */
.search-overlay {
    position: fixed; inset: 0; z-index: 300;
    display: flex; flex-direction: column;
}
.search-overlay.hidden { display: none; }
.search-overlay-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.85);
}
.search-overlay-panel {
    position: relative; z-index: 1;
    margin-top: calc(var(--nav-height) + env(safe-area-inset-top));
    max-height: calc(100vh - var(--nav-height) - env(safe-area-inset-top));
    overflow-y: auto;
    padding: 0.75rem 1rem 1.25rem;
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.search-results-body { margin-top: 0.85rem; }
.search-hint, .search-empty {
    text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 0.75rem 0;
}
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.65rem;
}
.search-section { margin-top: 1rem; }
.search-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.5rem;
}
.search-section-head h3 { font-size: 0.9rem; font-weight: 700; margin: 0; }
.search-see-all {
    font-size: 0.78rem; color: var(--primary); text-decoration: none; font-weight: 600;
}
.search-bar-row {
    display: flex; align-items: center; gap: 0.65rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 0.5rem 0.65rem;
}
.search-bar-row svg { width: 20px; height: 20px; color: var(--text-muted); flex-shrink: 0; }
.search-bar-row input {
    flex: 1; border: none; background: transparent; color: var(--text);
    font-size: 16px; outline: none; font-family: inherit; min-width: 0;
}
.search-close-btn {
    flex-shrink: 0; width: 36px; height: 36px; border: none; border-radius: 8px;
    background: transparent; color: var(--text-muted); font-size: 1.5rem;
    cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.search-close-btn:hover { color: var(--primary); background: var(--bg-elevated); }
.search-filters {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
    margin-top: 0.75rem;
}
.search-filters select,
.search-filters input {
    width: 100%; padding: 0.55rem 0.65rem; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
    font-family: inherit; font-size: 0.85rem;
}
@media (max-width: 480px) {
    .search-filters { grid-template-columns: 1fr 1fr; }
    .search-filters input { grid-column: span 2; }
}

body.drawer-open,
body.search-open { overflow: hidden; }

.login-widget-wrap { min-height: 48px; display: flex; justify-content: center; margin: 1rem 0; }
.auth-webadmin { display: block; text-align: center; margin-top: 0.75rem; }

/* Player loading brand */
.player-loading {
    position: absolute; inset: 0; z-index: 5;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    padding-bottom: 12%;
    background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.72) 100%);
    transition: opacity 0.35s;
}
.player-loading.hidden { opacity: 0; pointer-events: none; }
.player-loading img { width: 100px; margin-bottom: 0.85rem; opacity: 0.95; }
.player-poster {
    position: absolute; inset: 0; z-index: 1;
    background: url('/static/img/playerbanner.jpg') center / cover no-repeat;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.player-poster.hidden { opacity: 0; }
.loader-progress {
    width: min(240px, 72vw); height: 4px;
    background: rgba(255,255,255,0.12); border-radius: 99px; overflow: hidden;
}
.loader-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--primary), #ff6b9d);
    border-radius: 99px;
    transition: width 0.25s ease;
}
.player-loading.indeterminate .loader-progress-fill {
    width: 38% !important;
    animation: loadSlide 1.1s ease-in-out infinite;
}
.player-load-pct {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.55rem 0 0;
    min-height: 1.2em;
}
.player-loading .loader-bar {
    width: 160px; height: 3px; background: rgba(255,255,255,0.15); border-radius: 99px; overflow: hidden;
}
.player-loading .loader-bar::after {
    content: ''; display: block; height: 100%; width: 40%; background: var(--primary);
    animation: loadSlide 1.2s ease infinite;
}
@keyframes loadSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}
.watch-detail { margin-top: 1.5rem; padding: 1.25rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.watch-detail h3 { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.5rem; }
.watch-detail p { color: var(--text-muted); line-height: 1.7; font-size: 0.9rem; }
.auth-alt { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.auth-alt-label { text-align: center; color: var(--text-muted); font-size: 0.8rem; }
.auth-oauth { width: 100%; }
.auth-oauth:disabled { opacity: 0.5; }
.auth-code-input {
    width: 100%; max-width: 200px; margin: 0.75rem auto;
    display: block; text-align: center; font-size: 1.4rem; letter-spacing: 0.35em;
    padding: 0.65rem; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
}
.auth-bot-link {
    display: inline-block; width: 100%; max-width: 280px;
    text-align: center; text-decoration: none; margin: 0.5rem 0;
}
.auth-url-copy {
    width: 100%; font-size: 0.75rem; padding: 0.45rem 0.6rem;
    border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-elevated); color: var(--text-muted);
    margin: 0.35rem 0 0.5rem;
}
.auth-link-fallback { font-size: 0.72rem !important; opacity: 0.75; }
.player-ad {
    position: absolute; inset: 0; z-index: 6;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.95);
}
.player-ad.hidden { display: none; }
.player-ad-inner { width: 100%; height: 100%; position: relative; }
.player-ad iframe { width: 100%; height: 100%; border: 0; }
#player-ad-skip { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2; }
.privacy-toggles { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; text-align: left; }
.privacy-toggle {
    display: flex; justify-content: space-between; width: 100%;
    padding: 0.65rem 1rem; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
    cursor: pointer; font-size: 0.85rem;
}
.privacy-toggle.on { border-color: var(--primary); }
.profile-privacy { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.profile-privacy h2 { font-size: 1rem; margin-bottom: 0.25rem; }
.profile-page { padding: calc(var(--nav-height) + 1.5rem) 0 5rem; }
.profile-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem; text-align: center; max-width: 420px; margin: 0 auto;
}
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; border: 3px solid var(--primary); }
.profile-meta { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.5rem; }

@media (min-width: 768px) {
    .nav-toggle { display: flex; }
    .hide-mobile-tools { display: none; }
}

.lang-switcher select {
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); border-radius: 8px; padding: 0.35rem 0.5rem;
    font-size: 0.8rem; cursor: pointer;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes cardIn {
    to { opacity: 1; transform: translateY(0); }
}
