/* ═══════════════════════════════════════════════════════
   FMOVIES CLONE — CINEMATIC DARK THEME
   Font: Bebas Neue (display) + Outfit (body)
═══════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────── */
:root {
  --bg:         #0a0a0f;
  --bg2:        #111118;
  --bg3:        #1a1a24;
  --bg4:        #222230;
  --card:       #13131c;
  --border:     rgba(255,255,255,.07);
  --accent:     #e50000;
  --accent2:    #ff4444;
  --accent-g:   linear-gradient(135deg,#e50000,#ff6b35);
  --gold:       #f5c518;
  --text:       #e8e8f0;
  --text2:      #9494a8;
  --text3:      #5a5a72;
  --nav-h:      64px;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 8px 32px rgba(0,0,0,.6);
  --shadow-card:0 4px 20px rgba(0,0,0,.5);
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, textarea, select, button { font-family: inherit; }
ul { list-style: none; }

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

/* ── Typography ────────────────────────────────────── */
.bebas { font-family: 'Bebas Neue', sans-serif; letter-spacing: .04em; }
h1,h2,h3 { font-weight: 700; line-height: 1.2; }

/* ── Container ─────────────────────────────────────── */
.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 6px; font-weight: 600;
  font-size: 14px; cursor: pointer; border: none;
  transition: var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: rgba(255,255,255,.07); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 8px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon { padding: 9px; border-radius: 50%; }

/* ── Badges ────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.badge-hd  { background: #1a6b3c; color: #4ade80; }
.badge-cam { background: #7c3a1a; color: #fb923c; }
.badge-new { background: var(--accent); color: #fff; }
.badge-imdb{ background: var(--gold); color: #000; }

/* ══════════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.nav-inner {
  display: flex; align-items: center; gap: 24px;
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  height: var(--nav-h);
}
.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; letter-spacing: .12em;
  color: var(--text); flex-shrink: 0;
}
.logo-f { color: var(--accent); }
.nav-links {
  display: flex; align-items: center; gap: 4px;
  flex: 1;
}
.nav-links > li > a {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 6px;
  color: var(--text2); font-size: 14px; font-weight: 500;
  transition: var(--transition);
}
.nav-links > li > a:hover, .nav-links > li > a.active {
  color: var(--text); background: var(--bg3);
}
.nav-right {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}
.search-btn {
  background: none; border: none; color: var(--text2); cursor: pointer;
  padding: 8px; border-radius: 6px; transition: var(--transition);
  display: flex; align-items: center;
}
.search-btn:hover { color: var(--text); background: var(--bg3); }

/* Dropdown — JS controlled (not hover) */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 200px;
  box-shadow: var(--shadow);
  display: none; flex-direction: column;
  padding: 12px 8px 8px; gap: 2px; z-index: 500;
  max-height: 420px; overflow-y: auto;
  margin-top: -4px;
}
.dropdown-menu.open { display: flex; }
.dropdown-menu a {
  padding: 8px 12px; border-radius: 6px; font-size: 13px;
  color: var(--text2); transition: var(--transition); white-space: nowrap;
}
.dropdown-menu a:hover { background: var(--bg4); color: var(--text); }
.dropdown-right { left: auto; right: 0; }

/* User menu *//* User menu */
.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px 6px 6px;
  cursor: pointer; color: var(--text); font-size: 14px; font-weight: 500;
  transition: var(--transition);
}
.user-btn:hover { background: var(--bg4); }
.avatar-circle {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-g); color: #fff; font-weight: 700;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
}

/* Search Bar */
.search-bar {
  border-top: 1px solid var(--border);
  overflow: hidden; max-height: 0;
  transition: max-height .3s ease, padding .3s ease;
}
.search-bar.open { max-height: 220px; }
.search-inner {
  max-width: 700px; margin: 0 auto; padding: 16px 24px;
  display: flex; gap: 10px; position: relative;
}
#searchInput {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 11px 16px; font-size: 15px;
  outline: none; transition: var(--transition);
}
#searchInput:focus { border-color: var(--accent); }
.search-submit {
  background: var(--accent); color: #fff; border: none;
  border-radius: 8px; padding: 0 20px; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.search-submit:hover { background: var(--accent2); }
/* search-results styles moved to end of file */


/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.hamburger span {
  width: 22px; height: 2px; background: var(--text2); border-radius: 2px;
  transition: var(--transition);
}

/* ══════════════════════════════════════════════════════
   HERO / SPOTLIGHT
══════════════════════════════════════════════════════ */
.hero {
  position: relative; height: 580px; overflow: hidden;
  display: flex; align-items: flex-end;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.05);
  transition: transform 8s ease;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(
    to right, rgba(10,10,15,.95) 30%, rgba(10,10,15,.4) 70%, transparent),
    linear-gradient(to top, rgba(10,10,15,1) 0%, transparent 50%);
}
.hero-content {
  position: relative; z-index: 2;
  padding: 0 60px 60px; max-width: 600px;
}
.hero-badge { margin-bottom: 12px; }
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 5vw, 64px); line-height: 1;
  margin-bottom: 14px; letter-spacing: .02em;
}
.hero-meta { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.hero-meta span { font-size: 13px; color: var(--text2); }
.hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text3); }
.hero-desc { color: var(--text2); font-size: 14px; line-height: 1.7; margin-bottom: 24px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Carousel dots */
.hero-dots {
  position: absolute; bottom: 28px; right: 60px; z-index: 3;
  display: flex; gap: 8px;
}
.hero-dot {
  width: 8px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.3);
  cursor: pointer; border: none; transition: var(--transition);
}
.hero-dot.active { background: var(--accent); width: 24px; }

