/* ========== SFlix Professional Styles v8 ========== */
:root {
  --bg: #0b0e14;
  --bg-soft: #12151c;
  --surface: #1a1f2b;
  --surface-2: #222833;
  --border: rgba(255,255,255,0.08);
  --text: #ffffff;
  --muted: #9ca3af;
  --primary: #00acc1;
  --primary-hover: #00c4db;
  --accent: #f59e0b;
  --radius: 12px;
  --header-h: 64px;
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }


/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  z-index: 1000;
  background: #12151c;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
}
.logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 0;
}
.logo img {
  height: 36px;
  width: auto;
  display: block;
}
.logo .logo-s {
  background: linear-gradient(135deg, #00e5ff, #00acc1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #c5cad3;
  transition: all 0.2s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.nav-link:hover { color: #fff; }
.nav-link.active,
.nav-item-dropdown.active > .nav-link {
  color: #fff;
  border-color: rgba(0,172,193,0.7);
  background: rgba(0,172,193,0.12);
}
.nav-link .caret {
  width: 12px;
  height: 12px;
  opacity: 0.8;
}

.nav-item-dropdown { position: relative; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #1a1f2b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 12px;
  min-width: 180px;
  z-index: 1100;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  flex-direction: column;
  gap: 2px;
}
.nav-dropdown.genres-grid {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px 18px;
  padding: 18px 20px;
  min-width: 420px;
  width: 440px;
}
.nav-item-dropdown:hover .nav-dropdown,
.nav-item-dropdown.open .nav-dropdown {
  display: flex;
}
.nav-item-dropdown:hover .nav-dropdown.genres-grid,
.nav-item-dropdown.open .nav-dropdown.genres-grid {
  display: grid;
}
.nav-dropdown a {
  padding: 8px 12px;
  font-size: 13.5px;
  color: #cfd3dc;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-dropdown a:hover {
  color: #00acc1;
  background: rgba(0,172,193,0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.search-box {
  position: relative;
  width: 200px;
}
.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #9ca3af;
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  background: #fff;
  border: none;
  border-radius: 24px;
  color: #111;
  font-size: 13px;
  outline: none;
}
.search-box input::placeholder { color: #9ca3af; }

.icon-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  background: transparent;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); }
.icon-btn svg { width: 22px; height: 22px; }

/* Mobile search expand bar */
.mobile-search-bar {
  display: none;
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  z-index: 999;
  background: #12151c;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mobile-search-bar.show { display: block; }
.mobile-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0 12px;
}
.mobile-search-form svg { color: #9ca3af; flex-shrink: 0; }
.mobile-search-form input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
}
.mobile-search-form button {
  color: #9ca3af;
  font-size: 16px;
  padding: 8px;
}

/* ===== MOBILE MENU ===== */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
}
.mobile-menu-overlay.show { display: block; }

.mobile-menu {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 300px;
  max-width: 86vw;
  background: #12151c;
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.28s ease;
  box-shadow: 8px 0 32px rgba(0,0,0,0.45);
  overflow: hidden;
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mobile-menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
  background: rgba(255,255,255,0.04);
}
.mobile-nav-link:hover,
.mobile-nav-link.active { background: #00acc1; color: #fff; }
.mobile-nav-link .arrow {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.mobile-nav-link.open .arrow { transform: rotate(180deg); }
.mobile-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 6px 8px;
}
.mobile-submenu.show { display: flex; }
.mobile-submenu a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #9ca3af;
}
.mobile-submenu a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.mobile-menu-cta { padding: 12px 12px 20px; }
.mobile-menu-cta a {
  display: block;
  text-align: center;
  padding: 13px;
  background: #00acc1;
  color: #fff;
  font-weight: 700;
  border-radius: 30px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .nav { display: none !important; }
  .desktop-search { display: none !important; }
  .icon-btn { display: flex !important; }
  .header-inner { gap: 12px; padding: 0 14px; }
}
@media (min-width: 901px) {
  .mobile-search-btn,
  .menu-toggle { display: none !important; }
  .mobile-menu { visibility: hidden; pointer-events: none; }
  .mobile-menu-overlay { display: none !important; }
  .mobile-search-bar { display: none !important; }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 82vh;
  min-height: 480px;
  max-height: 720px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  z-index: 0;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 45%),
              linear-gradient(to right, rgba(0,0,0,0.85) 0%, transparent 55%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 70px;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.badge {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}
.badge-type, .badge-hd { background: var(--accent); color: #000; }
.badge-imdb, .badge-year, .badge-runtime { background: rgba(255,255,255,0.12); color: #fff; }
.hero-title {
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 12px;
  max-width: 640px;
}
.hero-overview {
  max-width: 520px;
  font-size: 14.5px;
  color: #d1d5db;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* ===== SECTIONS & CARDS ===== */
.section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 36px 20px 16px;
}
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  position: relative;
  padding-left: 12px;
  margin-bottom: 18px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 4px;
  background: var(--primary);
  border-radius: 2px;
}
.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.22s, box-shadow 0.22s;
}
.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow);
}
.card-poster {
  aspect-ratio: 2/3;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}
.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
}
.card-info { padding: 10px; }
.card-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.card-rating { color: var(--accent); }

