/* ═══════════════════════════════════════════════════════════════════════
   CINEFLIXX — Global Stylesheet
   Premium cinematic UI · Dense compact layout · Smooth animations
   ════════════════════════════════════════════════════════════════════════ */

/* ─── FONTS ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ─── CSS VARIABLES ─────────────────────────────────────────────────── */
:root {
  --bg:           #0b0b0b;
  --bg-card:      #111111;
  --bg-elevated:  #181818;
  --bg-modal:     #141414;
  --text:         #ffffff;
  --text-muted:   #aaaaaa;
  --text-dim:     #666666;
  --accent:       #e50914;
  --accent-hover: #f40612;
  --accent-glow:  rgba(229, 9, 20, 0.35);
  --gold:         #f5c518;
  --green:        #46d369;
  --nav-height:   60px;
  --radius:       6px;
  --radius-lg:    12px;
  --shadow-card:  0 4px 20px rgba(0,0,0,0.6);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.9);
  --transition:   0.22s ease;
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-body:    'Outfit', 'Helvetica Neue', sans-serif;
  --gap:          8px;
  --card-w:       clamp(120px, 13vw, 180px);
  --section-px:   clamp(12px, 3vw, 40px);
}

/* ─── RESET ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ═══════════════════════════════════════════════════════════════════════
   NAVIGATION
   ════════════════════════════════════════════════════════════════════════ */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--section-px);
  gap: 24px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
  transition: background var(--transition);
}

#main-nav.scrolled {
  background: rgba(11,11,11,0.97);
  box-shadow: 0 2px 20px rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
}

/* Logo */
.nav-logo {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.nav-logo a { color: var(--text); }
.logo-accent { color: var(--accent); }

/* Nav links */
#nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}
.nav-link.active { color: var(--accent); }

/* Nav search */
.nav-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 6px 14px;
  gap: 8px;
  transition: all var(--transition);
}
.nav-search:focus-within {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.nav-search input {
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  width: 180px;
  outline: none;
}
.nav-search input::placeholder { color: var(--text-dim); }

.nav-search-icon { color: var(--text-muted); font-size: 16px; }

/* Hamburger */
#nav-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  margin-left: auto;
}
#nav-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ═══════════════════════════════════════════════════════════════════════
   HERO BANNER
   ════════════════════════════════════════════════════════════════════════ */
.hero-banner {
  position: relative;
  height: clamp(450px, 56vw, 700px);
  overflow: hidden;
  transition: opacity 0.4s ease;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: brightness(0.6);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(11,11,11,0.95) 0%, rgba(11,11,11,0.4) 55%, transparent 100%),
    linear-gradient(to top, var(--bg) 0%, transparent 35%);
}

.hero-content {
  position: absolute;
  bottom: 80px;
  left: var(--section-px);
  right: 50%;
  z-index: 2;
}

.hero-meta-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
}
.hero-badge-movie { background: var(--accent); color: #fff; }
.hero-badge-tv    { background: #0f76bf; color: #fff; }

.hero-rating { color: var(--gold); font-weight: 700; font-size: 14px; }
.hero-year   { color: var(--text-muted); font-size: 13px; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 68px);
  line-height: 1.05;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}

.hero-genres {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hero-genre {
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 3px;
}

.hero-overview {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 480px;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.hero-btn-play {
  background: var(--accent);
  color: #fff;
}
.hero-btn-play:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.hero-btn-trailer {
  background: rgba(255,255,255,0.15);
  color: #fff;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
}
.hero-btn-trailer:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-1px);
}

.hero-btn-info {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.12);
}
.hero-btn-info:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.hero-skeleton {
  height: clamp(450px, 56vw, 700px);
  background: linear-gradient(135deg, #111 0%, #1a1a1a 50%, #111 100%);
}

/* ═══════════════════════════════════════════════════════════════════════
   CONTENT SECTIONS
   ════════════════════════════════════════════════════════════════════════ */
#home-main, #sections-container {
  padding-top: 0;
}

