/* =====================
   🎬 MOVIE / TV SITE STYLES
   ===================== */

:root {
  --bg-1: #1a1a2e;
  --bg-2: #16213e;
  --bg-3: #0f3460;
  --surface: rgba(20, 25, 40, 0.7);
  --surface-solid: #141928;
  --border: rgba(100, 200, 255, 0.2);
  --text: #eaf2ff;
  --text-dim: #8a9baa;
  --accent: #64c8ff;
  --accent-2: #f72585;
  --star: #ffc857;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

body.light {
  --bg-1: #f0f8fc;
  --bg-2: #e3f2fd;
  --bg-3: #d4e9f7;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --border: rgba(52, 152, 219, 0.22);
  --text: #14233a;
  --text-dim: #5a8fa0;
  --accent: #3498db;
  --accent-2: #e0317b;
  --star: #e0a800;
  --shadow: 0 10px 30px rgba(52, 152, 219, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Vazirmatn", "Roboto", system-ui, sans-serif;
  background: linear-gradient(-45deg, var(--bg-1), var(--bg-2), var(--bg-3), var(--bg-1));
  background-size: 400% 400%;
  animation: gradientBG 18s ease infinite;
  color: var(--text);
  min-height: 100vh;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 8px; opacity: 0.6; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(8, 10, 20, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
body.light .site-header { background: rgba(255, 255, 255, 0.65); }

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.logo span { color: var(--accent); }

.main-nav {
  display: flex;
  gap: 6px;
  margin-inline-start: 8px;
}
.main-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.95rem;
  transition: 0.2s;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--text);
  background: rgba(76, 201, 240, 0.12);
}

.header-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box input {
  width: 240px;
  max-width: 46vw;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: 0.2s;
}
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.15);
}
.search-box input::placeholder { color: var(--text-dim); }

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  transition: 0.2s;
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }

.btn-login {
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  white-space: nowrap;
  transition: 0.2s;
}
.btn-login:hover { filter: brightness(1.08); transform: translateY(-1px); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
}
.user-chip .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  padding: 48px;
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
  transition: opacity 0.6s ease;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg-1) 2%, rgba(13,13,26,0.2) 60%),
    linear-gradient(to left, transparent 40%, rgba(13,13,26,0.85) 100%);
}
body.light .hero::after {
  background:
    linear-gradient(to top, var(--bg-1) 2%, rgba(238,245,251,0.25) 60%),
    linear-gradient(to left, transparent 40%, rgba(238,245,251,0.9) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  max-width: 640px;
}
.hero__badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--accent-2);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  margin: 0 0 14px;
  line-height: 1.1;
}
.hero__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--text-dim);
  font-weight: 600;
}
.hero__meta .rating { color: var(--star); }
.hero__overview {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: 0.2s;
  font-family: inherit;
  font-size: 1rem;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
}

/* ===== Rows ===== */
.section { padding: 28px 28px 8px; }
.section__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.section__head h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}
.section__head .accent { color: var(--accent); }

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 28px 0;
}
.chip {
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s;
}
.chip:hover { color: var(--text); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

.row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  scroll-snap-type: x mandatory;
}
.row.grid {
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  overflow: visible;
}

/* ===== Card ===== */
.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.card__poster {
  aspect-ratio: 2 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--surface-solid);
}
.card__poster.placeholder {
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 2rem;
}
.card__badge {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  background: rgba(0,0,0,0.7);
  color: var(--star);
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  gap: 3px;
  align-items: center;
}
.card__type {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  background: var(--accent-2);
  color: #fff;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
}
.card__body { padding: 10px 12px 14px; }
.card__title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__year { color: var(--text-dim); font-size: 0.82rem; }

/* ===== States ===== */
.state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-dim);
}
.state h3 { color: var(--text); font-size: 1.4rem; margin-bottom: 10px; }
.state code {
  background: var(--surface-solid);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--accent);
}
.config-warning {
  margin: 24px 28px;
  padding: 18px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-2);
  background: rgba(247, 37, 133, 0.08);
  line-height: 1.8;
}
.config-warning b { color: var(--accent-2); }

