/* ============================================
   ZhenDrama · style.css
   Clean · Professional · Modern
   ============================================ */

:root {
  --ink: #090b14;
  --panel: #151a29;
  --wine: #9f233e;
  --violet: #6d42f5;
  --gold: #f2bf63;
  --mist: #aeb7cb;
  --glass: rgba(10, 12, 22, .82);
  --glass-border: rgba(255, 255, 255, .08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: #090b14;
  color: #fff8ec;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
}

/* ---------- LIGHT MODE ---------- */
body.terang { background: #f5f6fa; color: #1d2136; }
body.terang .app-shell {
  background: radial-gradient(circle at 88% 4%, #ebe6ff 0%, #f5f6fa 45%, #fafbff 100%);
}
body.terang .app-shell::before { background-image: radial-gradient(rgba(0,0,0,.25) .5px, transparent .7px); }
body.terang .header-glass { background: rgba(255,255,255,.85); border-color: rgba(0,0,0,.06); }
body.terang .bottom-nav { background: rgba(255,255,255,.96); border-color: rgba(0,0,0,.06); }
body.terang .nav-item { color: #6e7191; }
body.terang .filter-kontainer,
body.terang .profil,
body.terang .daftar-pengaturan {
  background: #fff;
  border-color: #e4e7f2;
  box-shadow: 0 4px 16px rgba(0,0,0,.05);
}
body.terang .filter-label { color: #1d2136; }
body.terang .filter-tombol { background: #f0f1f7; color: #6e7191; border-color: #e4e7f2; }
body.terang .baris-pengaturan { border-color: #e4e7f2; }
body.terang .tombol-ganti span { background: #d9dce8; }
body.terang .kosong { color: #6e7191; }
body.terang .empty-state { color: #6e7191; }
body.terang .titik { background: rgba(0,0,0,.15); }

/* ---------- APP SHELL ---------- */
.app-shell {
  min-height: 100vh;
  padding-bottom: 92px;
  background: radial-gradient(circle at 88% 4%, #252041 0%, #090b14 43%, #06070c 100%);
  position: relative;
  transition: background .4s var(--ease);
}
.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  z-index: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .6) .55px, transparent .7px);
  background-size: 5px 5px;
}
.view-container { position: relative; z-index: 1; }

/* ---------- PAGE SWITCHER ---------- */
.halaman { display: none; }
.halaman.aktif {
  display: block;
  animation: pageIn .45s var(--ease) forwards;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- HEADER ---------- */
.header-glass {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border);
}
.logo-mark {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #6d42f5 0%, #9f233e 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(109, 66, 245, .35);
}
.icon-glass-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #e5e7eb;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.icon-glass-btn:hover { background: rgba(255,255,255,.12); transform: scale(1.05); }
.icon-glass-btn:active { transform: scale(.95); }
body.terang .icon-glass-btn { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.06); color: #1d2136; }

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff8ec;
  display: flex;
  align-items: center;
  gap: 8px;
}
body.terang .page-title { color: #1d2136; }

/* ---------- SEARCH DRAWER ---------- */
.search-drawer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease), opacity .3s var(--ease);
}
.search-drawer.is-open { max-height: 90px; opacity: 1; }
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  transition: border-color .25s var(--ease);
}
.search-input-wrap:focus-within { border-color: rgba(109, 66, 245, .5); }
body.terang .search-input-wrap { background: #fff; border-color: #e4e7f2; }
.search-input {
  width: 100%;
  padding: 13px 0;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}
body.terang .search-input { color: #1d2136; }
.search-input::placeholder { color: #64748b; }

/* ---------- FEATURED CAROUSEL ---------- */
.featured {
  position: relative;
  overflow: hidden;
  min-height: 340px;
}
@media (max-width: 640px) { .featured { min-height: 420px; } }

.carousel-lintasan {
  display: flex;
  transition: transform .6s var(--ease);
}
.carousel-slide {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  min-height: 340px;
  overflow: hidden;
}
@media (max-width: 640px) { .carousel-slide { min-height: 420px; } }

.carousel-slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,9,16,.98) 3%, rgba(8,9,16,.85) 48%, rgba(8,9,16,.25) 100%);
  z-index: 1;
}
@media (max-width: 640px) {
  .carousel-slide::after {
    background: linear-gradient(0deg, rgba(8,9,16,.98) 5%, rgba(8,9,16,.4) 100%);
  }
}
.featured-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.75) contrast(1.05);
}
.featured-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 340px;
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 24px;
}
@media (max-width: 640px) { .featured-copy { min-height: 420px; } }

.featured-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--gold);
  margin-bottom: 10px;
}
.featured-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  max-width: 480px;
  text-shadow: 0 4px 20px rgba(0,0,0,.5);
}
@media (min-width: 640px) { .featured-title { font-size: 38px; } }
.featured-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--mist);
  font-weight: 500;
}
.watch-featured {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 12px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6d42f5 0%, #9f233e 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(109, 66, 245, .4);
  transition: all .3s var(--ease);
}
.watch-featured:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(109, 66, 245, .55);
  filter: brightness(1.08);
}
.watch-featured:active { transform: translateY(0) scale(.97); }

