/* Tema terang. Logonya neon ungu-biru di atas latar transparan - di latar gelap
   warnanya tenggelam, jadi seluruh palet dibangun dari warna logo itu sendiri. */

:root {
  /* Latar lavender lembut, bukan putih polos: diturunkan dari ungu logo supaya
     halaman terasa satu keluarga warna dengannya. Kartu dan panel dibuat putih
     agar tetap timbul di atas latar bernada itu. */
  --bg: #f3f0fd;
  --bg-soft: #e9e4fa;
  --surface: #ffffff;
  --card: #ded7f5;
  --line: #e2dbf6;
  --line-strong: #cdc3ec;
  --text: #1b1730;
  --muted: #6b6490;

  --brand: #8b3dff;      /* ungu dari logo */
  --brand-2: #1f7aff;    /* biru dari logo */
  --brand-ink: #ffffff;
  --brand-soft: #ece2ff;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(40, 20, 90, .06), 0 6px 18px rgba(40, 20, 90, .08);
}

* { box-sizing: border-box; }

/* Tidak ada yang boleh mendorong halaman melebar ke samping - tanpa ini,
   satu elemen yang kelebaran bikin logo dan tombol cari ikut terpotong. */
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- kerangka ---------- */

/* Header dan bilah kategori memakai lebar isi yang sama dengan <main> (1400px),
   supaya logo sejajar dengan kartu di bawahnya - bukan menempel di tepi layar
   sementara isinya di tengah. Garis bawahnya tetap selebar layar penuh. */
header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 240, 253, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: .35rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Logo sudah memuat tulisan "ViuStream", jadi tidak ada teks di sebelahnya.
   Ukuran ditulis di atribut width/height gambar supaya tata letak tidak
   melompat sebelum logonya selesai dimuat. */
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand img { height: 48px; width: auto; }