.skeleton {
  border-radius: var(--radius);
  aspect-ratio: 2 / 3;
  background: linear-gradient(100deg, var(--surface) 30%, rgba(255,255,255,0.08) 50%, var(--surface) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 42px; height: 42px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 40px auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Details page ===== */
.detail-hero {
  position: relative;
  min-height: 70vh;
  padding: 60px 48px 40px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.detail-hero__bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.detail-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg-1) 4%, rgba(13,13,26,0.55) 70%);
}
body.light .detail-hero::after {
  background: linear-gradient(to top, var(--bg-1) 4%, rgba(238,245,251,0.6) 70%);
}
.detail-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.detail-poster {
  width: 240px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.detail-info { flex: 1; min-width: 280px; }
.detail-info h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 0 0 12px; }
.detail-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  color: var(--text-dim); font-weight: 600; margin-bottom: 16px;
}
.detail-meta .rating { color: var(--star); }
.genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.genre-tag {
  padding: 5px 12px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 600;
}
.tagline { font-style: italic; color: var(--accent); margin-bottom: 12px; }
.overview { line-height: 1.8; color: var(--text-dim); max-width: 760px; margin-bottom: 22px; }

.detail-section { padding: 24px 48px; }
.detail-section h2 { font-size: 1.3rem; margin: 0 0 16px; }

.cast-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 120px;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.cast-card { text-align: center; }
.cast-card img, .cast-card .ph {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin-bottom: 8px;
  background: var(--surface-solid);
}
.cast-card .ph { display: grid; place-items: center; font-size: 1.6rem; color: var(--text-dim); }
.cast-card .name { font-weight: 700; font-size: 0.85rem; }
.cast-card .role { color: var(--text-dim); font-size: 0.78rem; }

.video-wrap {
  position: relative;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.video-wrap iframe { width: 100%; height: 100%; border: 0; }

.back-link {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  color: var(--text-dim);
  font-weight: 600;
}
.back-link:hover { color: var(--accent); }

/* ===== Footer ===== */
.site-footer {
  margin-top: 40px;
  padding: 28px;
  text-align: center;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.site-footer a { color: var(--accent); }

/* ===== Detail action buttons ===== */
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.btn--download {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn--ghost { background: var(--surface); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 15, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.show { display: flex; }
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px;
  text-align: center;
  animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal .modal-icon { font-size: 2.6rem; margin-bottom: 10px; }
.modal h3 { margin: 0 0 10px; font-size: 1.3rem; }
.modal p { color: var(--text-dim); line-height: 1.8; margin: 0 0 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== Subscription page ===== */
.subscribe-hero {
  text-align: center;
  padding: 56px 24px 12px;
}
.subscribe-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 12px; }
.subscribe-hero p { color: var(--text-dim); max-width: 620px; margin: 0 auto; line-height: 1.8; }

.sub-status {
  max-width: 640px;
  margin: 20px auto 0;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: rgba(100, 200, 255, 0.08);
  text-align: center;
  font-weight: 600;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  max-width: 1000px;
  margin: 36px auto;
  padding: 0 24px;
}
.plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px 26px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.plan:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--accent); }
.plan--featured { border-color: var(--accent-2); }
.plan__tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-2);
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}
.plan h3 { font-size: 1.3rem; margin: 0 0 6px; }
.plan .price { font-size: 2.2rem; font-weight: 800; margin: 8px 0; }
.plan .price span { font-size: 0.95rem; color: var(--text-dim); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 22px; text-align: start; }
.plan li { padding: 7px 0; color: var(--text-dim); display: flex; gap: 8px; align-items: center; }
.plan li::before { content: "✓"; color: var(--accent); font-weight: 800; }
.plan .btn { margin-top: auto; width: 100%; }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .main-nav { order: 4; width: 100%; overflow-x: auto; }
  .search-box input { width: 160px; }
  .hero, .detail-hero { padding: 32px 18px; }
  .section, .detail-section { padding: 20px 16px 6px; }
  .chip-row { padding: 6px 16px 0; }
  .detail-poster { width: 160px; }
}