/* ---------- INDICATOR ---------- */
.indikator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 18px 0 4px;
}
.titik {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  cursor: pointer;
  transition: all .35s var(--ease);
}
.titik.aktif {
  width: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #6d42f5, #9f233e);
}

/* ---------- CONTENT SECTION ---------- */
.content-section {
  max-width: 1152px;
  margin: 0 auto;
  padding: 28px 16px;
}
@media (min-width: 640px) { .content-section { padding: 32px 24px; } }

.section-header { margin-bottom: 18px; }
.section-title {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
body.terang .section-title { color: #1d2136; }
.section-bar {
  display: inline-block;
  width: 4px; height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #6d42f5, #9f233e);
}

/* ---------- POSTER CARDS ---------- */
.poster-card {
  cursor: pointer;
  transition: transform .35s var(--ease);
}
.poster-card:hover { transform: translateY(-4px); }
.poster-cover {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: 16px;
  background: #1e293b;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
}
.poster-image {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.85);
  transition: transform .5s var(--ease), filter .5s var(--ease);
}
.poster-card:hover .poster-image {
  transform: scale(1.06);
  filter: saturate(1.05);
}
.canva-tag {
  position: absolute;
  left: 8px; top: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  z-index: 2;
  backdrop-filter: blur(6px);
}
.poster-title {
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff8ec;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.terang .poster-title { color: #1d2136; }
.poster-meta {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--mist);
  font-weight: 500;
}

/* ---------- WISHLIST BTN ---------- */
.wish-btn {
  position: absolute;
  right: 8px; top: 8px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 2;
  transition: all .25s var(--ease);
}
.wish-btn:hover { transform: scale(1.12); background: rgba(0,0,0,.65); }
.wish-btn:active { transform: scale(.92); }
.wish-btn.active i { fill: #f43f5e; color: #f43f5e; }
.wish-btn i { transition: .25s var(--ease); }

/* ---------- FILTER KATALOG ---------- */
.filter-kontainer {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 26px;
  backdrop-filter: blur(10px);
}
.filter-blok + .filter-blok { margin-top: 16px; }
.filter-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff8ec;
  margin-bottom: 10px;
}
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-tombol {
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  color: var(--mist);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: all .3s var(--ease);
}
.filter-tombol:hover { background: rgba(255,255,255,.1); }
.filter-tombol.aktif {
  background: linear-gradient(135deg, #6d42f5 0%, #9f233e 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(109, 66, 245, .35);
  transform: scale(1.02);
}

/* ---------- DETAIL HERO ---------- */
.detail-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #0f172a;
}
@media (min-width: 640px) { .detail-hero { aspect-ratio: 21/9; } }
.detail-hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .35;
  filter: blur(8px) saturate(.8);
  transform: scale(1.08);
}
.detail-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, #090b14 10%, rgba(9,11,20,.8) 50%, transparent 100%);
}
.detail-hero-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  max-width: 1152px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 16px 22px;
}
@media (min-width: 640px) {
  .detail-hero-content { gap: 24px; padding: 0 24px 26px; }
}
.detail-poster {
  width: 108px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 45px rgba(0,0,0,.5);
  flex-shrink: 0;
}
@media (min-width: 640px) { .detail-poster { width: 150px; } }
.detail-info { padding-bottom: 6px; min-width: 0; }
.detail-genre {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: linear-gradient(135deg, #6d42f5, #9f233e);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  margin-bottom: 10px;
}
.detail-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 4px 16px rgba(0,0,0,.5);
}
@media (min-width: 640px) { .detail-title { font-size: 34px; } }
.detail-meta-info {
  margin-top: 8px;
  font-size: 13px;
  color: var(--mist);
  font-weight: 500;
}