.content-section {
  padding: 16px 0 4px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--section-px);
  margin-bottom: 10px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.section-see-all {
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.section-see-all:hover { color: var(--accent); }

.skeleton-section-title {
  width: 200px;
  height: 18px;
  border-radius: 4px;
}

/* ─── CARDS ROW (Horizontal Scroll) ──────────────────────────────────── */
.cards-row {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  padding: 4px var(--section-px) 16px;
  scrollbar-width: none;
  cursor: grab;
  scroll-snap-type: x proximity;
}
.cards-row::-webkit-scrollbar { display: none; }
.cards-row.dragging { cursor: grabbing; user-select: none; }

/* ─── CARDS GRID ─────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr));
  gap: var(--gap);
  padding: 4px var(--section-px) 20px;
}

/* ═══════════════════════════════════════════════════════════════════════
   MOVIE CARDS
   ════════════════════════════════════════════════════════════════════════ */
.movie-card {
  flex-shrink: 0;
  width: var(--card-w);
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  will-change: transform;
}

.movie-card:hover {
  transform: scale(1.12);
  box-shadow: var(--shadow-hover);
  z-index: 10;
}

/* Cards Grid items fill width */
.cards-grid .movie-card {
  width: 100%;
}

/* ─── Poster ──────────────────────────────────────────────────────────── */
.card-poster-wrap {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #0d0d0d;
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.movie-card:hover .card-poster { transform: scale(1.05); }

/* ─── Overlay ─────────────────────────────────────────────────────────── */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity var(--transition);
}
.movie-card:hover .card-overlay { opacity: 1; }

.card-play-btn, .card-trailer-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition);
}

.card-play-btn {
  background: var(--accent);
  color: #fff;
}
.card-play-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.card-trailer-btn {
  background: rgba(255,255,255,0.15);
  font-size: 16px;
  backdrop-filter: blur(4px);
}
.card-trailer-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

/* ─── Badges ──────────────────────────────────────────────────────────── */
.card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  border-radius: 3px;
  z-index: 2;
}
.badge-movie { background: var(--accent); color: #fff; }
.badge-tv    { background: #0f76bf; color: #fff; }

.card-rating {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.rating-good { background: rgba(70,211,105,0.85); color: #000; }
.rating-ok   { background: rgba(245,197,24,0.85); color: #000; }
.rating-bad  { background: rgba(229,9,20,0.85); color: #fff; }

/* ─── Card Info ───────────────────────────────────────────────────────── */
.card-info {
  padding: 6px 8px 8px;
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  line-height: 1.3;
}
.card-year {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ─── Skeleton Card ────────────────────────────────────────────────────── */
.skeleton-card .card-poster-wrap {
  aspect-ratio: 2/3;
}
.skeleton-poster {
  width: 100%;
  height: 100%;
}
.skeleton-title {
  height: 12px;
  width: 80%;
  border-radius: 3px;
  margin-bottom: 6px;
}
.skeleton-meta {
  height: 10px;
  width: 50%;
  border-radius: 3px;
}

/* ─── Skeleton Pulse ──────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #242424 50%, #1a1a1a 75%);
  background-size: 400% 100%;
  animation: skeleton-pulse 1.6s ease infinite;
}
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   TRAILER MODAL
   ════════════════════════════════════════════════════════════════════════ */
.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.trailer-modal.visible { opacity: 1; }

.trailer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
}

.trailer-container {
  position: relative;
  z-index: 1;
  width: min(900px, 95vw);
}

.trailer-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background var(--transition);
}
.trailer-close:hover { background: var(--accent); }

.trailer-iframe-wrap {
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
}
.trailer-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   INFO MODAL
   ════════════════════════════════════════════════════════════════════════ */
.info-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 60px 16px 40px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.info-modal.visible { opacity: 1; }

.info-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
}

.info-modal-container {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  background: var(--bg-modal);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}

.info-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  color: #fff;
  font-size: 18px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  transition: background var(--transition);
}
.info-modal-close:hover { background: var(--accent); }

.info-modal-hero {
  position: relative;
  height: 340px;
  overflow: hidden;
}

.info-modal-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5);
}

.info-modal-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-modal) 0%, transparent 60%);
}

.info-modal-hero-content {
  position: absolute;
  bottom: 24px;
  left: 28px;
  right: 28px;
  z-index: 2;
}

.info-modal-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 42px);
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.info-modal-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.info-rating { color: var(--gold); font-weight: 700; }

.info-modal-actions { display: flex; gap: 10px; }

.info-modal-body { padding: 20px 28px 28px; }