/* Carousel arrows */
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(10,10,15,.65); border: 1.5px solid rgba(255,255,255,.15);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition), opacity var(--transition);
  opacity: 0;
}
.hero:hover .hero-arrow { opacity: 1; }
.hero-arrow:hover {
  background: var(--accent); border-color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}
.hero-arrow:active { transform: translateY(-50%) scale(.95); }
.hero-arrow-prev { left: 24px; }
.hero-arrow-next { right: 24px; }
/* Always show on touch devices */
@media (hover: none) {
  .hero-arrow { opacity: .75; }
}
@media (max-width: 600px) {
  .hero-arrow { width: 40px; height: 40px; opacity: .8; }
  .hero-arrow-prev { left: 12px; }
  .hero-arrow-next { right: 12px; }
}

/* ══════════════════════════════════════════════════════
   SECTION / SLIDERS
══════════════════════════════════════════════════════ */
.section { padding: 40px 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px; letter-spacing: .06em;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ''; width: 4px; height: 24px; background: var(--accent);
  border-radius: 2px; flex-shrink: 0;
}
.view-all { font-size: 13px; color: var(--text2); transition: var(--transition); }
.view-all:hover { color: var(--accent); }

/* Card Slider */
.card-slider-wrap { position: relative; }
.card-slider {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
@media (min-width: 1200px) {
  .card-slider { grid-template-columns: repeat(7, 1fr); }
}
@media (max-width: 900px)  { .card-slider { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px)  { .card-slider { grid-template-columns: repeat(3, 1fr); } }

/* ── Movie Card ─────────────────────────────────────── */
.movie-card {
  position: relative; border-radius: var(--radius);
  overflow: hidden; background: var(--card);
  cursor: pointer; transition: transform var(--transition), box-shadow var(--transition);
}
.movie-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0,0,0,.7);
  z-index: 2;
}
.movie-card-poster {
  width: 100%; aspect-ratio: 2/3; object-fit: cover;
  display: block; transition: opacity var(--transition);
}
.movie-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.9) 30%, transparent 70%);
  opacity: 0; transition: opacity var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.movie-card:hover .movie-card-overlay { opacity: 1; }
.play-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(229,0,0,.9); display: flex; align-items: center; justify-content: center;
  transform: scale(.8); transition: transform var(--transition);
  border: 2px solid rgba(255,255,255,.2);
}
.movie-card:hover .play-icon { transform: scale(1); }
.play-icon svg { margin-left: 4px; }
.movie-card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px; display: flex; flex-direction: column; gap: 3px;
}
.movie-card-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3;
}
.movie-card-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.movie-card-meta span { font-size: 11px; color: var(--text2); }
.card-rating {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700; color: var(--gold);
}
.card-quality { position: absolute; top: 8px; left: 8px; }
.card-type { position: absolute; top: 8px; right: 8px; }
.card-new-badge {
  position: absolute; top: 34px; right: 8px;
}

/* ══════════════════════════════════════════════════════
   BROWSE / GRID PAGE
══════════════════════════════════════════════════════ */
.browse-header {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 32px 0 0;
}
.browse-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 36px;
  letter-spacing: .06em; margin-bottom: 20px;
}
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; padding-bottom: 20px;
}
.filter-select {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 8px 14px;
  font-size: 14px; outline: none; cursor: pointer;
  transition: var(--transition); min-width: 120px;
}
.filter-select:hover, .filter-select:focus { border-color: var(--accent); }

.movies-grid {
  display: grid; gap: 20px; padding: 32px 0;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
@media (min-width: 1200px) { .movies-grid { grid-template-columns: repeat(7, 1fr); } }
@media (max-width: 900px)  { .movies-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px)  { .movies-grid { grid-template-columns: repeat(2, 1fr); } }

/* Pagination */
.pagination {
  display: flex; justify-content: center; gap: 8px;
  padding: 32px 0 48px;
}
.page-btn {
  min-width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: 14px; cursor: pointer; transition: var(--transition);
  font-weight: 500;
}
.page-btn:hover { background: var(--bg4); color: var(--text); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ══════════════════════════════════════════════════════
   MOVIE DETAIL PAGE
══════════════════════════════════════════════════════ */
.movie-detail-hero {
  position: relative; min-height: 500px;
  display: flex; align-items: flex-end;
}
.detail-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center top;
}
.detail-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(10,10,15,.98) 40%, rgba(10,10,15,.6)),
              linear-gradient(to top, rgba(10,10,15,1), transparent 70%);
}
.detail-content {
  position: relative; z-index: 2; padding: 60px 60px;
  display: flex; gap: 40px; align-items: flex-start;
}
.detail-poster {
  width: 200px; flex-shrink: 0; border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.7); overflow: hidden;
}
.detail-poster img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.detail-info { flex: 1; }
.detail-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.genre-tag {
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: rgba(229,0,0,.15); border: 1px solid rgba(229,0,0,.3); color: #ff6b6b;
  text-decoration: none; display: inline-block;
  transition: background var(--transition), border-color var(--transition);
}
a.genre-tag:hover {
  background: rgba(229,0,0,.28); border-color: rgba(229,0,0,.55);
  color: #ff8888;
}
.detail-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(32px, 4vw, 56px); line-height: 1; margin-bottom: 16px;
}
.detail-meta { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.detail-meta-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); }
.detail-meta-item strong { color: var(--text); }
.imdb-score {
  display: flex; align-items: center; gap: 6px;
  background: rgba(245,197,24,.1); border: 1px solid rgba(245,197,24,.25);
  border-radius: 6px; padding: 6px 12px;
  font-weight: 700; color: var(--gold); font-size: 16px;
}
.detail-desc { color: var(--text2); line-height: 1.8; margin-bottom: 28px; max-width: 600px; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }

/* Player Section */
.player-section { padding: 0 0 48px; }
.player-wrap {
  background: #000; border-radius: var(--radius-lg);
  overflow: hidden; position: relative;
  aspect-ratio: 16/9; max-width: 1100px; margin: 0 auto;
}
.player-wrap iframe { width: 100%; height: 100%; border: none; }
.player-locked {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 40px;
  background: var(--bg2); border-radius: var(--radius-lg);
  border: 1px solid var(--border); max-width: 1100px; margin: 0 auto;
  min-height: 360px;
}
.player-locked .lock-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(229,0,0,.1); border: 2px solid rgba(229,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.player-locked h3 { font-size: 22px; }
.player-locked p { color: var(--text2); max-width: 380px; line-height: 1.7; }
.source-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 16px;
  max-width: 1100px; margin: 0 auto;
}
.source-tab {
  padding: 7px 18px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); transition: var(--transition);
}
.source-tab:hover { border-color: var(--accent); color: var(--text); }
.source-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ══════════════════════════════════════════════════════
   AUTH PAGES
══════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(229,0,0,.08) 0%, transparent 70%),
              var(--bg);
}
.auth-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 48px 40px;
  width: 100%; max-width: 440px; box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo a { font-family: 'Bebas Neue', sans-serif; font-size: 36px; letter-spacing: .12em; }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.auth-sub { color: var(--text2); font-size: 14px; text-align: center; margin-bottom: 32px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.form-input {
  width: 100%; background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 12px 16px; font-size: 14px;
  outline: none; transition: var(--transition);
}
.form-input:focus { border-color: var(--accent); background: var(--bg4); }
.form-input::placeholder { color: var(--text3); }
.form-btn { width: 100%; margin-top: 8px; justify-content: center; }
.auth-alt { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text2); }
.auth-alt a { color: var(--accent); font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }
.input-error { border-color: #e53e3e !important; }
.error-msg { color: #e53e3e; font-size: 12px; margin-top: 5px; }

/* ══════════════════════════════════════════════════════
   ADMIN PANEL
══════════════════════════════════════════════════════ */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px; border-bottom: 1px solid var(--border);
  font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: .1em;
}
.sidebar-logo span { color: var(--accent); }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text2); transition: var(--transition);
}
.sidebar-nav a:hover { background: var(--bg3); color: var(--text); }
.sidebar-nav a.active { background: rgba(229,0,0,.12); color: var(--accent); }
.sidebar-nav .nav-section {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text3); padding: 16px 14px 4px;
}
.sidebar-user {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.admin-main { flex: 1; overflow: hidden; }
.admin-topbar {
  height: 64px; background: var(--bg2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; position: sticky; top: 0; z-index: 100;
}
.admin-topbar h1 { font-size: 22px; font-weight: 700; }
.admin-content { padding: 32px; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  margin-bottom: 8px;
}
.stat-icon.red   { background: rgba(229,0,0,.12); }
.stat-icon.blue  { background: rgba(59,130,246,.12); }
.stat-icon.green { background: rgba(34,197,94,.12); }
.stat-icon.gold  { background: rgba(245,197,24,.12); }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text2); }

/* Admin Tables */
.admin-table-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.admin-table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.admin-table-header h3 { font-size: 16px; font-weight: 700; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text2);
  background: var(--bg3); border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px 16px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table tr:last-child td { border-bottom: none; }
.table-poster { width: 36px; height: 54px; object-fit: cover; border-radius: 4px; }
.table-actions { display: flex; gap: 6px; align-items: center; }

/* Admin Forms */
.admin-form-wrap {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
}
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-form-grid .full { grid-column: 1 / -1; }
.form-hint { font-size: 12px; color: var(--text3); margin-top: 5px; }
.form-select {
  width: 100%; background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 12px 16px; font-size: 14px;
  outline: none; transition: var(--transition); cursor: pointer;
}
.form-select:focus { border-color: var(--accent); }
.form-textarea {
  width: 100%; background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 12px 16px; font-size: 14px;
  outline: none; resize: vertical; min-height: 120px; transition: var(--transition);
}
.form-textarea:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════
   FLASH / ALERTS
══════════════════════════════════════════════════════ */
.flash-wrap { position: fixed; top: 80px; right: 20px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 14px 20px; border-radius: 8px; font-size: 14px; font-weight: 500;
  max-width: 340px; box-shadow: var(--shadow);
  animation: slideIn .3s ease; border: 1px solid transparent;
}
.flash-success { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.25); color: #4ade80; }
.flash-error   { background: rgba(229,0,0,.12); border-color: rgba(229,0,0,.25); color: #f87171; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* Alert inline */
.alert {
  padding: 14px 18px; border-radius: 8px; font-size: 14px; margin-bottom: 20px;
  border: 1px solid transparent;
}
.alert-error   { background: rgba(229,0,0,.1); border-color: rgba(229,0,0,.2); color: #f87171; }
.alert-success { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.2); color: #4ade80; }
.alert-info    { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.2); color: #93c5fd; }

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 48px 0 0;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}
.footer-brand p { color: var(--text2); font-size: 14px; line-height: 1.7; margin-top: 12px; max-width: 260px; }
.footer-col h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.footer-col a { display: block; font-size: 13px; color: var(--text2); margin-bottom: 10px; transition: var(--transition); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; text-align: center; }
.footer-bottom p { font-size: 12px; color: var(--text3); }

/* ══════════════════════════════════════════════════════
   LOADING / SPINNERS
══════════════════════════════════════════════════════ */
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--bg4);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite; border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Modal ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  max-width: 480px; width: 100%;
  transform: scale(.95); transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-close { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 22px; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .detail-content { padding: 40px 32px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}


/* ── Admin extra responsive ─────────────────────────── */

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 20px; }
  .detail-content { padding: 20px 16px; }
  .hero-content { padding: 0 20px 32px; }
}

