/* ═══════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════ */
:root {
  --bg:        #0a0a0f;
  --surface:   #141420;
  --surface2:  #1c1c2e;
  --border:    rgba(255,255,255,.07);
  --text:      #f0f0f5;
  --muted:     #7a7a9a;
  --red:       #e50914;
  --red2:      #ff3b3b;
  --gold:      #f5c518;
  --radius:    10px;
  --nav-h:     60px;
  --font-body: 'Barlow', sans-serif;
  --font-cond: 'Barlow Condensed', sans-serif;
  --font-disp: 'Bebas Neue', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; }
img { display: block; }

/* ═══════════════════════════════════════════
   NAV
═══════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: linear-gradient(to bottom, rgba(10,10,15,.98) 0%, rgba(10,10,15,.0) 100%);
  transition: background .3s;
}
.nav.scrolled { background: rgba(10,10,15,.97); border-bottom: 1px solid var(--border); }
.nav-left  { display: flex; align-items: center; gap: 28px; }
.nav-right { display: flex; align-items: center; gap: 12px; }

.nav-logo {
  font-family: var(--font-disp);
  font-size: 26px; letter-spacing: 1px;
  color: var(--red); cursor: pointer;
  user-select: none;
}

.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links li a {
  padding: 6px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: rgba(240,240,245,.7);
  cursor: pointer; transition: all .15s;
}
.nav-links li a:hover,
.nav-links li a.active { color: var(--text); background: rgba(255,255,255,.07); }

/* Search */
.search-wrap { position: relative; }
.search-icon-btn {
  background: none; padding: 6px; border-radius: 50%;
  color: var(--text); transition: background .15s;
  display: flex; align-items: center;
}
.search-icon-btn:hover { background: rgba(255,255,255,.1); }
.search-input-wrap {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: none; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; width: 260px;
}
.search-input-wrap.open { display: flex; }
.search-input-icon { padding: 0 10px; color: var(--muted); }
.search-input-wrap input {
  flex: 1; padding: 9px 12px 9px 0;
  background: none; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 13px;
}
.search-input-wrap input::placeholder { color: var(--muted); }
#searchResults {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 420px; overflow-y: auto;
  display: none; z-index: 200;
}
#searchResults.open { display: block; }
.sr-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer; transition: background .12s;
}
.sr-item:hover { background: rgba(255,255,255,.06); }
.sr-thumb {
  width: 36px; height: 54px; object-fit: cover;
  border-radius: 4px; background: var(--surface); flex-shrink: 0;
}
.sr-info { flex: 1; min-width: 0; }
.sr-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-year  { font-size: 11px; color: var(--muted); margin-top: 2px; }

.btn-subscribe {
  padding: 7px 16px; border-radius: 6px;
  background: var(--red); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  transition: background .15s;
}
.btn-subscribe:hover { background: var(--red2); }

.nav-profile1 { display: flex; align-items: center; }
.nav-profile1 img { opacity: .75; transition: opacity .15s; cursor: pointer; }
.nav-profile1 img:hover { opacity: 1; }

/* ═══════════════════════════════════════════
   HERO SLIDER
═══════════════════════════════════════════ */
.hero {
  position: relative;
  height: 92vh; min-height: 520px;
  overflow: hidden;
  margin-top: 0;
}
.hero-slides { position: relative; width: 100%; height: 100%; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .8s ease;
  background-size: cover; background-position: center top;
}
.hero-slide.active { opacity: 1; }
.hero-slide::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(10,10,15,.92) 0%, rgba(10,10,15,.55) 50%, transparent 100%),
              linear-gradient(to top, rgba(10,10,15,1) 0%, transparent 40%);
}
.hero-content {
  position: absolute;
  bottom: 120px; left: 60px;
  max-width: 520px;
  z-index: 2;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 4px;
  background: var(--red); font-size: 10px;
  font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-title {
  font-family: var(--font-disp);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1; letter-spacing: 1px;
  margin-bottom: 12px;
  text-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.hero-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: rgba(240,240,245,.7);
  margin-bottom: 16px;
}
.hero-rating { color: var(--gold); font-weight: 700; }
.hero-overview {
  font-size: 14px; line-height: 1.65;
  color: rgba(240,240,245,.8);
  margin-bottom: 24px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; align-items: center; }
.btn-watch {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 6px;
  background: #fff; color: #000;
  font-size: 15px; font-weight: 700;
  transition: background .15s; border: none;
}
.btn-watch:hover { background: rgba(255,255,255,.85); }
.btn-watch-outline {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 6px;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 15px; font-weight: 600; border: none;
  backdrop-filter: blur(4px); transition: background .15s;
}
.btn-watch-outline:hover { background: rgba(255,255,255,.25); }

.hero-dots {
  position: absolute; bottom: 80px; left: 60px;
  display: flex; gap: 8px; z-index: 3;
}
.hero-dot {
  width: 8px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.3);
  transition: all .3s; cursor: pointer;
}
.hero-dot.active { width: 24px; background: var(--red); }