.info-genres {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.info-overview {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.info-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.info-cast {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.cast-item { text-align: center; }

.cast-img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 4px;
  background: #1a1a1a;
}

.cast-name {
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cast-char {
  font-size: 10px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════
   PLAYER PAGE
   ════════════════════════════════════════════════════════════════════════ */
.watch-page {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.player-section {
  background: #000;
  position: relative;
}

#player-container {
  position: relative;
  width: 100%;
}

.player-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16/9;
  max-height: 80vh;
}

.player-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
}

.player-loading {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  transition: opacity 0.3s;
}
.player-loading.hidden { opacity: 0; pointer-events: none; }

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

.player-loading-text { color: var(--text-muted); font-size: 14px; }

.player-error {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  padding: 20px;
  text-align: center;
}
.player-error.hidden { display: none; }

.player-error-icon  { font-size: 48px; }
.player-error-title { font-size: 20px; font-weight: 700; }
.player-error-msg   { color: var(--text-muted); font-size: 14px; max-width: 400px; }

.player-error-actions { display: flex; gap: 10px; margin-top: 8px; }

.player-btn {
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  color: #fff;
  transition: background var(--transition);
  border: 1px solid rgba(255,255,255,0.15);
}
.player-btn:hover { background: rgba(255,255,255,0.2); }
.player-btn-next  { background: var(--accent); border-color: var(--accent); }
.player-btn-next:hover { background: var(--accent-hover); }

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  opacity: 0;
  transition: opacity var(--transition);
}
.player-wrapper:hover .player-topbar { opacity: 1; }

.player-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.player-server-label { color: var(--text-muted); }
.player-server-name  { color: var(--accent); font-weight: 600; }

.player-topbar-right { display: flex; gap: 4px; }

.player-topbar-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.player-topbar-btn:hover { background: var(--accent); }

/* Source selector */
.source-selector-wrap {
  padding: 16px var(--section-px);
}

#source-selector {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 14px;
}

.source-selector-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 12px;
  transition: all var(--transition);
}
.source-btn:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.source-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.source-num {
  font-size: 10px;
  background: rgba(255,255,255,0.15);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.source-btn.active .source-num { background: rgba(255,255,255,0.25); }

/* Watch info section */
.watch-info {
  padding: 20px var(--section-px);
}

.watch-info-header {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.watch-poster-small {
  width: 100px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.watch-poster-small img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
}

.watch-details { flex: 1; }

.watch-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 40px);
  margin-bottom: 8px;
}

.watch-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.watch-overview {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 700px;
}

/* TV Season/Episode Selector */
.episode-section {
  padding: 0 var(--section-px) 20px;
}

.season-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
  margin-bottom: 14px;
}
.season-tabs::-webkit-scrollbar { display: none; }

.season-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.season-tab:hover { color: #fff; border-color: rgba(255,255,255,0.35); }
.season-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.episode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.episode-card:hover { border-color: rgba(255,255,255,0.15); background: #1e1e1e; }
.episode-card.active { border-color: var(--accent); background: rgba(229,9,20,0.08); }

.episode-thumb {
  width: 100px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #0d0d0d;
}
.episode-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.episode-info { flex: 1; min-width: 0; }
.episode-num  { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.episode-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episode-air  { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ═══════════════════════════════════════════════════════════════════════
   SEARCH PAGE
   ════════════════════════════════════════════════════════════════════════ */
.search-page {
  padding-top: calc(var(--nav-height) + 30px);
  min-height: 100vh;
  padding-left: var(--section-px);
  padding-right: var(--section-px);
}

.search-hero {
  text-align: center;
  padding: 40px 0 30px;
}

.search-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 60px);
  margin-bottom: 20px;
}

.search-input-wrap {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 12px 18px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); }

.search-btn {
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  transition: background var(--transition);
}
.search-btn:hover { background: var(--accent-hover); }

#search-results {
  padding-top: 20px;
}

.search-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════
   GENRE/BROWSE TABS
   ════════════════════════════════════════════════════════════════════════ */
.genre-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px var(--section-px);
  scrollbar-width: none;
}
.genre-tabs::-webkit-scrollbar { display: none; }