/* ===== LISTING PAGE ===== */
.page-hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 20px 10px;
}
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.listing-meta { color: var(--muted); font-size: 13px; }
.listing-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px 40px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 0 10px;
  flex-wrap: wrap;
}
.pagination button {
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination button:not(:disabled):hover { background: rgba(255,255,255,0.18); }
.pagination .page-num {
  padding: 10px 20px;
  border-radius: 24px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

/* ===== DETAIL ===== */
.detail-hero {
  position: relative;
  min-height: 70vh;
  padding: 100px 0 40px;
}
.detail-hero .hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
}
.detail-hero .hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 5%, transparent 50%),
              linear-gradient(to right, rgba(11,14,20,0.92) 15%, transparent 70%);
}
.detail-main {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}
.detail-poster-wrap {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.08);
}
.detail-poster-wrap img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
}
.detail-info h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 6px;
}
.detail-tagline {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 12px;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-overview {
  font-size: 14.5px;
  color: #d1d5db;
  max-width: 620px;
  margin-bottom: 20px;
  line-height: 1.7;
}
.genre-tags, .genres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.genre-tag {
  padding: 5px 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  font-size: 12.5px;
}
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-buttons a {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.share-fb { background: #1877f2; }
.share-tw { background: #1da1f2; }
.share-wa { background: #25d366; }
.share-tg { background: #0088cc; }
.share-rd { background: #ff4500; }

.info-cards {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.info-card .label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 6px;
}
.info-card .value { font-size: 13px; font-weight: 600; }

.cast-section, .related-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px 30px;
}
.cast-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
}
.cast-card { text-align: center; }
.cast-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--surface);
}
.cast-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-character { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.season-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.season-tab {
  padding: 9px 16px;
  background: var(--surface);
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}
.season-tab.active, .season-tab:hover { background: var(--primary); color: #fff; }
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.episode-card {
  background: var(--surface);
  border-radius: 10px;
  display: flex;
  gap: 12px;
  padding: 10px;
  transition: background 0.2s;
}
.episode-card:hover { background: var(--surface-2); }
.episode-still {
  width: 110px;
  aspect-ratio: 16/9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-soft);
  flex-shrink: 0;
}
.episode-info h4 { font-size: 13px; margin-bottom: 3px; }
.episode-info p {
  font-size: 11.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 40px 20px 24px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}
.footer-logo { margin-bottom: 10px; line-height: 0; }
.footer-logo img { height: 34px; width: auto; display: block; }
.footer-desc { font-size: 13px; color: var(--muted); max-width: 280px; line-height: 1.6; }
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  max-width: 1400px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.loading { display: flex; justify-content: center; padding: 50px; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.search-results {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 20px 40px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .nav { display: none !important; }
  .menu-toggle { display: flex !important; }
  .search-box { width: 140px; }
  .detail-main { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .detail-poster-wrap { max-width: 180px; margin: 0 auto; }
  .detail-overview { text-align: left; margin-left: auto; margin-right: auto; }
  .detail-meta, .genre-tags, .share-buttons { justify-content: center; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .hero { height: 70vh; min-height: 400px; }
  .card-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
}

@media (min-width: 901px) {
  .menu-toggle { display: none !important; }
  /* Keep mobile menu off-screen on desktop - never show in page flow */
  .mobile-menu { visibility: hidden; pointer-events: none; }
  .mobile-menu-overlay { display: none !important; }
}

@media (max-width: 500px) {
  .card-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .search-box { width: 110px; }
  .header-inner { padding: 0 12px; gap: 10px; }
  .logo { font-size: 22px; }
  .info-cards { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* ===== LISTING PAGE - match reference design ===== */
.page-hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 24px 8px;
}
.page-hero .section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.page-hero .section-title,
.listing-title {
  font-size: 1.55rem;
  font-weight: 700;
  padding-left: 0;
  margin-bottom: 0;
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}
.page-hero .section-title::before {
  display: none;
}
.page-hero .section-title::after,
.listing-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.listing-meta {
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 10px;
}
.listing-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px 20px;
}

/* Cards - slightly more polished */
.card {
  border-radius: 14px;
  background: #151922;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.04);
}
.card-badge {
  background: #eab308;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
  top: 10px;
  right: 10px;
}
.card-info {
  padding: 12px 12px 14px;
}
.card-title {
  font-size: 13.5px;
  font-weight: 600;
}
.card-meta {
  margin-top: 4px;
  font-size: 12px;
}
.card-rating {
  color: #eab308;
}

/* Pagination - pill style like reference */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 0 28px;
}
.pagination button {
  padding: 11px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  background: #2a3140;
  color: #e5e7eb;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.pagination button:hover:not(:disabled) {
  background: #3a4255;
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination .page-num {
  padding: 11px 22px;
  border-radius: 24px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

/* Full footer */
.footer {
  background: #0e1118;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 48px 24px 20px;
  margin-top: 20px;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.footer-logo span { color: #fff; }
.footer-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 280px;
  margin-bottom: 8px;
}
.footer-disclaimer {
  font-size: 11px;
  color: #6b7280;
  max-width: 280px;
  line-height: 1.5;
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 9px;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  max-width: 1400px;
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.footer-social {
  display: flex;
  gap: 10px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}
.footer-social a:hover { background: var(--primary); }

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .page-hero { padding: 90px 16px 8px; }
  .listing-section { padding: 16px; }
}
@media (max-width: 500px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* Episode picker next to Watch Now */
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}
.ep-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ep-picker select {
  appearance: none;
  background: #1a1f2b;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 11px 36px 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.ep-picker select:focus {
  border-color: var(--primary);
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.episode-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: #151922;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s, transform 0.2s;
}
.episode-card:hover { background: #1c2230; transform: translateY(-2px); }
.episode-card.active-ep {
  border-color: var(--primary);
  background: rgba(0,172,193,0.12);
}
.episode-still {
  width: 110px;
  height: 62px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #0b0e14;
}
.episode-info h4 { font-size: 13px; margin-bottom: 4px; }
.episode-info p {
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 600px) {
  .episode-card { flex-direction: column; gap: 8px; padding: 8px; }
  .episode-still {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
  }
}

/* CHOOSE EPISODE box */
.choose-ep-box {
  margin-top: 18px;
  max-width: 420px;
  background: rgba(10,14,22,0.55);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px 20px 22px;
}
.choose-ep-box h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.choose-ep-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.choose-ep-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.choose-ep-field select {
  width: 100%;
  appearance: none;
  background: #0b0e14;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 36px 12px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.choose-ep-meta {
  margin: 12px 0 16px;
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.4;
}
.choose-ep-box .btn { border-radius: 28px; padding: 12px 26px; }

/* Mobile: 2-column episode tiles (watch + series detail) */
@media (max-width: 700px) {
  .watch-episodes .episodes-grid,
  .episodes-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .watch-episodes .episode-card,
  .episodes-grid .episode-card {
    flex-direction: column !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    gap: 6px !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .watch-episodes .episode-still,
  .episodes-grid .episode-still {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9 !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    display: block !important;
  }
  .watch-episodes .episode-info,
  .episodes-grid .episode-info {
    min-width: 0;
    padding: 0 2px 6px;
  }
  .watch-episodes .episode-info h4,
  .episodes-grid .episode-info h4 {
    font-size: 12px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .watch-episodes .episode-info p,
  .episodes-grid .episode-info p {
    font-size: 11px !important;
    -webkit-line-clamp: 1 !important;
  }
  .watch-layout { grid-template-columns: 1fr !important; }
  .player-servers .servers-row { gap: 6px; }
  .server-btn { padding: 8px 12px; font-size: 12px; }
  .player-frame { aspect-ratio: 16/9; max-width: 100%; }
  .player-frame iframe { max-width: 100%; }
  img { max-width: 100%; height: auto; }
}

.search-box { position: relative; }
.search-suggest {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 280px;
  background: #1a1f2b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  z-index: 2000;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.search-suggest.show { display: block; }
.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #e5e7eb;
  font-size: 13px;
}
.suggest-item:hover { background: rgba(255,255,255,0.06); }
.suggest-item img, .suggest-ph {
  width: 36px; height: 52px; object-fit: cover; border-radius: 4px; background: #0b0e14; flex-shrink: 0;
}
.suggest-item span { display: flex; flex-direction: column; min-width: 0; }
.suggest-item b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item small { color: #9ca3af; font-size: 11px; }
.suggest-item.muted { color: #9ca3af; }
.suggest-item.more { justify-content: center; color: #00acc1; font-weight: 600; }

.watch-notice {
  margin-top: 14px;
  font-size: 14px;
  color: #cfd3dc;
  line-height: 1.5;
}
.watch-notice .warn { color: var(--primary); font-weight: 700; }

.search-tabs {
  display: flex;
  background: #1a1f2b;
  border-radius: 24px;
  padding: 4px;
  gap: 2px;
}
.search-tab {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #9ca3af;
  background: transparent;
}
.search-tab.active { background: #00acc1; color: #fff; }

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.mobile-icon-btn {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 0;
  cursor: pointer;
}
.mobile-icon-btn svg { width: 20px; height: 20px; }

#mobile-search-bar {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  z-index: 1200;
  background: #12151c;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  align-items: center;
  gap: 8px;
}
#mobile-search-bar.show { display: flex !important; }
#mobile-search-bar form {
  flex: 1;
  display: flex;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
}
#mobile-search-bar input {
  flex: 1; min-width: 0;
  border: 0; outline: 0;
  padding: 10px 14px;
  font-size: 14px;
  color: #111;
}
#mobile-search-bar .ms-go {
  width: 42px; background: #00acc1; border: 0; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
#mobile-search-bar .ms-x {
  width: 36px; height: 36px; border: 0; background: transparent; color: #fff; font-size: 22px;
}

.nav-item-dropdown { position: relative; }
.genres-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 520px;
  background: #161b26;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 22px 18px 16px;
  margin-top: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 16px;
  z-index: 1200;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.genres-dropdown::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -16px;
  height: 16px;
}
.nav-item-dropdown:hover .genres-dropdown,
.nav-item-dropdown.open .genres-dropdown {
  display: grid;
}
.genres-dropdown a {
  padding: 8px 6px;
  font-size: 14px;
  color: #d1d5db;
  border-radius: 6px;
}
.genres-dropdown a:hover { color: #00acc1; }

.mobile-genres-list {
  display: none;
  padding: 4px 8px 10px 18px;
  flex-direction: column;
  gap: 2px;
}
.mobile-genres-list.show { display: flex; }
.mobile-genres-list a {
  padding: 10px 12px;
  font-size: 14px;
  color: #cfd3dc;
  border-radius: 8px;
}
.mobile-nav-link .caret { margin-left: auto; }

@media (max-width: 900px) {
  .header .search-box { display: none !important; }
  .mobile-icon-btn, .menu-toggle { display: flex !important; }
  .nav { display: none !important; }
}
@media (min-width: 901px) {
  .mobile-icon-btn { display: none !important; }
  #mobile-search-bar { display: none !important; }
}

/* Mobile: always 2 poster columns */
@media (max-width: 900px) {
  .card-row,
  #listing-grid,
  #search-results.card-row,
  #trending-movies,
  #latest-movies,
  #popular-tv,
  #related-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

.legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 110px 20px 60px;
}
.legal-page h1 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 16px;
}
.legal-page > p {
  color: #d1d5db;
  line-height: 1.7;
  margin-bottom: 20px;
}
.legal-card {
  background: #151922;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.legal-card h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.legal-card p, .legal-card li {
  color: #9ca3af;
  line-height: 1.65;
  font-size: 14px;
}
.legal-card ul { padding-left: 18px; }
.legal-card a { color: var(--primary); font-weight: 600; }

.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s ease;
  display: flex;
  align-items: flex-end;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 45%),
              linear-gradient(to right, rgba(0,0,0,0.85) 0%, transparent 55%);
}
.hero-slide .hero-content { position: relative; z-index: 2; }
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-prev { left: 16px; }
.hero-next { right: 16px; }
.hero-nav:hover { background: var(--primary); }
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 8px;
}
.hero-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
}
.hero-dot.active { background: var(--primary); width: 22px; border-radius: 8px; }
@media (max-width: 700px) {
  .hero-nav { width: 36px; height: 36px; font-size: 24px; }
  .hero-prev { left: 8px; }
  .hero-next { right: 8px; }
}
