/* =========================================================
 *  CINEMÀU — Editorial Cinema Theme
 *  Display: Montserrat (uppercase, bold) · Body: Inter
 * ========================================================= */

:root {
  --bg:           #0b0a0a;
  --bg-soft:      #110f0e;
  --bg-elev:      #181513;
  --surface:      #1f1c19;
  --surface-2:    #2a2520;
  --border:       #2e2823;
  --border-soft:  #221d19;
  --text:         #f3ebd8;
  --text-dim:     #c5b8a3;
  --text-muted:   #8a7e6e;
  --accent:       #f5b031;
  --accent-soft:  #fbc858;
  --accent-deep:  #c98a18;
  --danger:       #e85d4a;
  --success:      #6ab04c;
  --shadow-lg:    0 30px 60px -20px rgba(0,0,0,.75);
  --shadow-md:    0 10px 30px -10px rgba(0,0,0,.55);
  --radius:       14px;
  --radius-sm:    8px;
  --ease:         cubic-bezier(.22,.61,.36,1);
  --header-h:     72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(245,176,49,.05), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(232,93,74,.04), transparent 55%);
  min-height: 100vh;
}

/* Grain overlay for cinematic feel */
body::before {
  content:""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .35; mix-blend-mode: overlay;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font: inherit; }

.serif { font-family: 'Montserrat', sans-serif; font-weight: 400; letter-spacing: -.01em; }

