/* MyFlixer3 — light theme. Deep violet #5b21b6 + coral #ff6b4a.
   Serif display headings (Georgia), system sans body. No external libs. */
:root {
  --bg: #f7f5ff;
  --surface: #ffffff;
  --surface-soft: #efeafe;
  --ink: #221a35;
  --muted: #5b5470;
  --muted-soft: #7a7390;
  --violet: #5b21b6;
  --violet-dark: #4c1d95;
  --indigo: #4338ca;
  --coral: #ff6b4a;
  --coral-dark: #e8502f;
  --orange: #f97316;
  --line: #e4def5;
  --line-strong: #cfc4ee;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 12px 32px rgba(91, 33, 182, .12);
  --shadow-sm: 0 4px 14px rgba(91, 33, 182, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(700px 320px at 85% -5%, rgba(255, 107, 74, .12), transparent 60%), radial-gradient(800px 380px at 0% 0%, rgba(91, 33, 182, .10), transparent 55%);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--violet); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
  border-radius: 8px;
}
img, svg { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-bottom: 16px; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; color: var(--ink); }
h1 { font-size: 2.3rem; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 1.6rem; margin: 0 0 12px; }
h3 { font-size: 1.1rem; }

/* ---------- Top bar ---------- */
.topbar {
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 18px rgba(91, 33, 182, .08);
  backdrop-filter: blur(6px);
}
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo { font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 9px; }
.logo:hover { text-decoration: none; color: var(--ink); }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--violet), var(--coral));
  color: #fff; font-size: 1.15rem; font-weight: 700;
}
.logo-accent { color: var(--coral); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px; }
.topbar nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--ink);
  font-weight: 600; font-size: .95rem;
}
.topbar nav a:hover { background: var(--surface-soft); color: var(--violet); text-decoration: none; }