/* ═══════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════ */
.main-content { padding: 0 40px 60px; }
@media (max-width: 768px) { .main-content { padding: 0 16px 60px; } }

/* ── Section / Rail ── */
.section { margin-bottom: 32px; }
.section-title {
  font-family: var(--font-cond);
  font-size: 20px; font-weight: 700; letter-spacing: .5px;
  margin-bottom: 14px; text-transform: uppercase;
}
.rail-outer { position: relative; overflow: hidden; }
.rail {
  display: flex; gap: 10px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-fade-r {
  position: absolute; right: 0; top: 0; bottom: 8px;
  width: 80px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
}

/* Card */
.card {
  flex-shrink: 0;
  width: 140px; border-radius: 8px;
  overflow: hidden; cursor: pointer;
  background: var(--surface);
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.card:hover { transform: scale(1.06); box-shadow: 0 12px 40px rgba(0,0,0,.6); z-index: 2; }
.card-poster {
  width: 100%; aspect-ratio: 2/3;
  object-fit: cover; display: block;
  background: var(--surface2);
}
.card-info { padding: 8px; }
.card-title {
  font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-year { font-size: 11px; color: var(--muted); margin-top: 2px; }
.card-rating {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,.8); border-radius: 4px;
  padding: 2px 5px; font-size: 10px; font-weight: 700;
  color: var(--gold);
}
.card-type {
  position: absolute; top: 6px; left: 6px;
  background: var(--red); border-radius: 4px;
  padding: 2px 6px; font-size: 9px; font-weight: 700; letter-spacing: .5px;
}

/* ── Continue Watching card ── */
.cw-card {
  flex-shrink: 0; width: 200px; border-radius: 8px;
  overflow: hidden; cursor: pointer;
  background: var(--surface); position: relative;
  transition: transform .2s, box-shadow .2s;
}
.cw-card:hover { transform: scale(1.04); box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.cw-thumb {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover; background: var(--surface2);
}
.cw-progress {
  height: 3px; background: rgba(255,255,255,.15);
}
.cw-bar { height: 100%; background: var(--red); }
.cw-info { padding: 8px; }
.cw-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cw-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-70%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.6); border: 2px solid rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; opacity: 0; transition: opacity .15s;
}
.cw-card:hover .cw-play { opacity: 1; }

/* ── Language tabs ── */
.lang-section { margin-bottom: 32px; }
.lang-title {
  font-family: var(--font-cond);
  font-size: 20px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 14px;
}
.lang-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.lang-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .3px;
  transition: all .15s; border: 1px solid var(--border);
}
.lang-tab:hover { transform: translateY(-2px); border-color: var(--red); }
.lt-icon { font-size: 16px; }
.lang-tab.hindi   { background: linear-gradient(135deg, #ff6b35, #f7c59f); color: #000; }
.lang-tab.english { background: linear-gradient(135deg, #1e3a8a, #3b82f6); color: #fff; }
.lang-tab.telugu  { background: linear-gradient(135deg, #7c3aed, #c4b5fd); color: #fff; }
.lang-tab.tamil   { background: linear-gradient(135deg, #065f46, #34d399); color: #fff; }
.lang-tab.kannada { background: linear-gradient(135deg, #92400e, #fbbf24); color: #000; }
.lang-tab.more    { background: linear-gradient(135deg, #881337, #fb7185); color: #fff; }

/* ── Genre filter ── */
.genre-filter { margin-bottom: 32px; }
.genre-title {
  font-family: var(--font-cond);
  font-size: 20px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; margin-bottom: 14px;
}
.genre-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-chip {
  padding: 7px 16px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.genre-chip:hover { background: var(--red); border-color: var(--red); }

/* ── Promo hero ── */
.promo-hero {
  position: relative; height: 360px;
  border-radius: 16px; overflow: hidden;
  margin-bottom: 32px;
  background-size: cover; background-position: center;
}
.promo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(10,10,15,.92) 30%, rgba(10,10,15,.3) 100%);
}
.promo-content {
  position: relative; z-index: 2;
  padding: 40px 48px;
  height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
}
.promo-title {
  font-family: var(--font-disp);
  font-size: 48px; line-height: 1; letter-spacing: 1px;
  margin-bottom: 4px;
}
.promo-sub {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
}
.hero-sub-icon { font-size: 14px; }

/* ── Download section ── */
.download-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px; margin-bottom: 40px;
  text-align: center;
}
.download-title {
  font-family: var(--font-disp);
  font-size: 36px; margin-bottom: 12px;
}
.download-sub {
  font-size: 14px; color: var(--muted);
  max-width: 480px; margin: 0 auto 24px; line-height: 1.6;
}
.download-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.store-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); transition: all .15s;
}
.store-btn:hover { border-color: var(--text); transform: translateY(-2px); }
.store-btn-icon { font-size: 24px; }
.store-btn-text { display: flex; flex-direction: column; align-items: flex-start; }
.store-btn-sub  { font-size: 10px; color: var(--muted); }
.store-btn-name { font-size: 15px; font-weight: 700; }

/* ═══════════════════════════════════════════
   SEARCH / GENRE PAGE
═══════════════════════════════════════════ */
.search-page {
  display: none;
  padding: calc(var(--nav-h) + 24px) 40px 60px;
  min-height: 100dvh;
}
.search-page.visible { display: block; }
.search-page-title {
  font-family: var(--font-disp);
  font-size: 42px; margin-bottom: 6px;
}
.search-page-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-bg {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.85);
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  width: 100%; max-width: 800px;
  background: var(--surface);
  border-radius: 14px; overflow: hidden;
  position: relative; max-height: 90dvh; overflow-y: auto;
}
.modal-top { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.modal-backdrop-img {
  width: 100%; height: 100%; object-fit: cover;
  background: var(--surface2);
}
.modal-top-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--surface) 0%, transparent 60%);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  border: none; z-index: 2; transition: background .15s;
}
.modal-close:hover { background: rgba(0,0,0,.95); }
.modal-body { padding: 20px 28px 28px; }
.modal-title { font-family: var(--font-disp); font-size: 34px; line-height: 1.1; margin-bottom: 10px; }
.modal-meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.modal-meta .r { color: var(--gold); font-weight: 700; }
.modal-genres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-genre-tag {
  padding: 3px 10px; border-radius: 4px;
  background: rgba(255,255,255,.08); font-size: 11px; font-weight: 600;
}
.modal-overview { font-size: 14px; color: rgba(240,240,245,.8); line-height: 1.7; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-play {
  padding: 12px 28px; border-radius: 6px;
  background: #fff; color: #000;
  font-size: 14px; font-weight: 700; border: none; transition: background .15s;
}
.modal-play:hover { background: rgba(255,255,255,.85); }
.modal-info {
  padding: 12px 24px; border-radius: 6px;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 14px; font-weight: 600; border: none; transition: background .15s;
}
.modal-info:hover { background: rgba(255,255,255,.25); }
.modal-loading {
  display: none; align-items: center; gap: 8px;
  margin-top: 14px; font-size: 13px; color: var(--muted);
}
.modal-loading.show { display: flex; }
.sm-spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.no-stream-msg { display: none; font-size: 13px; color: var(--red); margin-top: 10px; }
.no-stream-msg.show { display: block; }

/* ═══════════════════════════════════════════
   PLAYER
═══════════════════════════════════════════ */
.player-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 400;
  background: #000; flex-direction: column;
}
.player-overlay.open { display: flex; }
.player-header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
  background: rgba(0,0,0,.9); border-bottom: 1px solid var(--border);
}
.player-back {
  padding: 7px 14px; border-radius: 6px;
  background: rgba(255,255,255,.1); color: #fff;
  font-size: 13px; font-weight: 600; border: none;
  transition: background .15s;
}
.player-back:hover { background: rgba(255,255,255,.2); }
.player-title { font-size: 14px; font-weight: 600; }
.player-wrap { flex: 1; position: relative; }
#playerIframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%; border: none;
}
.player-nosrc {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
}
.player-nosrc-icon { font-size: 48px; }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
footer {
  padding: 32px 40px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-bottom: 16px;
}
.footer-links a {
  font-size: 12px; color: var(--muted); transition: color .15s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 20px;
  font-size: 13px; color: var(--text);
  pointer-events: none; opacity: 0;
  transition: opacity .2s; z-index: 999;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ═══════════════════════════════════════════
   LOADING SKELETON
═══════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 768px) {
  .hero-content { bottom: 90px; left: 20px; right: 20px; }
  .hero-dots     { left: 20px; bottom: 60px; }
  .hero-title    { font-size: 34px; }
  .nav-links     { display: none; }
  .main-content  { padding: 0 16px 40px; }
  .search-page   { padding: calc(var(--nav-h) + 20px) 16px 40px; }
  .promo-content { padding: 24px; }
  .promo-title   { font-size: 32px; }
}