.genre-tab {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.genre-tab:hover { color: #fff; border-color: rgba(255,255,255,0.35); }
.genre-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════
   AD GATE MODAL
   ════════════════════════════════════════════════════════════════════════ */
#ad-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.35s ease;
  padding: 20px;
}
#ad-gate-overlay.visible { opacity: 1; }

.ad-gate-modal {
  background: #141414;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
  animation: slideUp 0.4s ease;
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.ad-gate-logo { margin-bottom: 4px; }
.ad-gate-logo .logo-text {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 1px;
}

.ad-gate-icon { font-size: 48px; margin: 10px 0; }

.ad-gate-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.ad-gate-sub {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.ad-gate-share {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.share-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--gold);
}

.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.share-whatsapp { background: #25D366; color: #000; }
.share-whatsapp:hover { filter: brightness(1.1); transform: translateY(-1px); }
.share-twitter  { background: #000; color: #fff; border-color: rgba(255,255,255,0.2); }
.share-twitter:hover { background: #1a1a1a; transform: translateY(-1px); }
.share-facebook { background: #1877F2; color: #fff; }
.share-facebook:hover { filter: brightness(1.1); transform: translateY(-1px); }
.share-copy { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.15); }
.share-copy:hover { background: rgba(255,255,255,0.15); transform: translateY(-1px); }

.ad-gate-actions { margin-top: 4px; }

.ad-gate-continue {
  width: 100%;
  padding: 13px 24px;
  border-radius: var(--radius);
  background: #333;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  transition: all var(--transition);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ad-gate-continue:disabled { cursor: not-allowed; }
.ad-gate-continue.ready {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.ad-gate-continue.ready:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-countdown { color: var(--text-dim); font-size: 13px; }

.ad-gate-note { font-size: 11px; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #222;
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  border-left: 3px solid var(--accent);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  max-width: 320px;
}
.toast.visible { opacity: 1; transform: translateX(0); }

/* ═══════════════════════════════════════════════════════════════════════
   PAGE HEADER / BROWSE HEADER
   ════════════════════════════════════════════════════════════════════════ */
.page-header {
  padding: calc(var(--nav-height) + 30px) var(--section-px) 20px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 50px);
  margin-bottom: 6px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════
   404 PAGE
   ════════════════════════════════════════════════════════════════════════ */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(80px, 15vw, 180px);
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 60px var(--accent-glow);
}

.error-title {
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 700;
  margin: 10px 0 14px;
}

.error-msg {
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.error-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  transition: all var(--transition);
}
.error-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════════════════ */
.site-footer {
  background: #080808;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 32px var(--section-px) 20px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 26px;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-links a {
  font-size: 12px;
  color: var(--text-dim);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text); }

.footer-copy {
  font-size: 11px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ════════════════════════════════════════════════════════════════════════ */
.hidden  { display: none !important; }
.visible { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.text-gold    { color: var(--gold); }
.text-green   { color: var(--green); }

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.no-results-icon  { font-size: 48px; margin-bottom: 12px; }
.no-results-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
  :root { --card-w: clamp(110px, 16vw, 160px); }
  .hero-content { right: 30%; }
}

/* Small tablet / Large mobile */
@media (max-width: 768px) {
  :root { --card-w: clamp(100px, 28vw, 145px); }

  .hero-content { right: 10px; }
  .hero-overview { display: none; }
  .hero-title { font-size: clamp(24px, 7vw, 42px); }

  #nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-height); left: 0; right: 0; background: rgba(11,11,11,0.98); padding: 12px; }
  #nav-links.open { display: flex; }
  #nav-menu-btn { display: flex; }

  .nav-search { display: none; }

  .watch-info-header { flex-direction: column; }
  .watch-poster-small { width: 80px; }

  .info-modal { padding: 10px; }
  .info-cast { grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)); }

  .episodes-grid { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --card-w: clamp(95px, 30vw, 130px);
    --gap: 6px;
  }

  .hero-banner { height: 55vw; min-height: 320px; }
  .hero-actions { gap: 6px; }
  .hero-btn { padding: 8px 14px; font-size: 12px; }
  .hero-btn-info { display: none; }

  .section-title { font-size: 14px; }

  .ad-gate-modal { padding: 24px 18px; }
  .share-buttons { gap: 6px; }

  .player-wrapper { aspect-ratio: 16/9; max-height: 56vw; min-height: 200px; }
}

/* Large screens — show more items */
@media (min-width: 1400px) {
  :root { --card-w: clamp(150px, 11vw, 200px); }
}

@media (min-width: 1800px) {
  :root { --card-w: clamp(160px, 10vw, 220px); }
}

/* ─── Scrollbar styling ───────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ─── Selection ───────────────────────────────────────────────────────── */
::selection { background: var(--accent); color: #fff; }
