/* ============================================
   HESPOIRE — Premium Streaming UI
   ============================================ */

:root {
    --bg: #06060c;
    --bg-alt: #0b0b16;
    --surface: #10101f;
    --surface-hover: #161630;
    --accent: #c9a84c;
    --accent-hover: #dbb960;
    --accent-dim: rgba(201, 168, 76, 0.12);
    --accent-glow: rgba(201, 168, 76, 0.25);
    --text: #eaeaf2;
    --text-sec: #8585a5;
    --text-muted: #4a4a68;
    --border: rgba(255, 255, 255, 0.06);
    --glass: rgba(8, 8, 16, 0.88);
    --overlay: rgba(0, 0, 0, 0.7);
    --nav-h: 64px;
    --side-pad: 4.5%;
    --radius: 8px;
    --radius-lg: 14px;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

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

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-h);
    transition: background 0.35s, box-shadow 0.35s, backdrop-filter 0.35s;
}

.navbar.scrolled {
    background: var(--glass);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--side-pad);
    max-width: 1600px;
    margin: 0 auto;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--accent);
    transition: opacity 0.2s;
}
.logo:hover { opacity: 0.85; }

.nav-left { display: flex; align-items: center; gap: 36px; }

.nav-links { display: flex; gap: 6px; }

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-sec);
    padding: 6px 14px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--text); background: rgba(255,255,255,0.07); }

.nav-right { display: flex; align-items: center; }

/* Search */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--text-sec);
    transition: color 0.2s, background 0.2s;
}
.search-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.search-input {
    width: 0;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: width 0.35s var(--ease), padding 0.35s var(--ease), background 0.35s;
    border-radius: 8px;
}

.search-wrapper.open .search-input {
    width: 260px;
    padding: 9px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
}
.search-input::placeholder { color: var(--text-muted); }

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: none;
    z-index: 200;
}
.search-dropdown.visible { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}
.search-result-item:hover { background: rgba(255,255,255,0.04); }

.search-result-poster {
    width: 44px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-hover);
}
.search-result-poster img { width: 100%; height: 100%; object-fit: cover; }

.search-result-info h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.search-result-info span { font-size: 0.78rem; color: var(--text-sec); }

.search-result-type {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.search-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Mobile Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}
.mobile-nav-item.active { color: var(--accent); }

/* ============================================
   HERO
   ============================================ */

.hero {
    position: relative;
    width: 100%;
    min-height: 80vh;
    display: flex;
    align-items: flex-end;
    padding: calc(var(--nav-h) + 40px) var(--side-pad) 60px;
    background-size: cover;
    background-position: center 20%;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg,
        var(--bg) 0%,
        rgba(6,6,12,0.85) 30%,
        rgba(6,6,12,0.4) 60%,
        rgba(6,6,12,0.6) 100%
    );
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(6,6,12,0.7) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 580px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 14px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--text-sec);
    flex-wrap: wrap;
}

.hero-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-weight: 700;
}

.hero-dot { color: var(--text-muted); }

.hero-desc {
    font-size: 0.95rem;
    color: var(--text-sec);
    line-height: 1.65;
    margin-bottom: 28px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.25s var(--ease);
}

.btn-primary {
    background: var(--accent);
    color: #0a0a0f;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.2);
}

/* ============================================
   CONTENT ROWS
   ============================================ */

.section { padding: 0 var(--side-pad); margin-bottom: 48px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.section-more {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}
.section-more:hover { color: var(--accent); }

.row-container { position: relative; }

.row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.row::-webkit-scrollbar { display: none; }

.row-arrow {
    position: absolute;
    top: 0;
    bottom: 4px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    color: white;
}
.row-container:hover .row-arrow { opacity: 1; }
.row-arrow.left { left: -4px; background: linear-gradient(90deg, var(--bg) 30%, transparent); }
.row-arrow.right { right: -4px; background: linear-gradient(-90deg, var(--bg) 30%, transparent); }
.row-arrow svg { filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); }

/* ============================================
   CARDS
   ============================================ */

.card {
    flex-shrink: 0;
    width: 180px;
    scroll-snap-align: start;
    cursor: pointer;
    position: relative;
}

