/* ============================================================
   BOSH SAHIFA — HERO
   ============================================================ */
.hero {
  position: relative;
  /* Ekran balandligining bir qismi — lekin juda cho'zilib ketmasin */
  min-height: min(62vh, 520px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}
/* Ikki qatlamli gradient: pastdan matn uchun, chapdan o'qish uchun */
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--surface-0) 2%, transparent 55%),
    linear-gradient(to right, rgba(11, 13, 18, 0.92) 0%, rgba(11, 13, 18, 0.4) 45%, transparent 75%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-block: var(--space-12);
}
.hero-body { max-width: 560px; }

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.hero-meta .dot { color: var(--text-tertiary); }

.hero-plot {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-6);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* Hero slayder nuqtalari */
.hero-dots {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-8);
}
.hero-dot {
  width: 24px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: background var(--duration-base) var(--ease),
              width var(--duration-base) var(--ease);
}
.hero-dot.is-active { background: var(--brand); width: 36px; }

/* ============================================================
   RAIL (gorizontal film qatori)
   ============================================================ */
.rail { position: relative; }
.rail-track {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding-bottom: var(--space-2);
}
.rail-track::-webkit-scrollbar { display: none; }
.rail-track > .card {
  flex: none;
  width: 168px;
  scroll-snap-align: start;
}

.rail-nav {
  display: flex;
  gap: var(--space-2);
}
.rail-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
}
.rail-btn:hover { background: var(--surface-3); color: var(--text-primary); }
.rail-btn:disabled { opacity: 0.3; cursor: default; }

/* ============================================================
   GRID (qidiruv / sevimlilar natijalari)
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-5) var(--space-4);
}

/* ============================================================
   JANR FILTRI
   ============================================================ */
.filter-bar {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: var(--space-1);
}
.filter-bar::-webkit-scrollbar { display: none; }

/* Hero'dan keyin darhol keladigan bo'lim — ortiqcha bo'shliqsiz */
.hero + .section { padding-top: var(--space-8); }

/* ============================================================
   FILM SAHIFASI (Kinopoisk uslubi — ma'lumotga boy)
   ============================================================ */
.movie-hero {
  position: relative;
  padding-top: var(--space-10);
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-8);
  overflow: hidden;
}
/* Fon rasmi faqat yuqori qismni qoplaydi — pastda toza sirt qoladi,
   shunda ma'lumot jadvali fonda "cho'kib" ketmaydi. */
.movie-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 420px;
  z-index: 0;
  /* transform: scale(1.08) tufayli rasm konteynerdan chetga chiqadi.
     Kesib tashlamasak, gradient qoplamagan yorqin chiziq bo'lib qoladi. */
  overflow: hidden;
}
.movie-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: blur(3px);
  transform: scale(1.08);
  opacity: 0.5;
}
.movie-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Gradient rasmning eng pastigacha to'liq fon rangiga yetishi shart.
     Aks holda rasmning yorqin bo'lagi keskin gorizontal chiziq bo'lib
     ko'rinadi (fon tugagan joyda). */
  background: linear-gradient(
    to bottom,
    rgba(11, 13, 18, 0.5) 0%,
    rgba(11, 13, 18, 0.72) 40%,
    rgba(11, 13, 18, 0.94) 78%,
    var(--surface-0) 100%
  );
}

.movie-back {
  position: relative;
  z-index: 1;
  margin-bottom: var(--space-5);
}

/* Poster (chap) + ma'lumot (o'ng) */
.movie-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-10);
  align-items: start;
}

.movie-poster {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}
.movie-poster img { width: 100%; height: 100%; object-fit: cover; }

.movie-title {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: var(--leading-tight);
}
.movie-subtitle {
  margin-top: var(--space-1);
  font-size: var(--text-base);
  color: var(--text-tertiary);
}

/* Reyting bloki — IMDb, Metacritic yonma-yon */
.movie-ratings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-top: var(--space-5);
}
.rating-block { display: flex; flex-direction: column; gap: 2px; }
.rating-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rating-label {
  font-size: var(--text-2xs);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.movie-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-6);
}

.movie-plot {
  margin-top: var(--space-6);
  max-width: 68ch;
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

/* Ma'lumot jadvali (yil, davlat, rejissyor...) — Kinopoisk uslubi */
.info-table {
  margin-top: var(--space-6);
  display: grid;
  gap: var(--space-3);
}
.info-row {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: var(--space-4);
  font-size: var(--text-sm);
  align-items: baseline;
}
.info-key { color: var(--text-tertiary); }
.info-value { color: var(--text-primary); }
.info-value a { color: var(--text-primary); }
.info-value a:hover { color: var(--brand); }

/* ---------------- Aktyorlar ---------------- */
.people-rail { display: flex; gap: var(--space-4); overflow-x: auto; scrollbar-width: none; }
.people-rail::-webkit-scrollbar { display: none; }

/* Bo'lim tanlagichlari: rejissyor / ssenariy / aktyorlar / aktrisalar.
   Tanlangan bo'lim quyidagi bitta gorizontal qatorda ko'rsatiladi. */
.crew-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  scrollbar-width: none;
}
.crew-tabs::-webkit-scrollbar { display: none; }
.crew-tabs .chip { flex: none; }

.chip-count {
  margin-left: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  opacity: 0.6;
}

.person {
  flex: none;
  width: 108px;
  text-align: center;
}
.person-photo {
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-2);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--surface-2);
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-photo-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-tertiary);
}
.person-name {
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: var(--leading-snug);
}
.person-role {
  font-size: var(--text-2xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ---------------- Kadrlar galereyasi ---------------- */
.stills-rail { display: flex; gap: var(--space-3); overflow-x: auto; scrollbar-width: none; }
.stills-rail::-webkit-scrollbar { display: none; }
.still {
  flex: none;
  width: 280px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  transition: transform var(--duration-base) var(--ease);
}
.still:hover { transform: scale(1.02); }
.still img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- Lightbox ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
}
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}
.lightbox-close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-primary);
}

/* ============================================================
   MODAL
   ============================================================ */

/* Obuna tariflari */
.plan {
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-top: var(--space-4);
}
.plan.is-featured { border-color: var(--brand-border); background: var(--brand-subtle); }
.plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.plan-name { font-weight: 700; font-size: var(--text-base); }
.plan-price { font-size: var(--text-sm); color: var(--text-secondary); }
.plan-features {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .movie-hero-inner { grid-template-columns: 200px 1fr; gap: var(--space-6); }
}

@media (max-width: 720px) {
  .hero { min-height: min(58vh, 440px); }
  .hero-media img { object-position: center 20%; }
  .hero-title { font-size: var(--text-2xl); }
  .hero-meta { font-size: var(--text-xs); }
  .hero-plot { -webkit-line-clamp: 2; font-size: var(--text-sm); }
  .hero-actions .btn { flex: 1; }
  .hero-dots { margin-top: var(--space-5); }

  .movie-hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .movie-poster {
    width: 140px;
    margin-inline: auto;
  }
  .movie-title { text-align: center; }
  .movie-subtitle { text-align: center; }
  .movie-ratings { justify-content: center; }
  .movie-actions .btn { flex: 1; }

  .info-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .rail-track > .card { width: 132px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--space-4) var(--space-3); }
  .still { width: 232px; }
}