/* ---------- EPISODE LIST ---------- */
.episode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(21, 26, 41, .9);
  border: 1px solid rgba(255,255,255,.05);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: all .3s var(--ease);
  animation: episodeIn .4s var(--ease) both;
}
body.terang .episode-item { background: #fff; border-color: #e4e7f2; box-shadow: 0 3px 12px rgba(0,0,0,.04); }
.episode-item:hover {
  background: rgba(109, 66, 245, .1);
  border-color: rgba(109, 66, 245, .35);
  transform: translateX(4px);
}
@keyframes episodeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.episode-item:nth-child(1) { animation-delay: .02s; }
.episode-item:nth-child(2) { animation-delay: .04s; }
.episode-item:nth-child(3) { animation-delay: .06s; }
.episode-item:nth-child(4) { animation-delay: .08s; }
.episode-item:nth-child(5) { animation-delay: .10s; }
.episode-item:nth-child(6) { animation-delay: .12s; }
.episode-item:nth-child(7) { animation-delay: .14s; }
.episode-item:nth-child(8) { animation-delay: .16s; }
.episode-item:nth-child(9) { animation-delay: .18s; }
.episode-item:nth-child(10) { animation-delay: .20s; }

.episode-icon {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(109, 66, 245, .18), rgba(159, 35, 62, .18));
  color: #a784ff;
  flex-shrink: 0;
}
.episode-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
body.terang .episode-info h4 { color: #1d2136; }
.episode-info p {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
}

/* ---------- SIMPAN / PENGATURAN ---------- */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--mist);
  font-size: 14px;
}

.profil {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}
.profil-ava {
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d42f5 0%, #9f233e 100%);
  color: #fff;
  box-shadow: 0 8px 22px rgba(109, 66, 245, .4);
}
.profil h4 { font-size: 15px; font-weight: 700; color: #fff; }
body.terang .profil h4 { color: #1d2136; }
.profil p { font-size: 13px; color: var(--mist); margin-top: 2px; }

.daftar-pengaturan {
  border-radius: 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.baris-pengaturan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 14px;
  font-weight: 500;
  color: #fff8ec;
}
body.terang .baris-pengaturan { color: #1d2136; }
.baris-pengaturan:last-child { border-bottom: none; }

.tombol-ganti {
  position: relative;
  display: inline-block;
  width: 46px; height: 26px;
}
.tombol-ganti input { opacity: 0; width: 0; height: 0; }
.tombol-ganti span {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.15);
  border-radius: 999px;
  cursor: pointer;
  transition: background .3s var(--ease);
}
.tombol-ganti span::before {
  content: "";
  position: absolute;
  left: 3px; top: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform .3s var(--ease);
}
.tombol-ganti input:checked + span {
  background: linear-gradient(135deg, #6d42f5 0%, #9f233e 100%);
}
.tombol-ganti input:checked + span::before {
  transform: translateX(20px);
}

/* ---------- BOTTOM NAV ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 40;
  background: rgba(14, 17, 30, .94);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-top: 1px solid rgba(255,255,255,.08);
}
.nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 480px;
  margin: 0 auto;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 0 13px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #8f99ae;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color .3s var(--ease);
  position: relative;
}
.nav-item i { transition: transform .3s var(--ease); }
.nav-item.is-active { color: #a784ff; }
.nav-item.is-active i { transform: translateY(-2px) scale(1.1); }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 22px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, #6d42f5, #9f233e);
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translate(-50%, 14px);
  padding: 12px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6d42f5 0%, #9f233e 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  box-shadow: 0 16px 40px -8px rgba(109, 66, 245, .6);
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- UTILITY ---------- */
.content-hidden { display: none !important; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #6d42f5, #9f233e);
  border-radius: 8px;
}