.card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:hover .card-poster {
    transform: scale(1.04);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,168,76,0.15);
}

.card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s;
}

.card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    color: rgba(255,255,255,0.7);
}

.card-quality {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    color: var(--accent);
    border: 1px solid rgba(201,168,76,0.3);
}

.card-hover-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.card:hover .card-hover-overlay { opacity: 1; }

.card-hover-title {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-hover-meta {
    font-size: 0.72rem;
    color: var(--text-sec);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-hover-rating { color: var(--accent); font-weight: 600; }

.card-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.card:hover .card-play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.card-play-icon svg { margin-left: 2px; }

/* ============================================
   GRID VIEW (Movies / Series / Search pages)
   ============================================ */

.page-section {
    padding: calc(var(--nav-h) + 32px) var(--side-pad) 60px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-sec);
    margin-bottom: 28px;
}

.genre-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 28px;
    padding-bottom: 4px;
}
.genre-bar::-webkit-scrollbar { display: none; }

.genre-pill {
    flex-shrink: 0;
    padding: 7px 18px;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-sec);
    transition: all 0.2s;
}
.genre-pill:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.genre-pill.active {
    background: var(--accent-dim);
    border-color: rgba(201,168,76,0.3);
    color: var(--accent);
}

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

.grid .card { width: 100%; }

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.btn-load-more {
    padding: 12px 40px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text-sec);
    transition: all 0.2s;
}
.btn-load-more:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

/* Search Page (mobile) */
.search-page-input-wrap {
    position: relative;
    margin-bottom: 24px;
}
.search-page-input {
    width: 100%;
    padding: 14px 18px 14px 46px;
    font-size: 1rem;
    font-family: var(--font);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}
.search-page-input:focus { border-color: var(--accent); }
.search-page-input::placeholder { color: var(--text-muted); }
.search-page-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ============================================
   DETAIL MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-sheet {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-alt);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease);
}
.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}
.modal-close:hover { background: rgba(0,0,0,0.7); }

.detail-backdrop {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: var(--surface);
}
.detail-backdrop::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(0deg, var(--bg-alt), transparent);
}

.detail-body { padding: 0 28px 36px; margin-top: -60px; position: relative; z-index: 2; }

.detail-top { display: flex; gap: 20px; margin-bottom: 20px; }

.detail-poster-wrap {
    width: 120px;
    flex-shrink: 0;
}
.detail-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { flex: 1; min-width: 0; padding-top: 10px; }

.detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-sec);
    margin-bottom: 12px;
}

.detail-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-weight: 700;
}

.detail-genres {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.detail-genre-tag {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    color: var(--text-sec);
}

.detail-actions { display: flex; gap: 10px; margin-bottom: 24px; }

.detail-desc {
    font-size: 0.9rem;
    color: var(--text-sec);
    line-height: 1.7;
    margin-bottom: 24px;
}

.detail-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.detail-cast-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.detail-cast-row::-webkit-scrollbar { display: none; }

.cast-item { flex-shrink: 0; text-align: center; width: 70px; }
.cast-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface);
    margin: 0 auto 6px;
    overflow: hidden;
}
.cast-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cast-name { font-size: 0.7rem; color: var(--text-sec); line-height: 1.3; }

/* ============================================
   PLAYER OVERLAY
   ============================================ */

.player-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.player-overlay.active { opacity: 1; visibility: visible; }

.player-top-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(0,0,0,0.6);
    flex-shrink: 0;
}

.player-title { flex: 1; }

.player-fs-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    transition: color 0.2s, background 0.2s;
}
.player-fs-btn:hover { color: white; background: rgba(255,255,255,0.1); }

.player-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    transition: color 0.2s;
}
.player-back:hover { color: white; }

.player-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-frame {
    flex: 1;
    position: relative;
    background: #000;
}
.player-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.player-sources {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(0,0,0,0.6);
    flex-shrink: 0;
}
.player-sources::-webkit-scrollbar { display: none; }
.player-sources:empty { display: none; }