/* =========================================================
 *  Header & Nav
 * ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: rgba(11,10,10,.72);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 28px;
  height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  white-space: nowrap;
}
.brand-mark {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(245,176,49,.6);
  animation: pulse 2.6s ease-in-out infinite;
  font-size: 18px;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }
.brand-name { font-style: normal; }

.primary-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link {
  position: relative;
  padding: 8px 14px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-dim);
  border-radius: 999px;
  transition: color .2s var(--ease), background .2s var(--ease);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.04); }
.caret { display: inline-block; font-size: 10px; transform: translateY(-1px); opacity: .7; }

.nav-dropdown { position: relative; }
.nav-trigger { display: inline-flex; align-items: center; gap: 6px; }
.dropdown-panel {
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 460px; padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.dropdown-panel.narrow { min-width: 240px; }
.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
}
.dropdown-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.dropdown-grid a {
  display: block; padding: 8px 12px;
  font-size: 13px; color: var(--text-dim);
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.dropdown-grid a:hover { background: var(--surface); color: var(--accent); }

/* Search */
.search-wrap { position: relative; width: 320px; }
.search-form {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 14px;
  transition: border-color .2s, background .2s;
}
.search-form:focus-within {
  border-color: var(--accent);
  background: var(--bg-elev);
}
.search-icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-form input {
  flex: 1; border: 0; background: transparent;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  font-size: 13.5px;
}
.search-form input::placeholder { color: var(--text-muted); }
.search-clear {
  font-size: 22px; line-height: 1;
  color: var(--text-muted);
  padding: 0 4px;
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.search-clear.is-visible { opacity: 1; pointer-events: auto; }
.search-clear:hover { color: var(--text); }

.search-results {
  position: absolute; top: calc(100% + 10px); right: 0; left: 0;
  max-height: 480px; overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 110;
}
.search-results::-webkit-scrollbar { width: 6px; }
.search-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.search-result {
  display: flex; gap: 12px; padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .15s;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result.is-active { background: var(--surface); }
.search-result-thumb {
  width: 46px; height: 64px; flex-shrink: 0;
  border-radius: 4px; object-fit: cover;
  background: var(--surface-2);
}
.search-result-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.search-result-title { font-weight: 500; color: var(--text); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.search-result-meta .dot { color: var(--accent); margin: 0 6px; }
.search-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.search-loading { padding: 24px; text-align: center; color: var(--accent); font-size: 13px; }
.search-view-all {
  display: block; padding: 12px;
  text-align: center; font-size: 12.5px;
  color: var(--accent); border-top: 1px solid var(--border);
  letter-spacing: .05em; text-transform: uppercase; font-weight: 600;
}
.search-view-all:hover { background: var(--surface); }

.mobile-toggle { display: none; flex-direction: column; gap: 4px; padding: 6px; }
.mobile-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* =========================================================
 *  Layout primitives
 * ========================================================= */
.site-main { position: relative; z-index: 2; }
.container { max-width: 1440px; margin: 0 auto; padding: 0 28px; }

.section { padding: 56px 0 8px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px; gap: 20px;
}
.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
  margin: 0;
}
.section-title em { color: var(--accent); font-style: normal; }
.section-link {
  font-size: 12.5px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .12em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.section-link:hover { color: var(--accent); border-color: var(--accent); }

/* =========================================================
 *  Hero Slider — dùng CSS grid stack để slides tự cao theo nội dung
 * ========================================================= */
.hero-slider {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 16px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.hero-slide {
  grid-column: 1; grid-row: 1;   /* tất cả slides cùng 1 ô grid → stack lên nhau */
  position: relative;
  min-height: 480px;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: opacity .9s var(--ease), visibility .9s;
}
.hero-slide.is-active {
  opacity: 1; visibility: visible;
  pointer-events: auto;
  z-index: 2;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 25%;                          /* lệch lên trên — giữ mặt diễn viên rõ */
  filter: brightness(.6) saturate(1.15) contrast(1.15);     /* boost contrast → perceived sharper */
  will-change: auto;
}
.hero-slide::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 30%, var(--bg) 95%),
    linear-gradient(90deg, rgba(11,10,10,.85) 0%, rgba(11,10,10,.4) 50%, transparent 100%);
  z-index: 1;
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 1440px; margin: 0 auto; width: 100%;
  padding: 80px 28px 80px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; align-items: center;
}

/* Slider controls */
.hero-controls {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex; align-items: center; gap: 16px;
}
.hero-nav {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s var(--ease);
  font-family: 'Inter', sans-serif;
}
.hero-nav:hover {
  background: var(--accent);
  color: #1a1206;
  border-color: var(--accent);
  transform: scale(1.05);
}
.hero-dots { display: flex; gap: 8px; }
.hero-dot {
  width: 32px; height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 2px;
  transition: width .4s var(--ease), background .3s;
  position: relative;
  overflow: hidden;
  padding: 0;
}
.hero-dot:hover { background: rgba(255,255,255,.4); }
.hero-dot.is-active {
  width: 64px;
  background: rgba(255,255,255,.2);
}
.hero-dot.is-active::after {
  content: ""; position: absolute; inset: 0;
  background: var(--accent);
  transform-origin: left;
  animation: dotProgress 7s linear forwards;
}
.hero-slider.is-paused .hero-dot.is-active::after { animation-play-state: paused; }
@keyframes dotProgress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: .25em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px;
}
.hero-eyebrow::before { content: "—"; }
.hero-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.02;
  margin: 0 0 14px;
  letter-spacing: -.01em;
  text-shadow: 0 2px 14px rgba(0,0,0,.55);
}
.hero-title em { color: var(--accent); font-style: normal; }
.hero-original {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 17px;
  color: var(--text-muted);
  letter-spacing: .02em;
  margin-bottom: 22px;
}
.hero-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 22px;
}
.hero-meta .chip {
  padding: 4px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
}
.hero-meta .chip.accent { background: var(--accent); color: #1a1206; border-color: var(--accent); font-weight: 600; }
.hero-desc {
  font-size: 15.5px; color: var(--text-dim);
  max-width: 600px; margin-bottom: 28px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  letter-spacing: .02em;
  transition: transform .15s var(--ease), background .2s, color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #1a1206; }
.btn-primary:hover { background: var(--accent-soft); }
.btn-ghost { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid rgba(255,255,255,.1); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn svg { width: 16px; height: 16px; }

/* Hero poster (right) */
.hero-poster {
  position: relative;
  aspect-ratio: 2/3;
  max-width: 360px; justify-self: end;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
  transition: transform .4s var(--ease);
}
.hero-poster:hover { transform: rotate(0) scale(1.02); }
.hero-poster img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
 *  Movie Grid + Card
 * ========================================================= */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);   /* desktop: chính xác 5 cột → 10 phim = 5+5 */
  gap: 28px 20px;
}

.movie-card {
  position: relative;
  display: block;
  transition: transform .25s var(--ease);
}
.movie-card:hover { transform: translateY(-4px); }

.movie-card-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.movie-card-poster img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease), filter .25s;
}
.movie-card:hover .movie-card-poster img { transform: scale(1.06); filter: brightness(.7); }