/* ---------- Hero banner ---------- */
.hero {
  margin: 26px 0 10px;
  padding: 44px 34px 38px;
  border-radius: 28px;
  background: linear-gradient(120deg, var(--violet) 0%, var(--indigo) 55%, var(--coral) 130%);
  color: #fff;
  box-shadow: var(--shadow);
}
.hero h1 { color: #fff; font-size: 2.6rem; }
.hero p { color: #ede9fe; max-width: 640px; margin: 0 0 10px; font-size: 1.08rem; }
.hero .lede { color: #fff; font-weight: 600; }
.search-box { display: flex; gap: 10px; margin: 24px 0 6px; max-width: 660px; }
.search-box input {
  flex: 1; min-width: 0; padding: 15px 18px;
  border: 2px solid transparent; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.search-box input:focus { border-color: var(--orange); outline: none; }
.search-box input::placeholder { color: var(--muted-soft); }
button, .btn {
  background: var(--coral); color: #fff; border: 0; border-radius: 999px;
  padding: 14px 24px; font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
button:hover, .btn:hover { background: var(--coral-dark); box-shadow: 0 8px 20px rgba(232, 80, 47, .35); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(0); }

/* ---------- Full-width hero + carousel ---------- */
.hero-full {
  margin: 0 calc(50% - 50vw) 10px;
  border-radius: 0;
  padding: 44px 0 0;
}
.hero-full .hero-text { padding-bottom: 8px; }
.carousel { position: relative; margin-top: 26px; height: 380px; overflow: hidden; background: #2e1065; }
.carousel-slide {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .6s ease; pointer-events: none;
}
.carousel-slide.is-active { opacity: 1; pointer-events: auto; }
.carousel-slide a { display: block; height: 100%; color: #fff; }
.carousel-slide a:hover { text-decoration: none; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 70px 24px 26px;
  background: linear-gradient(180deg, transparent, rgba(20, 8, 45, .88));
}
.carousel-caption h3 { color: #fff; font-size: 1.6rem; margin: 0 0 4px; }
.carousel-caption p { color: #ede9fe; margin: 0; font-size: .95rem; }
.carousel-prev, .carousel-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--violet);
  font-size: 1.6rem; line-height: 1; box-shadow: var(--shadow-sm);
}
.carousel-prev { left: 18px; }
.carousel-next { right: 18px; }
.carousel-prev:hover, .carousel-next:hover { background: #fff; }
.carousel-dots {
  position: absolute; bottom: 16px; right: 22px; z-index: 2;
  display: flex; gap: 8px;
}
.carousel-dots button {
  width: 12px; height: 12px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .55); border: 0;
}
.carousel-dots button.is-active { background: var(--coral); }
@media (max-width: 640px) {
  .carousel { height: 280px; }
  .hero-full { margin-top: 18px; padding-top: 32px; }
  .carousel-caption h3 { font-size: 1.25rem; }
}

/* ---------- Genre pills ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.chip {
  background: #fff; border: 1.5px solid var(--line-strong); color: var(--violet);
  padding: 8px 16px; border-radius: 999px; font-size: .92rem; font-weight: 700;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.chip:hover { background: var(--violet); color: #fff; border-color: var(--violet); text-decoration: none; transform: translateY(-1px); }

/* ---------- Sections, tiles ---------- */
section { margin: 40px 0; }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-sm);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 20px; }
.tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile:hover, .tile:focus-within {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.tile a { color: var(--ink); display: block; }
.tile a:hover { text-decoration: none; }
.tile a:hover h3 { color: var(--violet); }
.tile-body { padding: 14px 16px 16px; }
.tile h3 { margin: 0 0 4px; font-size: 1.05rem; line-height: 1.35; }
.tile-meta { margin: 0 0 10px; color: var(--muted); font-size: .88rem; }
.tags { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--surface-soft); color: var(--violet);
  padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
}
.thumb { aspect-ratio: 2 / 3; overflow: hidden; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Featured backdrop cards (home) ---------- */
.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.featured-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 260px; display: flex; align-items: flex-end;
  background-size: cover; background-position: center;
  box-shadow: var(--shadow-sm); color: #fff;
}
.featured-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(20, 8, 45, .88));
}
.featured-card > div { position: relative; z-index: 1; padding: 20px; }
.featured-card h3 { color: #fff; font-size: 1.35rem; margin: 0 0 4px; }
.featured-card p { color: #ede9fe; margin: 0; font-size: .92rem; }
.featured-card a { color: #fff; }
.featured-card a:hover h3 { color: #ffd9cf; }

/* ---------- Detail backdrop hero ---------- */
.backdrop-hero {
  border-radius: 28px; overflow: hidden; margin: 14px 0 8px;
  background-size: cover; background-position: center 25%;
  box-shadow: var(--shadow-sm);
}
.backdrop-hero .detail-hero {
  margin: 0; border: 0; border-radius: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .96) 42%, rgba(255, 255, 255, .82) 70%, rgba(255, 255, 255, .55));
}

/* ---------- Cast list & per-title FAQ ---------- */
.cast-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.cast-list li {
  background: var(--surface-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 15px;
}
.cast-list strong { display: block; font-size: 1rem; }
.cast-list span { color: var(--muted); font-size: .92rem; }
.faq-item { margin-bottom: 16px; }
.faq-item h3 { margin-bottom: 4px; }
.faq-item p { margin: 0; }

/* ---------- Detail pages ---------- */
.crumbs { color: var(--muted); font-size: .92rem; margin: 22px 0 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--violet); }
.detail-hero {
  display: grid; grid-template-columns: 240px 1fr; gap: 28px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 28px; padding: 28px; box-shadow: var(--shadow-sm);
  margin: 14px 0 8px;
}
.detail-hero .thumb { border-radius: 16px; box-shadow: var(--shadow-sm); }
.detail-hero h1 { font-size: 2rem; }
.detail-hero .synopsis { font-size: 1.08rem; color: #3d3454; }
.facts {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.facts caption { text-align: left; padding: 13px 16px; font-weight: 700; background: var(--surface-soft); font-family: Georgia, serif; }
.facts th, .facts td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.facts th { width: 160px; color: var(--muted); font-weight: 600; }
.providers a {
  display: inline-block; background: var(--surface-soft);
  border: 1.5px solid var(--line); padding: 10px 16px; border-radius: 999px;
  margin: 4px 8px 4px 0; color: var(--violet); font-weight: 700;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.providers a:hover { background: var(--violet); color: #fff; border-color: var(--violet); text-decoration: none; transform: translateY(-1px); }
.fine { color: var(--muted); font-size: .92rem; }

/* ---------- Filters & search results ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 22px; align-items: end; }
.filters label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); font-weight: 600; }
.filters select, .filters input {
  padding: 11px 13px; border-radius: 12px; border: 1.5px solid var(--line-strong);
  background: #fff; color: var(--ink); font-size: .95rem; min-width: 150px;
}
.filters select:focus, .filters input:focus { border-color: var(--violet); outline: none; }
#search-results p { color: var(--muted); }

/* ---------- Footer ---------- */
.page-footer {
  border-top: 1px solid var(--line);
  margin-top: 56px; padding: 36px 0 30px;
  background: #fff;
}
.footer-brand { font-family: Georgia, serif; font-size: 1.25rem; font-weight: 700; margin: 0 0 6px; }
.page-footer p { color: var(--muted); }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-grid nav { display: flex; flex-wrap: wrap; gap: 6px 20px; align-content: flex-start; }
.footer-grid nav a { color: var(--muted); font-weight: 600; }
.footer-grid nav a:hover { color: var(--violet); }
.footer-note { color: var(--muted); font-size: .86rem; margin-top: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .wrap { max-width: 940px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .hero h1 { font-size: 2.3rem; }
}
@media (max-width: 640px) {
  body { line-height: 1.6; }
  .topbar-inner { padding-top: 10px; padding-bottom: 10px; gap: 8px; }
  .logo { font-size: 1.25rem; }
  .topbar nav a { padding: 7px 11px; font-size: .9rem; }
  .hero { padding: 32px 22px 28px; border-radius: 22px; margin-top: 18px; }
  .hero h1 { font-size: 1.85rem; }
  .hero p { font-size: 1rem; }
  .search-box { flex-wrap: wrap; }
  .search-box button { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 13px; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-card { min-height: 210px; }
  section { margin: 30px 0; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.35rem; }
  .detail-hero { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .detail-hero .thumb { max-width: 240px; }
  .panel { padding: 20px; }
  .facts th { width: 110px; }
  .facts th, .facts td { padding: 9px 11px; }
  .filters select, .filters input { min-width: 0; width: 100%; }
  .filters label { width: 100%; }
  .footer-grid { flex-direction: column; }
}
@media (max-width: 400px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
