/* Căn Phòng Chiếu — Cinematic Black & Gold */
/* Token nguồn gốc: design system Stitch (docs/stitch-export/design-system-cinematic-black-gold.md) */
/* Phần 1/9: token thiết kế, reset, khung trang, header, nút. */
/* Thứ tự nạp (cascade) của bộ: base → hero → cards → movie → watch → account → categories → search → chrome → motion. */
/* Căn Phòng Chiếu — Cinematic Black & Gold */
/* Token nguồn gốc: design system Stitch (docs/stitch-export/design-system-cinematic-black-gold.md) */
:root {
  color-scheme: dark;         /* widget gốc (select, file, date) theo giao diện tối */
  --bg: #131313;              /* background / surface */
  --bg-secondary: #0e0e0e;    /* surface-container-lowest — header, footer, panel */
  --surface: #201f1f;         /* surface-container */
  --card: #1c1b1b;            /* surface-container-low — thẻ phim */
  --interactive: #2a2a2a;     /* surface-container-high — nút phụ, hover */
  --gold: #ffb800;            /* primary-container — CTA */
  --gold-bright: #ffdca1;     /* primary — brand, hover CTA */
  --gold-deep: #ffba20;       /* primary-fixed-dim — điểm nhấn phụ */
  --on-gold: #6b4c00;         /* on-primary-container — chữ trên nền vàng */
  --text: #e5e2e1;            /* on-surface */
  --text-secondary: #d5c4ab;  /* on-surface-variant */
  --text-muted: #9e8f78;      /* outline — metadata */
  --border: #514532;          /* outline-variant — viền ấm */
  --graphite: #353534;        /* surface-variant / container-highest — placeholder, divider đậm */
  --success: #4caf80;
  --error: #ffb4ab;           /* error — chữ/viền lỗi trên nền tối */
  --error-strong: #93000a;    /* error-container — nền fill lỗi */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --gutter: 1.5rem;
  --margin: 3rem;
  --header-h: 64px;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* Cấm double-tap zoom + xoá delay 300ms của tap (pinch bị chặn ở meta
     viewport + gesture events trong /js/motion.js — yêu cầu chủ sở hữu 29/11) */
  touch-action: manipulation;
  /* Cột dọc: header — main (co giãn) — footer luôn sát chân trang */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0; }

.icon { vertical-align: -0.25em; flex-shrink: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 14, 14, 0.8);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.site-header-inner {
  max-width: none;
  margin: 0;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}
.brand { display: flex; align-items: center; color: var(--text); }
.brand-logo {
  height: 40px;
  width: auto;
  display: block;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.brand-tag {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
}

.main-nav { display: flex; gap: 4px; margin-left: var(--space-md); }
.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.nav-link:hover { color: var(--text); background: var(--interactive); }
.nav-link.is-active { color: var(--on-gold); background: var(--gold); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-md); }
.header-account { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); }
.header-account:hover { color: var(--text); }
.header-username { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 32px; height: 32px;
  flex-shrink: 0; /* ngồi trong hàng flex: không bị bóp méo khi text dài */
  display: grid; place-items: center;
  background: var(--gold-bright);
  border: none;
  color: #412d00;
  font-weight: 700;
  border-radius: 50%;
}
.avatar:hover { box-shadow: 0 0 0 1px var(--gold); }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }

.icon-btn {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.icon-btn:hover { color: var(--gold-bright); background: var(--interactive); }

/* ============ Nút ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-gold);
  padding-left: 24px;
  padding-right: 24px;
  box-shadow: 0 0 24px rgba(255, 184, 0, 0.25);
}
.btn-primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--on-gold);
  box-shadow: 0 0 32px rgba(255, 184, 0, 0.45);
}
.btn-secondary { background: var(--interactive); color: var(--text); }
.btn-secondary:hover { background: var(--graphite); color: var(--text); }
.btn-ghost { background: rgba(28, 27, 27, 0.8); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--interactive); color: var(--text); }
.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error-strong); border-color: var(--error-strong); color: var(--error); }
.btn-lg { padding: 12px 24px; font-size: 13px; }
.btn-sm { padding: 6px 12px; min-height: 36px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.inline-form { display: inline-flex; margin: 0; }

/* ============ Nội dung trang ============ */
.site-main { flex: 1; padding-bottom: var(--space-xl); }
.page-container { max-width: 1280px; margin: 0 auto; padding: var(--space-xl) var(--gutter) var(--space-xl); }
.page-container.narrow { max-width: 640px; }
.page-head { margin-bottom: var(--space-lg); }
.page-title { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -0.02em; }
.page-sub { color: var(--text-secondary); margin-top: 6px; font-size: 14px; }
/* Đầu trang kiểu Stitch p02: kicker + tiêu đề lớn + mô tả body-lg */
.page-head-hero { display: flex; flex-direction: column; gap: var(--space-xs); }
.page-kicker-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.page-kicker-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(255, 184, 0, 0.8);
}
.page-kicker {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.page-title-hero { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; }
.gold-word { color: var(--gold); text-shadow: 0 2px 18px rgba(255, 184, 0, 0.25); }
.genre-pill-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  margin-bottom: var(--space-md);
  scrollbar-width: thin;
}
.genre-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  /* cứng kích thước: flex item bị co (mặc định flex-shrink:1) + overflow:hidden
     (rule ripple trong motion.css) là cắt mất chữ — bar cuộn ngang thay vì nén pill */
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--interactive);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: color 200ms ease, background 200ms ease;
}
.genre-pill:hover { color: var(--text); }
.genre-pill.is-active {
  background: var(--gold);
  color: var(--on-gold);
  font-weight: 700;
  box-shadow: 0 0 16px rgba(255, 184, 0, 0.35);
}
.page-note { color: var(--text-muted); text-align: center; padding: var(--space-xl) 0; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: var(--space-sm); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--gold-bright); }
.breadcrumb-light a { color: var(--text-secondary); }

.section-title { font-size: 24px; font-weight: 700; line-height: 32px; letter-spacing: -0.01em; }
.shelf-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--interactive);
  color: var(--gold);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
/* Thanh dọc nhấn màu trước tiêu đề kệ (Stitch p01) */
.shelf-bar {
  width: 8px; height: 24px;
  border-radius: 999px;
  flex-shrink: 0;
}
.shelf-bar.is-gold { background: var(--gold); }
.shelf-bar.is-outline { background: var(--text-muted); }