.movie-card-poster::after {
  content:""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.65) 100%);
}
.movie-card-badges {
  position: absolute; top: 10px; left: 10px; right: 10px;
  display: flex; justify-content: space-between; gap: 6px;
  z-index: 2;
}
.badge {
  padding: 4px 8px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  border-radius: 4px;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,.55);
  color: var(--text);
}
.badge.quality { background: var(--accent); color: #1a1206; }
.badge.episode { background: rgba(0,0,0,.55); color: var(--accent-soft); }

/* Source pill ở góc dưới poster (S1/S2/S3) */
.source-pill {
  position: absolute;
  bottom: 8px; left: 8px;
  z-index: 2;
  padding: 3px 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 9.5px; font-weight: 700;
  letter-spacing: .08em;
  border-radius: 4px;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,.65);
  color: var(--text);
}
.source-pill.src-nguonc { color: #f5b031; }   /* Server 1 — vàng accent */
.source-pill.src-ophim  { color: #6ab0ff; }   /* Server 2 — xanh dương */
.source-pill.src-kkphim { color: #ad8bff; }   /* Server 3 — tím */

/* Badge nhỏ trong live search dropdown */
.search-source-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px; font-weight: 700;
  letter-spacing: .08em;
  border-radius: 3px;
  background: rgba(255,255,255,.06);
  vertical-align: middle;
}
.search-source-badge.src-nguonc { color: #f5b031; }
.search-source-badge.src-ophim  { color: #6ab0ff; }
.search-source-badge.src-kkphim { color: #ad8bff; }

.movie-card-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s var(--ease);
  z-index: 3;
}
.movie-card:hover .movie-card-play { opacity: 1; }
.movie-card-play span {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 30px rgba(245,176,49,.5);
  transform: scale(.7);
  transition: transform .3s var(--ease);
}
.movie-card:hover .movie-card-play span { transform: scale(1); }
.movie-card-play svg { width: 22px; height: 22px; color: #1a1206; margin-left: 3px; }

.movie-card-body { padding: 12px 2px 0; }
.movie-card-title {
  font-size: 14.5px; font-weight: 500;
  color: var(--text);
  margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.35;
  transition: color .2s;
}
.movie-card:hover .movie-card-title { color: var(--accent); }
.movie-card-sub {
  font-family: 'Inter', sans-serif; font-style: italic; font-weight: 400;
  font-size: 12.5px; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

/* =========================================================
 *  Movie Detail
 * ========================================================= */
.detail-hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
}
.detail-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center top;
  filter: brightness(.3) blur(2px);
  transform: scale(1.1);
}
.detail-hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, var(--bg) 95%),
    linear-gradient(90deg, var(--bg) 0%, transparent 60%);
}
.detail-hero-inner {
  position: relative; z-index: 2;
  max-width: 1440px; margin: 0 auto;
  padding: 80px 28px 40px;
  display: grid; grid-template-columns: 320px 1fr; gap: 48px;
}
.detail-poster {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 2/3;
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }

.detail-eyebrow {
  display: inline-block;
  font-size: 11.5px; letter-spacing: .25em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.detail-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.05;
  margin: 0 0 8px;
  letter-spacing: -.01em;
  text-shadow: 0 2px 14px rgba(0,0,0,.55);
}
.detail-original {
  font-family: 'Inter', sans-serif; font-style: italic; font-weight: 400;
  color: var(--text-muted); font-size: 17px;
  margin-bottom: 22px;
}
.detail-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.detail-info {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 6px 16px; font-size: 13.5px;
  margin-bottom: 24px;
}
.detail-info dt { color: var(--text-muted); font-weight: 500; }
.detail-info dd { color: var(--text-dim); margin: 0; }
.detail-info .tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-info .tag-list a {
  padding: 2px 10px;
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  transition: all .15s;
}
.detail-info .tag-list a:hover { color: var(--accent); border-color: var(--accent); }
.detail-desc {
  font-size: 15px;
  color: var(--text-dim);
  max-width: 720px;
  margin-bottom: 24px;
}

/* Player */
.player-section { padding: 32px 0 64px; }
.player-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.player-wrap video, .player-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-preview {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: brightness(.5) saturate(1.1) contrast(1.1);
}
.player-preview::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,.6) 100%);
}
.player-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: var(--text-muted);
  background: radial-gradient(circle at center, var(--bg-elev), #000);
}
.player-placeholder svg { width: 64px; height: 64px; color: var(--accent); opacity: .8; }
.player-placeholder p { margin: 0; font-family: 'Inter', sans-serif; font-style: italic; font-weight: 400; font-size: 16px; color: var(--text-dim); }