/* ── code tag ─────────────────────────────────────────── */
code {
  background: var(--bg4); padding: 2px 6px; border-radius: 4px;
  font-family: monospace; font-size: 13px; color: var(--accent2);
}

/* ── scrolled navbar ──────────────────────────────────── */
.navbar.scrolled {
  background: rgba(10,10,15,.98);
  box-shadow: 0 2px 24px rgba(0,0,0,.4);
}

/* ══════════════════════════════════════════════════════
   TV SERIES — SEASONS & EPISODES
══════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   TV SERIES — EPISODE LIST PLAYER
═══════════════════════════════════════════════════════ */

/* Server tabs row above player */
.source-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }

.source-tab {
  padding: 8px 20px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer; background: var(--bg3); border: 1.5px solid var(--border);
  color: var(--text2); transition: var(--transition); white-space: nowrap;
}
.source-tab:hover  { border-color: var(--accent); color: var(--text); }
.source-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Season select */
#seasonSelect {
  background: var(--bg3); border: 1.5px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; outline: none; cursor: pointer;
  transition: var(--transition);
}
#seasonSelect:focus, #seasonSelect:hover { border-color: var(--accent); }

/* Episode row */
.ep-row {
  display: flex; align-items: center; gap: 0;
  cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.ep-row:last-child { border-bottom: none; }
.ep-row:hover  { background: var(--bg3); }
.ep-row.active { background: rgba(229,0,0,.07); }
.ep-row.active .ep-row-num { color: var(--accent); }

/* Admin episode table */
.ep-number-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  font-weight: 700; font-size: 13px; color: var(--text2);
}
.season-divider {
  padding: 12px 16px; background: var(--bg3);
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text2);
  border-bottom: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 600px) {
  .episode-grid { grid-template-columns: repeat(auto-fill, minmax(52px,1fr)); gap:6px; }
  .ep-btn { font-size: 13px; }
  .episode-info-strip { flex-direction: column; }
  .ep-still { width: 100%; }
}

/* ══════════════════════════════════════════════════════
   COMMENTS & RATINGS
══════════════════════════════════════════════════════ */