.search { margin-left: auto; display: flex; gap: .45rem; min-width: 0; }
.search input {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 999px;
  padding: .5rem 1rem;
  width: min(16rem, 38vw);
  min-width: 0;
  font: inherit;
}
.search button { white-space: nowrap; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.search button {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  border: 0;
  border-radius: 999px;
  padding: .5rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.search button:hover { filter: brightness(1.08); }

nav.cats {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
/* Kategorinya 14 buah. Dibiarkan turun ke baris berikutnya supaya semuanya
   terlihat utuh - sebelumnya dipaksa satu baris dan yang terakhir terpotong. */
.cats-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: .7rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
nav.cats a {
  flex: 0 0 auto;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: .85rem;
  white-space: nowrap;
}
nav.cats a:hover { color: var(--text); border-color: var(--brand); }
nav.cats a.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  border-color: transparent;
  font-weight: 600;
}
/* Di layar sempit, 14 kategori yang membungkus jadi tumpukan tinggi dan
   mendorong isi halaman terlalu jauh ke bawah - di sana digeser saja. */
@media (max-width: 700px) {
  .cats-inner { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
}

main { padding: 1.5rem 1.25rem 3rem; max-width: 1400px; margin: 0 auto; }

/* ---------- banner ---------- */

.hero {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  background: var(--card);
  aspect-ratio: 21 / 8;
  box-shadow: var(--shadow);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3rem 1.25rem 1.1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
}

/* ---------- baris & kartu ---------- */

.row { margin-bottom: 2rem; }
.row-head { margin-bottom: .75rem; }
.row-head h2 { font-size: 1.02rem; margin: 0; letter-spacing: -.01em; }
/* Deskripsi seksi dari Viu bisa berupa paragraf panjang. Dipotong satu baris
   supaya tidak mendorong tata letak dan tidak menenggelamkan judulnya. */
.row-head .desc {
  margin: .2rem 0 0;
  font-size: .82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip {
  display: flex;
  gap: .9rem;
  overflow-x: auto;
  padding: .2rem .2rem .6rem;
  scrollbar-width: thin;
}
.strip .card { flex: 0 0 168px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.1rem;
}

.card { display: block; }
.card .thumb {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .thumb { transform: translateY(-3px); outline: 2px solid var(--brand); outline-offset: 2px; }
.card .title {
  margin-top: .5rem;
  font-size: .86rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta { font-size: .75rem; color: var(--muted); }

.badge {
  position: absolute;
  top: .45rem;
  left: .45rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: .15rem .45rem;
  border-radius: 5px;
}
.ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--muted); font-size: .72rem; text-align: center; padding: .5rem;
}

/* ---------- detail seri ---------- */

.detail { display: flex; gap: 1.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.detail .poster {
  flex: 0 0 200px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  aspect-ratio: 2/3;
  box-shadow: var(--shadow);
}
.detail .poster img { width: 100%; height: 100%; object-fit: cover; }
.detail .info { flex: 1 1 320px; }
.detail h1 { font-size: 1.6rem; margin: 0 0 .6rem; letter-spacing: -.01em; }
.detail .syn { color: var(--muted); font-size: .92rem; max-width: 62ch; }

.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin: .7rem 0; }
.chip {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: #6b21c8;
  border-radius: 999px;
  padding: .22rem .75rem;
  font-size: .78rem;
  font-weight: 500;
}

.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.ep {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ep .cover { aspect-ratio: 16/9; background: var(--card); }
.ep .cover img { width: 100%; height: 100%; object-fit: cover; }
.ep .lbl { padding: .55rem .65rem; font-size: .82rem; font-weight: 500; }
.ep:hover { border-color: var(--brand); }
.ep.current { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- pemutar ---------- */

.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }

.player-bar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.player-bar label { font-size: .82rem; color: var(--muted); }
.player-bar select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: .38rem .65rem;
  font: inherit;
  font-size: .85rem;
}
.player-bar select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- lain-lain ---------- */

.note {
  background: var(--brand-soft);
  border: 1px solid #e4d5ff;
  border-left: 3px solid var(--brand);
  border-radius: 8px;
  padding: .65rem .85rem;
  font-size: .84rem;
  color: #5b21b6;
  margin-bottom: 1.25rem;
}
.state { padding: 3.5rem 1rem; text-align: center; color: var(--muted); }
.state.err { color: #b42318; }
.more {
  display: block;
  margin: 1.75rem auto 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .6rem 1.75rem;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.more:hover { border-color: var(--brand); color: var(--brand); }
.more:disabled { opacity: .6; cursor: default; }
.back { color: var(--muted); font-size: .86rem; display: inline-block; margin-bottom: .9rem; }
.back:hover { color: var(--brand); }
h1.page { font-size: 1.35rem; margin: 0 0 1.1rem; letter-spacing: -.01em; }
h2.page { font-size: 1.1rem; margin: 1.75rem 0 .9rem; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 3rem;
  background: var(--bg-soft);
  border-top: 1px solid var(--line-strong);
}

.foot-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.4fr 1fr;
  gap: 2.5rem;
}

.foot-brand img { height: 52px; width: auto; margin-bottom: .9rem; }
.foot-brand p {
  margin: 0 0 .9rem;
  color: var(--muted);
  font-size: .87rem;
  max-width: 34ch;
}
.foot-more { color: var(--brand); font-size: .87rem; font-weight: 600; }
.foot-more:hover { text-decoration: underline; }

.foot-col h3 {
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: .35rem 0 1rem;
  color: var(--text);
}
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.foot-col ul.two { grid-template-columns: 1fr 1fr; gap: .6rem 1.25rem; }
.foot-col a { color: var(--muted); font-size: .88rem; }
.foot-col a:hover { color: var(--brand); }

.foot-col ul.social a { display: flex; align-items: center; gap: .6rem; }
/* Baris yang alamatnya belum diisi: tampak nonaktif, bukan seperti tautan hidup. */
.foot-col ul.social a[href="#"] { opacity: .5; cursor: default; }
.foot-col ul.social a[href="#"]:hover { color: var(--muted); }
.foot-col ul.social svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.foot-bottom {
  border-top: 1px solid var(--line-strong);
  padding: 1rem 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .foot-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .foot-inner { grid-template-columns: 1fr; }
  .foot-col ul.two { grid-template-columns: 1fr 1fr; }
}

.skeleton {
  background: linear-gradient(90deg, var(--card), var(--bg-soft), var(--card));
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
}
@keyframes sk { to { background-position: -200% 0; } }