.server-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 24px 0 16px;
}

/* Source tabs (Server 1 / Server 2 — cấp 1) */
.source-tabs {
  display: flex; gap: 4px;
  margin: 24px 0 12px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
}

/* Hint nhỏ dưới server tabs */
.source-hint-note {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 20px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(245, 176, 49, .06);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
}
.source-hint-note svg {
  width: 14px; height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}
.source-tab {
  padding: 10px 24px;
  font-size: 13px; font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  border-radius: 999px;
  transition: all .2s var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.source-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.source-tab.is-active {
  background: var(--accent);
  color: #1a1206;
  box-shadow: 0 4px 18px rgba(245,176,49,.25);
}
.source-tab.is-unavailable {
  opacity: .55;
}
.source-tab.is-unavailable .unavailable-mark {
  color: var(--danger);
  font-size: 11px;
}
.source-tab.is-unavailable.is-active {
  background: var(--surface-2);
  color: var(--text-muted);
  box-shadow: none;
}

/* Empty state khi source không có phim */
.source-empty {
  padding: 60px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 16px;
}
.source-empty .empty-mark {
  font-size: 40px;
  color: var(--danger);
  margin-bottom: 12px;
}
.source-empty h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -.01em;
  font-size: 18px;
  color: var(--text);
  margin: 0 0 8px;
}
.source-empty p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

/* Source switcher (embed vs m3u8) */
.source-switcher {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.source-label {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.source-btn {
  padding: 6px 14px;
  font-size: 12.5px; font-weight: 500;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  transition: all .15s;
}
.source-btn:hover { color: var(--text); border-color: var(--text-muted); }
.source-btn.is-active {
  background: var(--accent); color: #1a1206;
  border-color: var(--accent); font-weight: 600;
}
.source-hint {
  font-size: 12px; color: var(--text-muted);
  font-style: italic; margin-left: auto;
}
.server-tab {
  padding: 8px 18px;
  font-size: 13px; font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 999px;
  transition: all .15s;
}
.server-tab:hover { color: var(--text); border-color: var(--border); }
.server-tab.is-active { background: var(--accent); color: #1a1206; border-color: var(--accent); font-weight: 600; }

.episode-section h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px; font-weight: 700; margin: 16px 0 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.episode-btn {
  padding: 10px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-dim);
  transition: all .15s var(--ease);
  text-align: center;
}
.episode-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-muted); }
.episode-btn.is-active {
  background: var(--accent); color: #1a1206;
  border-color: var(--accent); font-weight: 600;
  box-shadow: 0 4px 18px rgba(245,176,49,.3);
}

/* =========================================================
 *  Cast & Crew section
 * ========================================================= */
.cast-section {
  padding: 24px 0 80px;
}
.cast-block { margin-bottom: 48px; }
.cast-block:last-child { margin-bottom: 0; }
.cast-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* Crew row — đạo diễn, biên kịch, etc */
.crew-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.crew-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s, transform .2s var(--ease);
}
.crew-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.crew-avatar {
  width: 48px; height: 48px;
  border-radius: 50%; overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.crew-avatar img { width: 100%; height: 100%; object-fit: cover; }
.crew-avatar.no-image::before {
  content: attr(data-init);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--text-muted);
}
.crew-avatar.no-image span {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; font-size: 18px;
  color: var(--text-muted);
}
.crew-meta { min-width: 0; }
.crew-name {
  font-size: 13.5px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crew-role {
  font-size: 11.5px;
  color: var(--accent);
  text-transform: uppercase; letter-spacing: .08em;
  font-weight: 600;
  margin-top: 2px;
}

/* Cast grid — diễn viên (chip card với avatar tròn) */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.cast-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: border-color .2s, transform .2s var(--ease);
}
.cast-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.cast-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-bottom: 10px;
}
.cast-avatar img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s var(--ease);
}
.cast-card:hover .cast-avatar img { transform: scale(1.08); }
.cast-avatar .cast-initial {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 32px;
  color: var(--text-muted);
}
.cast-meta { width: 100%; min-width: 0; }
.cast-name {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.3;
}
.cast-character {
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-size: 11.5px;
  color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.35;
}
.cast-more {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

@media (max-width: 1200px) {
  .cast-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 920px) {
  .cast-grid { grid-template-columns: repeat(4, 1fr); }
  .cast-avatar { width: 72px; height: 72px; }
}
@media (max-width: 640px) {
  .cast-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cast-avatar { width: 64px; height: 64px; }
  .crew-row { grid-template-columns: repeat(2, 1fr); }
}
.listing-header {
  padding: 60px 0 24px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 32px;
}
.listing-eyebrow {
  display: inline-block;
  font-size: 11.5px; letter-spacing: .25em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 12px;
}
.listing-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.01em;
  margin: 0 0 12px;
}
.listing-count { color: var(--text-muted); font-size: 14px; }