.comments-section {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 48px 0;
}
.comments-inner { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* Rating Widget */
.rating-widget {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 28px;
  margin-bottom: 32px; display: flex; gap: 32px; align-items: flex-start;
  flex-wrap: wrap;
}
.rating-left { flex: 1; min-width: 200px; }
.rating-left h4 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.rating-left p  { font-size: 13px; color: var(--text2); }
.rating-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.avg-score {
  font-family: 'Bebas Neue', sans-serif; font-size: 52px; line-height: 1;
  color: var(--gold); letter-spacing: .04em;
}
.avg-score small { font-family: 'Outfit', sans-serif; font-size: 14px; color: var(--text2); font-weight: 400; }
.rating-count { font-size: 13px; color: var(--text2); }

/* Star / number picker */
.score-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.score-btn {
  width: 38px; height: 38px; border-radius: 6px;
  background: var(--bg4); border: 1.5px solid var(--border);
  color: var(--text2); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--transition); display: flex;
  align-items: center; justify-content: center;
}
.score-btn:hover { background: rgba(245,197,24,.15); border-color: var(--gold); color: var(--gold); }
.score-btn.selected { background: var(--gold); border-color: var(--gold); color: #000; }
.score-btn.high { border-color: rgba(74,222,128,.3); }
.score-btn.high:hover, .score-btn.high.selected { background: #4ade80; border-color: #4ade80; color: #000; }
.score-btn.mid  { }
.score-btn.low  { border-color: rgba(248,113,113,.3); }
.score-btn.low:hover, .score-btn.low.selected { background: #f87171; border-color: #f87171; color: #000; }

/* Episode selector for ratings */
.ep-rating-select {
  background: var(--bg4); border: 1.5px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 8px 12px;
  font-size: 13px; outline: none; cursor: pointer; transition: var(--transition);
}
.ep-rating-select:focus { border-color: var(--accent); }

/* Comment Form */
.comment-form-wrap {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 32px;
}
.comment-form-wrap h4 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.comment-textarea {
  width: 100%; background: var(--bg4); border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 12px 16px;
  font-size: 14px; resize: vertical; min-height: 90px;
  font-family: inherit; outline: none; transition: var(--transition);
  line-height: 1.6;
}
.comment-textarea:focus { border-color: var(--accent); background: var(--bg2); }
.comment-textarea::placeholder { color: var(--text3); }
.comment-form-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; flex-wrap: wrap; gap: 8px;
}
.char-count { font-size: 12px; color: var(--text3); }
.char-count.warn { color: #f87171; }

/* Comment list */
.comments-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.comments-header h3 { font-size: 18px; font-weight: 700; }
.comments-loading { text-align: center; padding: 32px; color: var(--text2); }

.comment-item {
  border-bottom: 1px solid var(--border); padding: 20px 0;
}
.comment-item:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.comment-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-g); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.comment-avatar.admin { background: linear-gradient(135deg,#f5c518,#e08000); color: #000; }
.comment-username { font-weight: 700; font-size: 14px; }
.comment-badge {
  font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.badge-admin-tag { background: rgba(245,197,24,.15); color: #f5c518; border: 1px solid rgba(245,197,24,.25); }
.comment-date { font-size: 12px; color: var(--text3); margin-left: auto; }
.comment-body {
  font-size: 14px; line-height: 1.7; color: var(--text);
  white-space: pre-wrap; word-break: break-word; margin-bottom: 10px;
}
.comment-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.comment-action-btn {
  background: none; border: none; font-size: 13px; color: var(--text2);
  cursor: pointer; padding: 0; transition: color var(--transition);
  display: flex; align-items: center; gap: 5px;
}
.comment-action-btn:hover { color: var(--text); }
.comment-action-btn.liked { color: var(--accent); }
.comment-action-btn.liked svg { fill: var(--accent); }

/* Reply box */
.reply-form {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
  margin-top: 12px; display: none;
}
.reply-form.open { display: block; }

/* Replies thread */
.replies-thread {
  margin-top: 12px; padding-left: 20px;
  border-left: 2px solid var(--border); display: none;
}
.replies-thread.open { display: block; }
.reply-item {
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.reply-item:last-child { border-bottom: none; }

/* Login prompt */
.comment-login-prompt {
  text-align: center; padding: 36px; background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.comment-login-prompt p { color: var(--text2); margin-bottom: 16px; font-size: 15px; }

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

@media (max-width: 600px) {
  .rating-widget { flex-direction: column; gap: 16px; }
  .rating-right  { align-items: flex-start; }
  .score-picker  { justify-content: flex-start; }
}

/* ══════════════════════════════════════════════════════
   PROFILE PAGE
══════════════════════════════════════════════════════ */
.profile-layout { display:grid; grid-template-columns:260px 1fr; gap:28px; padding:40px 0 64px; }
@media(max-width:900px){ .profile-layout { grid-template-columns:1fr; } }

.profile-sidebar {
  background:var(--bg2); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:28px 20px;
  height:fit-content; position:sticky; top:80px;
}
.profile-avatar-big {
  width:80px; height:80px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-family:'Bebas Neue',sans-serif; font-size:36px;
  color:#fff; margin:0 auto 16px;
  background:var(--accent-g);
  box-shadow:0 8px 32px rgba(229,0,0,.35);
}
.profile-username { font-weight:700; font-size:18px; text-align:center; margin-bottom:4px; }
.profile-email    { font-size:13px; color:var(--text2); text-align:center; margin-bottom:20px; word-break:break-all; }

.profile-stats { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:24px; }
.profile-stat  {
  background:var(--bg3); border-radius:8px; padding:10px;
  text-align:center; border:1px solid var(--border);
}
.profile-stat-value { font-size:22px; font-weight:700; color:var(--text); line-height:1; }
.profile-stat-label { font-size:11px; color:var(--text2); margin-top:2px; }

.profile-nav { display:flex; flex-direction:column; gap:2px; }
.profile-nav a {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:8px; font-size:14px; font-weight:500;
  color:var(--text2); transition:var(--transition); text-decoration:none;
}
.profile-nav a:hover  { background:var(--bg3); color:var(--text); }
.profile-nav a.active { background:rgba(229,0,0,.1); color:var(--accent); border:1px solid rgba(229,0,0,.2); }

.profile-main { min-width:0; }
.profile-card {
  background:var(--bg2); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:32px; margin-bottom:24px;
}
.profile-card h3 { font-size:17px; font-weight:700; margin-bottom:24px; padding-bottom:14px; border-bottom:1px solid var(--border); }

/* Colour swatches */
.color-swatch {
  width:36px; height:36px; border-radius:50%; cursor:pointer;
  border:3px solid transparent; transition:border-color .18s, transform .18s;
}
.color-swatch:hover, .color-swatch.selected { border-color:#fff; transform:scale(1.15); }

/* ══════════════════════════════════════════════════════
   SEARCH PAGE
══════════════════════════════════════════════════════ */
.search-hero { background:var(--bg2); border-bottom:1px solid var(--border); padding:40px 0 32px; }
.search-hero-inner { max-width:680px; }
.search-hero h1 { font-family:'Bebas Neue',sans-serif; font-size:40px; letter-spacing:.06em; margin-bottom:20px; }


/* ══════════════════════════════════════════════════════
   THEMES  — each class applied to <html>
   Default (no class) = dark
══════════════════════════════════════════════════════ */

/* ── DARK (default) ──────────────────────────────── */


/* ── LIGHT ────────────────────────────────────────── */
html.theme-light {
  --bg:         #f4f4f8;
  --bg2:        #ffffff;
  --bg3:        #eeeef4;
  --bg4:        #e0e0ec;
  --card:       #ffffff;
  --border:     rgba(0,0,0,.09);
  --accent:     #e50000;
  --accent2:    #c40000;
  --accent-g:   linear-gradient(135deg,#e50000,#ff6b35);
  --gold:       #c8920a;
  --text:       #111118;
  --text2:      #55556a;
  --text3:      #9090a8;
  --shadow:     0 8px 32px rgba(0,0,0,.12);
  --shadow-card:0 4px 20px rgba(0,0,0,.09);
}
html.theme-light body { background: var(--bg); }
html.theme-light .navbar {
  background: rgba(244,244,248,.94);
  border-bottom-color: rgba(0,0,0,.1);
}
html.theme-light ::-webkit-scrollbar-track { background: var(--bg3); }
html.theme-light ::-webkit-scrollbar-thumb { background: var(--bg4); }

/* ── BLUE ─────────────────────────────────────────── */
html.theme-blue {
  --bg:         #080e1a;
  --bg2:        #0d1525;
  --bg3:        #111e35;
  --bg4:        #162340;
  --card:       #0d1525;
  --border:     rgba(100,160,255,.1);
  --accent:     #2563eb;
  --accent2:    #3b82f6;
  --accent-g:   linear-gradient(135deg,#2563eb,#06b6d4);
  --gold:       #f5c518;
  --text:       #e2eeff;
  --text2:      #7da8d8;
  --text3:      #3d6494;
  --shadow:     0 8px 32px rgba(0,0,30,.7);
  --shadow-card:0 4px 20px rgba(0,0,30,.5);
}
html.theme-blue .navbar { background: rgba(8,14,26,.93); }
html.theme-blue .logo-f { color: var(--accent); }

/* ── RED ──────────────────────────────────────────── */
html.theme-red {
  --bg:         #130608;
  --bg2:        #1c0a0c;
  --bg3:        #260d10;
  --bg4:        #311014;
  --card:       #1c0a0c;
  --border:     rgba(255,80,80,.1);
  --accent:     #e50000;
  --accent2:    #ff2020;
  --accent-g:   linear-gradient(135deg,#e50000,#ff6b35);
  --gold:       #f5c518;
  --text:       #ffe8e8;
  --text2:      #c88a8a;
  --text3:      #7a4040;
  --shadow:     0 8px 32px rgba(30,0,0,.7);
  --shadow-card:0 4px 20px rgba(30,0,0,.5);
}
html.theme-red .navbar { background: rgba(19,6,8,.93); }

/* ── PINK ─────────────────────────────────────────── */
html.theme-pink {
  --bg:         #130810;
  --bg2:        #1e0d1a;
  --bg3:        #2a1125;
  --bg4:        #341530;
  --card:       #1e0d1a;
  --border:     rgba(255,100,200,.1);
  --accent:     #d946a8;
  --accent2:    #ec4899;
  --accent-g:   linear-gradient(135deg,#d946a8,#a855f7);
  --gold:       #f5c518;
  --text:       #ffe8f6;
  --text2:      #c880b0;
  --text3:      #7a4068;
  --shadow:     0 8px 32px rgba(30,0,20,.7);
  --shadow-card:0 4px 20px rgba(30,0,20,.5);
}
html.theme-pink .navbar  { background: rgba(19,8,16,.93); }
html.theme-pink .logo-f  { color: var(--accent); }
html.theme-pink .btn-primary { background: var(--accent); }
html.theme-pink .btn-primary:hover { background: var(--accent2); }

/* ── ORANGE ───────────────────────────────────────── */
html.theme-orange {
  --bg:         #110900;
  --bg2:        #1a1000;
  --bg3:        #251800;
  --bg4:        #301f00;
  --card:       #1a1000;
  --border:     rgba(255,150,0,.1);
  --accent:     #f97316;
  --accent2:    #fb923c;
  --accent-g:   linear-gradient(135deg,#f97316,#fbbf24);
  --gold:       #fbbf24;
  --text:       #fff2e0;
  --text2:      #c8a060;
  --text3:      #7a5a20;
  --shadow:     0 8px 32px rgba(30,15,0,.7);
  --shadow-card:0 4px 20px rgba(30,15,0,.5);
}
html.theme-orange .navbar { background: rgba(17,9,0,.93); }
html.theme-orange .logo-f { color: var(--accent); }

/* ── YELLOW ───────────────────────────────────────── */
html.theme-yellow {
  --bg:         #0f0e00;
  --bg2:        #191700;
  --bg3:        #242100;
  --bg4:        #2e2a00;
  --card:       #191700;
  --border:     rgba(255,220,0,.1);
  --accent:     #eab308;
  --accent2:    #fbbf24;
  --accent-g:   linear-gradient(135deg,#eab308,#f97316);
  --gold:       #eab308;
  --text:       #fffde0;
  --text2:      #c8bc50;
  --text3:      #7a7020;
  --shadow:     0 8px 32px rgba(20,18,0,.7);
  --shadow-card:0 4px 20px rgba(20,18,0,.5);
}
html.theme-yellow .navbar { background: rgba(15,14,0,.93); }
html.theme-yellow .logo-f { color: var(--accent); }
html.theme-yellow .badge-new { color: #111; }

/* ── Theme-aware overrides for light mode only ────── */
html.theme-light .hero-bg::after {
  background: linear-gradient(
    to right, rgba(240,240,248,.97) 30%, rgba(240,240,248,.5) 70%, transparent),
    linear-gradient(to top, rgba(240,240,248,1) 0%, transparent 50%);
}
html.theme-light .admin-sidebar { background: #fff; }
html.theme-light .admin-main    { background: var(--bg); }
html.theme-light .form-input,
html.theme-light .form-select,
html.theme-light .form-textarea,
html.theme-light .comment-textarea { background: #fff; color: var(--text); }
html.theme-light .movie-card-overlay {
  background: linear-gradient(to top, rgba(0,0,0,.85) 30%, transparent 70%);
}
html.theme-light .hero-content h1,
html.theme-light .hero-title { color: #0a0a0f; }
html.theme-light .detail-bg::after {
  background: linear-gradient(
    to right, rgba(240,240,248,.98) 40%, rgba(240,240,248,.6)),
    linear-gradient(to top, rgba(240,240,248,1), transparent 70%);
}

/* ── Theme picker widget ───────────────────────────── */
.theme-picker-wrap {
  position: relative;
  display: inline-block;
}
.theme-picker-btn {
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 7px 12px;
  cursor: pointer; color: var(--text2); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  transition: var(--transition);
}
.theme-picker-btn:hover { border-color: var(--accent); color: var(--text); }
.theme-dot-preview {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--border);
  flex-shrink: 0;
}
.theme-palette {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow); z-index: 9000;
  min-width: 220px;
  display: none; flex-direction: column; gap: 6px;
}
.theme-palette.open { display: flex; }
.theme-palette-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text3); margin-bottom: 6px;
}
.theme-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  transition: background var(--transition);
  border: 1.5px solid transparent;
}
.theme-option:hover { background: var(--bg3); }
.theme-option.active {
  border-color: var(--accent);
  background: var(--bg3);
}
.theme-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  flex-shrink: 0; border: 2px solid rgba(255,255,255,.15);
}
.theme-name { font-size: 13px; font-weight: 600; color: var(--text); }
.theme-name small { display: block; font-size: 11px; color: var(--text2); font-weight: 400; }

/* ── Fixed dropdown (JS-driven, not hover) ─────────── */
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 200px;
  box-shadow: var(--shadow);
  display: none; flex-direction: column;
  padding: 8px; gap: 2px; z-index: 500;
  max-height: 420px; overflow-y: auto;
  /* Bridge the gap so mouse doesn't lose hover */
  padding-top: 12px;
  margin-top: -4px;
}
.dropdown-menu.open { display: flex; }
.dropdown-menu a {
  padding: 8px 12px; border-radius: 6px; font-size: 13px;
  color: var(--text2); transition: var(--transition);
  white-space: nowrap;
}
.dropdown-menu a:hover { background: var(--bg4); color: var(--text); }
.dropdown-right { left: auto; right: 0; }

/* Remove old :hover trigger — now JS only */
/* .dropdown:hover .dropdown-menu { ... }  ← REMOVED */

/* ── Mobile nav overrides ──────────────────────────── */



/* ══════════════════════════════════════════════════════
   RESPONSIVE — 768px (Mobile)
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── Mobile navbar: only logo + search + hamburger visible ── */
  .nav-links       { display: none !important; }
  .hamburger       { display: flex !important; }

  /* Shrink nav-inner padding */
  .nav-inner { gap: 0; padding: 0 12px; }

  /* Hide these from the top bar on mobile — they move into the slide-out menu */
  .user-btn > span:last-child { display: none; }      /* hide username text, keep avatar */
  .theme-picker-wrap { display: none !important; }    /* theme picker hidden on mobile */
  .btn-outline.btn-sm,
  .btn-primary.btn-sm { display: none !important; }   /* login/signup top bar buttons */

  /* Nav-right spacing */
  .nav-right { gap: 6px; }

  /* Make user avatar button smaller */
  .user-btn {
    padding: 5px; border-radius: 50%;
    border: none; background: transparent;
  }

  /* ── Mobile full-screen nav panel ── */
  .mobile-nav-open .nav-links {
    display: block !important;      /* block so children stack as full-width rows */
    position: fixed;
    top: var(--nav-h); left: 0; right: 0; bottom: 0;
    background: var(--bg2);
    z-index: 9999;
    padding: 8px 0 40px;
    overflow-y: auto;
    overflow-x: hidden;
    border-top: 1px solid var(--border);
    /* Reset desktop flex props */
    align-items: stretch;
    flex: none;
    min-height:400px;
  }

  /* Top-level list items: full width */
  .mobile-nav-open .nav-links > li {
    display: block;
    width: 100%;
    border-bottom: 1px solid var(--border);
  }
  .mobile-nav-open .nav-links > li:last-child { border-bottom: none; }

  /* Top-level links: full-width tap targets */
  .mobile-nav-open .nav-links > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    border-radius: 0;
    box-sizing: border-box;
  }
  .mobile-nav-open .nav-links > li > a:hover,
  .mobile-nav-open .nav-links > li > a:active { color: var(--accent); background: var(--bg3); }

  /* Mobile nav footer — auth buttons + theme swatches */
  .mobile-nav-footer {
    display: block !important;
    padding: 16px 20px 24px;
    border-top: 1px solid var(--border);
  }
  .mobile-nav-footer .btn {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
    padding: 13px 16px;
    font-size: 15px;
    border-radius: 8px;
    margin-bottom: 8px;
  }
  .mobile-nav-footer .btn:last-of-type { margin-bottom: 0; }
  .mobile-nav-theme-row {
    display: flex !important;
    align-items: center; justify-content: space-between;
    gap: 8px; flex-wrap: wrap;
    padding: 16px 0 0;
  }
  .mobile-theme-swatches {
    display: flex; gap: 8px; flex-wrap: wrap;
  }
  .mobile-theme-swatch {
    width: 28px; height: 28px; border-radius: 50%;
    border: 2px solid transparent; cursor: pointer;
    transition: border-color .18s, transform .18s;
  }
  .mobile-theme-swatch:hover,
  .mobile-theme-swatch.active { border-color: #fff; transform: scale(1.15); }

  /* Genre accordion — toggle with JS .open class */
  .mobile-nav-open .dropdown-menu {
    display: none;
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    border-top: 1px solid var(--border) !important;
    background: var(--bg3);
    border-radius: 0;
    margin: 0;
    padding: 4px 0 8px;
    max-height: 260px;
    overflow-y: auto;
    width: 100%;
    /* Reset desktop absolute positioning */
    top: auto !important;
    left: auto !important;
    min-width: 0 !important;
  }
  .mobile-nav-open .dropdown-menu.open {
    display: block;  /* block so links stack full-width */
  }
  .mobile-nav-open .dropdown-menu a {
    display: block;
    width: 100%;
    padding: 11px 28px;
    font-size: 14px;
    color: var(--text2);
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    box-sizing: border-box;
  }
  .mobile-nav-open .dropdown-menu a:last-child { border-bottom: none; }
  .mobile-nav-open .dropdown-menu a:hover,
  .mobile-nav-open .dropdown-menu a:active { color: var(--text); background: var(--bg4); }

  /* Hamburger → × animation */
  .hamburger span {
    transform-origin: center;
    transition: transform .22s ease, opacity .18s ease;
  }
  .mobile-nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-nav-open .hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .mobile-nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Page layout */
  .hero           { height: 420px; }
  .hero-content   { padding: 0 24px 40px; }
  .detail-content { flex-direction: column; padding: 24px; }
  .detail-poster  { width: 140px; }
  .admin-sidebar  { display: none; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .stats-grid     { grid-template-columns: 1fr 1fr; }
  .footer-grid    { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .auth-card      { padding: 28px 16px; }
  .hero           { height: 360px; }
  .hero-content   { padding: 0 16px 28px; }
  .detail-content { padding: 16px; }
  .stats-grid     { grid-template-columns: 1fr; }
}


/* ══════════════════════════════════════════════════════
   SEARCH SUGGEST DROPDOWN
══════════════════════════════════════════════════════ */
.search-inner { position: relative; }

.search-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  z-index: 9999;
  overflow: hidden;
  display: none;
  max-height: 500px;
  overflow-y: auto;
}
.search-results.open { display: block; }

/* Header */
.sr-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 8px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text3); border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.sr-count {
  background: var(--bg3); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; color: var(--text2);
}

/* Result row */
.sr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  text-decoration: none; color: inherit;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .15s;
  cursor: pointer;
}
.sr-item:last-of-type { border-bottom: none; }
.sr-item:hover, .sr-item.focused { background: var(--bg3); }
.sr-item:hover .sr-chevron, .sr-item.focused .sr-chevron {
  color: var(--accent); opacity: 1;
}

/* Poster thumbnail */
.sr-img {
  width: 40px; height: 60px; flex-shrink: 0;
  border-radius: 5px; overflow: hidden;
  background: var(--bg4); position: relative;
}
.sr-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.sr-img-play {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.sr-item:hover .sr-img-play, .sr-item.focused .sr-img-play { opacity: 1; }

/* Text */
.sr-body { flex: 1; min-width: 0; }
.sr-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px; line-height: 1.3;
}
.sr-tags {
  display: flex; gap: 6px; align-items: center;
}
.sr-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 4px;
}
.sr-badge-movie { background: rgba(255,255,255,.08); color: var(--text2); }
.sr-badge-tv    { background: rgba(229,0,0,.18); color: #ff7777; }
.sr-year   { font-size: 12px; color: var(--text2); }
.sr-rating { font-size: 12px; color: #f5c518; }

/* Matched text highlight */
.sr-hl {
  background: rgba(229,0,0,.18); color: var(--accent);
  border-radius: 2px; padding: 0 1px; font-style: normal;
}

/* Chevron */
.sr-chevron {
  flex-shrink: 0; color: var(--text3); opacity: 0;
  transition: color .15s, opacity .15s;
}

/* Empty state */
.sr-empty {
  padding: 28px 20px; text-align: center;
}
.sr-empty-icon { font-size: 36px; margin-bottom: 10px; }
.sr-empty-text { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.sr-empty-text strong { color: var(--accent); }
.sr-empty-sub  { font-size: 12px; color: var(--text3); }

/* Skeleton */
.sr-skeleton {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.sr-skel-img {
  width: 40px; height: 60px; flex-shrink: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.sr-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sr-skel-line {
  height: 10px; border-radius: 4px;
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Footer "see all" link */
.sr-footer {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 14px; font-size: 13px; font-weight: 600;
  color: var(--accent); text-decoration: none;
  background: rgba(229,0,0,.05); border-top: 1px solid var(--border);
  transition: background .15s;
}
.sr-footer:hover { background: rgba(229,0,0,.12); }
.sr-footer strong { color: var(--text); }

.search-results::-webkit-scrollbar { width: 4px; }
.search-results::-webkit-scrollbar-track { background: var(--bg2); }
.search-results::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }

/* ══════════════════════════════════════════════════════
   PREV / NEXT MOVIE NAVIGATION
══════════════════════════════════════════════════════ */
.movie-nav {
  display: flex; gap: 12px; justify-content: space-between;
  padding: 20px 0 8px; flex-wrap: wrap;
}
.movie-nav-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 16px;
  text-decoration: none; color: var(--text2);
  transition: border-color .2s, background .2s, color .2s;
  max-width: calc(50% - 6px); flex: 1;
  min-width: 0;
}
.movie-nav-btn:hover {
  border-color: var(--accent); background: var(--bg3); color: var(--text);
}
.movie-nav-btn.nav-next { justify-content: flex-end; text-align: right; }
.movie-nav-thumb {
  width: 38px; height: 57px; flex-shrink: 0;
  border-radius: 5px; overflow: hidden; background: var(--bg4);
}
.movie-nav-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.movie-nav-text { min-width: 0; flex: 1; }
.movie-nav-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text3); margin-bottom: 3px;
}
.movie-nav-title {
  font-size: 13px; font-weight: 600; color: inherit;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.movie-nav-arrow {
  font-size: 22px; color: var(--text3); flex-shrink: 0;
  transition: color .2s;
}
.movie-nav-btn:hover .movie-nav-arrow { color: var(--accent); }
@media (max-width: 480px) {
  .movie-nav-btn { padding: 10px 12px; }
  .movie-nav-title { font-size: 12px; }
}