.source-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
}
.source-btn:hover { background: rgba(255,255,255,0.14); color: white; }
.source-btn.active {
    background: var(--accent);
    color: #0a0a0f;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    border-top: 1px solid var(--border);
    padding: 48px var(--side-pad) 36px;
}

.footer-inner {
    max-width: 1600px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.footer-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-sec); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }

/* ============================================
   AUTH SCREEN
   ============================================ */

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s, visibility 0.4s;
}
.auth-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.auth-box {
    width: 100%;
    max-width: 380px;
    padding: 40px 32px;
    text-align: center;
}

.auth-logo {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 5px;
    color: var(--accent);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.2s;
}
.auth-tab.active { background: var(--surface); color: var(--text); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.auth-form input {
    padding: 14px 16px;
    font-size: 0.9rem;
    font-family: var(--font);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-form input::placeholder { color: var(--text-muted); }

.auth-submit { width: 100%; margin-top: 4px; }

.auth-error {
    font-size: 0.8rem;
    color: #e74c3c;
    min-height: 20px;
}

/* ============================================
   USER MENU
   ============================================ */

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-sec);
    border-radius: 6px;
    transition: color 0.2s;
}
.user-btn:hover { color: var(--text); }
.user-btn svg { opacity: 0.6; }

.logout-btn {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 5px;
    transition: color 0.2s, background 0.2s;
}
.logout-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* ============================================
   SEASON / EPISODE PICKER
   ============================================ */

.seasons-section { margin-top: 24px; }

.season-select-wrap { margin-bottom: 16px; }

.season-select {
    padding: 9px 14px;
    font-size: 0.85rem;
    font-family: var(--font);
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238585a5' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.episodes-list { display: flex; flex-direction: column; gap: 8px; }

.episode-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.episode-card:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); }
.episode-card.watched { opacity: 0.5; }

.episode-still {
    position: relative;
    width: 120px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
    flex-shrink: 0;
}
.episode-still img { width: 100%; height: 100%; object-fit: cover; }

.episode-num {
    position: absolute;
    bottom: 4px;
    left: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 3px;
}

.episode-info { flex: 1; min-width: 0; }
.episode-info h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }
.episode-info .ep-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.episode-info p { font-size: 0.78rem; color: var(--text-sec); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.episode-play-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.episode-play-btn:hover { transform: scale(1.1); box-shadow: 0 2px 10px var(--accent-glow); }
.episode-play-btn svg { margin-left: 2px; }

.episodes-loading { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

/* Continue watching badge */
.card-resume-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent);
    color: #0a0a0f;
}

/* Fade-in animation */
.fade-in {
    animation: fadeIn 0.5s var(--ease) forwards;
    opacity: 0;
}
@keyframes fadeIn { to { opacity: 1; } }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 1200px) {
    .modal-sheet { border-radius: var(--radius-lg); margin-bottom: 40px; }
    .modal-overlay { align-items: center; }
    .card { width: 200px; }
}

@media (max-width: 900px) {
    .card { width: 150px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px 12px; }
}

@media (max-width: 640px) {
    :root { --side-pad: 16px; --nav-h: 56px; }

    .nav-links { display: none; }
    .mobile-nav { display: flex; }
    .footer { padding-bottom: 90px; }

    .hero { min-height: 70vh; padding-bottom: 40px; }
    .hero-title { font-size: 1.8rem; }
    .hero-desc { font-size: 0.85rem; -webkit-line-clamp: 2; }
    .btn { padding: 11px 22px; font-size: 0.82rem; }

    .card { width: 130px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px 10px; }

    .section-title { font-size: 1.05rem; }

    .detail-body { padding: 0 20px 28px; }
    .detail-poster-wrap { width: 90px; }
    .detail-title { font-size: 1.15rem; }

    .search-wrapper.open .search-input { width: 180px; }
    .search-dropdown { width: calc(100vw - 32px); right: -16px; }

    .row-arrow { display: none; }

    .user-menu { margin-left: 4px; }
    .user-btn span { display: none; }
    .logout-btn { display: none; }

    .episode-still { width: 80px; }
    .episode-info p { display: none; }

    .auth-box { padding: 32px 24px; }
}