/* Empty state */
.empty-state {
  padding: 80px 20px; text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-mark { font-size: 60px; color: var(--accent); opacity: .35; margin-bottom: 12px; }
.empty-state h3 { font-family: 'Montserrat', sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; font-size: 22px; color: var(--text); margin: 0 0 8px; }

/* =========================================================
 *  Pagination
 * ========================================================= */
.pagination {
  display: flex; justify-content: center;
  flex-wrap: wrap; gap: 6px;
  padding: 48px 0 80px;
}
.page-item {
  min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px;
  font-size: 13px; font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  transition: all .15s;
}
.page-item:hover { color: var(--accent); border-color: var(--accent); }
.page-item.is-active {
  background: var(--accent); color: #1a1206;
  border-color: var(--accent); font-weight: 600;
}
.page-gap { color: var(--text-muted); padding: 0 4px; align-self: center; }

/* =========================================================
 *  Footer
 * ========================================================= */
.site-footer {
  position: relative; z-index: 2;
  margin-top: 40px;
  padding: 60px 0 24px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border-soft);
}
.footer-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 0 28px;
  display: grid; grid-template-columns: 1.2fr 2fr; gap: 60px;
}
.footer-tagline { color: var(--text-muted); font-style: italic; font-family: 'Inter', sans-serif; font-size: 14px; margin: 10px 0 0; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h4 {
  font-size: 12px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px; font-weight: 600;
}
.footer-cols a {
  display: block; padding: 4px 0;
  font-size: 13.5px; color: var(--text-dim);
  transition: color .15s;
}
.footer-cols a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1440px; margin: 40px auto 0;
  padding: 24px 28px 0;
  border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-muted);
}

/* =========================================================
 *  Responsive
 * ========================================================= */
@media (max-width: 1200px) {
  .movie-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1100px) {
  .primary-nav .nav-link:not(.nav-trigger):nth-child(n+5) { display: none; }
}
@media (max-width: 920px) {
  .primary-nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--border); padding: 12px; }
  .primary-nav.is-open { display: flex; }
  .nav-link { padding: 12px 16px; border-radius: 8px; }
  .dropdown-panel { position: static; box-shadow: none; min-width: 0; opacity: 1; visibility: visible; transform: none; padding: 8px; }
  .dropdown-grid { grid-template-columns: repeat(2,1fr); }
  .mobile-toggle { display: flex; }
  .search-wrap { width: 200px; }
  .movie-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; padding: 60px 28px 90px; }
  .hero-poster { max-width: 200px; justify-self: start; }
  .hero-slide { min-height: 0; }
  .hero-nav { display: none; }
  .hero-controls { bottom: 20px; gap: 0; }
  .detail-hero-inner { grid-template-columns: 1fr; }
  .detail-poster { max-width: 240px; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .footer-cols { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; gap: 12px; }
  .brand-name { display: none; }
  .container { padding: 0 16px; }
  .search-wrap { width: auto; flex: 1; }
  .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .section { padding: 40px 0 8px; }
  .footer-inner, .footer-bottom { padding-left: 16px; padding-right: 16px; }
}

/* Fade-in animation for grids */
.fade-in { animation: fadeInUp .5s var(--ease) both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.movie-grid > * { animation: fadeInUp .4s var(--ease) both; }
.movie-grid > *:nth-child(1)  { animation-delay: .02s; }
.movie-grid > *:nth-child(2)  { animation-delay: .04s; }
.movie-grid > *:nth-child(3)  { animation-delay: .06s; }
.movie-grid > *:nth-child(4)  { animation-delay: .08s; }
.movie-grid > *:nth-child(5)  { animation-delay: .10s; }
.movie-grid > *:nth-child(6)  { animation-delay: .12s; }
.movie-grid > *:nth-child(7)  { animation-delay: .14s; }
.movie-grid > *:nth-child(8)  { animation-delay: .16s; }
.movie-grid > *:nth-child(n+9){ animation-delay: .18s; }
