/* ============================================================
   NameIsNovel — main.css (Complete Master System)
   ทุกหน้าใช้ไฟล์นี้ร่วมกัน อย่าลบ class ใดออก
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;600;700&family=Noto+Serif+Thai:wght@400;600;700&display=swap');

/* ── 1. Design Tokens ─────────────────────────── */
:root {
  --clr-bg:        #fcfbf8;
  --clr-bg-alt:    #f2efeb;
  --clr-surface:   #ffffff;
  --clr-surface2:  #f0ede8;
  --clr-border:    #e2ddd6;
  --clr-text:      #1a1714;
  --clr-muted:     #6b6560;
  --clr-accent:    #c9973a;
  --clr-accent2:   #8b5e3c;
  --clr-gold:      #d4a843;
  --clr-jade:      #4a7c6a;
  --clr-danger:    #e53935;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 6px 20px rgba(0,0,0,.1);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.15);
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 24px;
  --transition: all 0.25s ease;
}
[data-theme="dark"] {
  --clr-bg:       #0d0c0a;
  --clr-bg-alt:   #1a1815;
  --clr-surface:  #1a1815;
  --clr-surface2: #24211c;
  --clr-border:   #2d2924;
  --clr-text:     #f0ece6;
  --clr-muted:    #8a8078;
}

/* ── 2. Reset & Base ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Sarabun', sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--clr-accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--clr-accent2); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: 'Noto Serif Thai', serif; line-height: 1.3; color: var(--clr-text); }

/* ── 3. Layout ────────────────────────────────── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.container--narrow { max-width: 850px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.section { padding: 4rem 0; }
.section--alt { background: var(--clr-surface2); border-top: 1px solid var(--clr-border); border-bottom: 1px solid var(--clr-border); }

/* ── 4. Navbar ────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  padding: 0.75rem 0;
  box-shadow: var(--shadow-sm);
}
.navbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.navbar__brand { font-family: 'Noto Serif Thai', serif; font-size: 1.4rem; font-weight: 700; color: var(--clr-accent); flex-shrink: 0; }
.navbar__brand span { color: var(--clr-accent2); }
.navbar__nav { display: flex; gap: 0.25rem; list-style: none; margin-right: auto; }
.navbar__nav a { color: var(--clr-muted); font-weight: 600; padding: 0.5rem 0.75rem; border-radius: var(--r-sm); font-size: 0.9rem; white-space: nowrap; }
.navbar__nav a:hover, .navbar__nav a.active { color: var(--clr-accent); background: var(--clr-surface2); }
.navbar__actions { display: flex; align-items: center; gap: 0.75rem; }
.navbar__toggle { background: transparent; border: none; font-size: 1.5rem; color: var(--clr-text); cursor: pointer; display: none; }

/* ── 5. Buttons ───────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.5rem; border-radius: var(--r-md);
  font-weight: 700; border: 2px solid transparent;
  cursor: pointer; transition: var(--transition);
  font-family: inherit; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
}
.btn--primary { background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent2)); color: #fff; border-color: transparent; }
.btn--primary:hover { filter: brightness(1.1); color: #fff; }
.btn--secondary { background: var(--clr-surface2); color: var(--clr-text); border-color: var(--clr-border); }
.btn--secondary:hover { background: var(--clr-border); }
.btn--ghost { background: transparent; color: var(--clr-accent); border-color: var(--clr-accent); }
.btn--ghost:hover { background: var(--clr-accent); color: #fff; }
.btn--sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn--lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn--full { width: 100%; }

/* ── 6. Cards ─────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card__body { padding: 1.5rem; }
.card__body h3 { margin-bottom: 0.75rem; font-size: 1.1rem; }

/* ── 7. Forms ─────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; color: var(--clr-text); }
.form-control {
  width: 100%; padding: 0.7rem 1rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--r-sm);
  font-family: inherit; font-size: 1rem;
  background: var(--clr-bg); color: var(--clr-text);
  transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--clr-accent); box-shadow: 0 0 0 3px rgba(201,151,58,0.15); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ── 8. Tables ────────────────────────────────── */
.table-wrap, .table-responsive {
  width: 100%; overflow-x: auto;
  background: var(--clr-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--clr-border);
  -webkit-overflow-scrolling: touch;
}
.table-wrap table, .table-responsive table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table-wrap th, .table-responsive th {
  background: var(--clr-surface2); text-align: left;
  padding: 0.9rem 1.25rem; font-size: 0.85rem; font-weight: 700;
  color: var(--clr-muted); border-bottom: 1px solid var(--clr-border);
  white-space: nowrap;
}
.table-wrap td, .table-responsive td { padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--clr-border); font-size: 0.9rem; vertical-align: middle; }
.table-wrap tbody tr:last-child td, .table-responsive tbody tr:last-child td { border-bottom: none; }
.table-wrap tbody tr:hover, .table-responsive tbody tr:hover { background: var(--clr-bg-alt); }

/* ── 9. Alerts / Banners ──────────────────────── */
.alert {
  padding: 0.9rem 1.25rem; border-radius: var(--r-sm);
  margin-bottom: 1rem; font-size: 0.95rem; font-weight: 600;
  border-left: 4px solid transparent;
}
.alert--error   { background: #fdf2f2; color: #c53030; border-left-color: var(--clr-danger); }
.alert--success { background: #f0fdf4; color: #276749; border-left-color: var(--clr-jade); }
.alert--warning { background: #fff8e1; color: #7a5c00; border-left-color: #ffb300; }
.alert--info    { background: #eff6ff; color: #1e40af; border-left-color: #3b82f6; }

/* ── 10. Tier Badges ──────────────────────────── */
.tier-badge {
  display: inline-flex; padding: 0.3rem 0.85rem;
  border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  color: #fff; background: var(--clr-muted); letter-spacing: 0.5px;
}
.tier-badge--free    { background: #6b6560; }
.tier-badge--premium { background: linear-gradient(135deg, #4a7c6a, #2d5a47); }
.tier-badge--vip     { background: linear-gradient(135deg, #c9973a, #8b5e3c); }
.tier-badge--master  { background: linear-gradient(135deg, #1a1a1a, #3d3d3d); border: 1px solid #888; }
.tier-badge--admin   { background: linear-gradient(135deg, #1e40af, #1e3a8a); }

/* ── 11. Stats / Dashboard ────────────────────── */
.stats-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.stat-box {
  flex: 1; min-width: 160px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  padding: 1.5rem; text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-box__num { font-size: 2.5rem; font-weight: 700; color: var(--clr-accent); line-height: 1; }
.stat-box__label { font-size: 0.85rem; color: var(--clr-muted); margin-top: 0.5rem; font-weight: 600; }

/* Dashboard 2-col Grid */
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; }
.dash-card {
  background: var(--clr-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--clr-border);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}
.dash-card--premium {
  background: linear-gradient(145deg, var(--clr-surface), rgba(201,151,58,0.05));
  border-color: rgba(201,151,58,0.3);
}
.dash-card h2 { font-size: 1.1rem; color: var(--clr-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1.5rem; }
.tier-display { font-size: 1.8rem; font-weight: 700; color: var(--clr-accent); display: block; margin-bottom: 1rem; }

/* ── 12. Auth Page ────────────────────────────── */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 200px); padding: 4rem 1.5rem; position: relative;
}
.auth-page::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: url('../images/pattern.png') center/cover;
  opacity: 0.03; pointer-events: none;
}
.auth-card {
  width: 100%; max-width: 480px;
  background: var(--clr-surface); border-radius: var(--r-lg);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.auth-tabs { display: flex; background: var(--clr-surface2); border-bottom: 1px solid var(--clr-border); }
.auth-tabs a {
  flex: 1; text-align: center; padding: 1.1rem 1rem;
  font-weight: 700; color: var(--clr-muted); text-decoration: none;
  border-bottom: 3px solid transparent; transition: var(--transition);
}
.auth-tabs a:hover { color: var(--clr-text); }
.auth-tabs a.active { color: var(--clr-accent); border-bottom-color: var(--clr-accent); background: var(--clr-surface); }
.auth-card__body { padding: 2.5rem; }

/* ── 12.5 Tier Cards ──────────────────────────── */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; max-width: 900px; margin: 0 auto; }
.tier-card { background: var(--clr-surface); border-radius: 16px; border: 1px solid var(--clr-border); padding: 2rem; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.tier-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-color: var(--clr-accent); }

/* ── 13. Pricing Cards ────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.pricing-card {
  background: var(--clr-surface); border-radius: var(--r-lg);
  border: 1px solid var(--clr-border); padding: 2.5rem 2rem;
  text-align: center; position: relative; transition: var(--transition);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.pricing-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--clr-accent); }
.pricing-card.is-featured { border: 2.5px solid var(--clr-gold); }
.featured-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--clr-gold); color: #fff; padding: 0.25rem 1rem;
  border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.pc-header { margin-bottom: 1.5rem; }
.pc-price { font-size: 2.8rem; font-weight: 700; color: var(--clr-accent); line-height: 1; margin: 0.75rem 0 0.25rem; }
.pc-price small { font-size: 1rem; color: var(--clr-muted); font-weight: 400; }
.pc-subtitle { font-size: 0.85rem; color: var(--clr-muted); }
.pc-features { list-style: none; text-align: left; margin-bottom: 2rem; flex-grow: 1; }
.pc-features li { padding: 0.6rem 0; font-size: 0.9rem; display: flex; align-items: center; gap: 0.6rem; border-bottom: 1px solid var(--clr-border); }
.pc-features li.disabled { color: var(--clr-muted); opacity: 0.6; }
.pc-features li:last-child { border-bottom: none; }
.pc-icon { flex-shrink: 0; }
.pc-action { margin-top: auto; }

/* ── 14. Grids ────────────────────────────────── */
.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--series { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ── 15. Flexbox Helpers ──────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.btn-group-responsive { display: flex; gap: 1rem; }

/* ── 16. Spacing Helpers ──────────────────────── */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* ── 17. Text Helpers ─────────────────────────── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--clr-muted); }
.text-accent  { color: var(--clr-accent); }
.text-sm      { font-size: 0.85rem; }
.text-xs      { font-size: 0.75rem; }
.text-lg      { font-size: 1.15rem; }
.font-bold    { font-weight: 700; }

/* ── 18. Section Title ────────────────────────── */
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2, .section-title h1 { font-family: 'Noto Serif Thai', serif; font-size: 2rem; margin-bottom: 0.5rem; }

/* ── 19. Hero (Index Page) ────────────────────── */
.hero {
  background: linear-gradient(135deg, #1a0e05 0%, #2d1810 50%, #0d0c0a 100%);
  color: #f0ece6; padding: 6rem 1.5rem; text-align: center;
}
.hero__content { position: relative; z-index: 2; }
.hero__title { font-family: 'Noto Serif Thai', serif; font-size: 3.5rem; color: #fff; margin-bottom: 1rem; }
.hero__title span { color: var(--clr-gold); }
.hero__subtitle { font-size: 1.2rem; opacity: 0.9; margin-bottom: 2.5rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.home-hero__inner { position: relative; z-index: 2; }
.home-hero__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: stretch;
}
.home-hero__actions .btn {
  white-space: normal;
  text-align: center;
  line-height: 1.45;
}
.home-hero__primary-btn {
  box-shadow: 0 4px 15px rgba(201,151,58,0.4);
  max-width: min(100%, 640px);
}
.home-hero__secondary-btn {
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

/* ── 19.5 Home Page Sections ─────────────────── */
.home-tier-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1120px;
  align-items: stretch;
}
.home-tier-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100%;
}
.home-tier-card__badge {
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.home-tier-card--featured {
  background: linear-gradient(180deg, rgba(201,151,58,0.08), rgba(201,151,58,0.02));
  border-color: rgba(201,151,58,0.35);
}
.home-tier-card--master {
  border-color: var(--clr-gold);
  background: linear-gradient(to bottom, #fff, #fff9e6);
}
.home-tier-card--master .tier-badge--master {
  background: #1a1a1a;
  color: #c9973a;
  border: 1px solid #c9973a;
}
.home-tier__cta {
  margin-top: 2.5rem;
}

.home-master-promo {
  background: #161616;
  color: #fff;
  overflow: hidden;
  position: relative;
  padding: 2.5rem 0;
  border-top: 1px solid #c9973a22;
  border-bottom: 1px solid #c9973a22;
}
.home-master-promo__glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(201,151,58,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.home-master-promo__header {
  margin-bottom: 2rem;
}
.home-master-promo__title {
  color: #c9973a;
  font-size: 1.6rem;
  text-shadow: 0 0 15px rgba(201,151,58,0.3);
  margin-bottom: 0.3rem;
}
.home-master-promo__subtitle {
  color: rgba(255,255,255,0.68);
  font-size: 0.95rem;
  max-width: 720px;
  margin: 0 auto;
}
.home-master-promo__grid {
  margin-top: 1.5rem;
  gap: 1.5rem;
}
.home-master-card {
  background: #222;
  border: 1px solid #333;
  position: relative;
  overflow: hidden;
}
.home-master-card__cover-wrap {
  position: relative;
  height: 180px;
  aspect-ratio: auto;
}
.home-master-card__cover {
  filter: brightness(0.4) blur(1px);
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-master-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.home-master-card__seal {
  background: rgba(201,151,58,0.9);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(201,151,58,0.4);
  margin-bottom: 10px;
}
.home-master-card__seal-icon {
  font-size: 1.3rem;
  color: #fff;
}
.home-master-card__tag {
  color: #c9973a;
  font-weight: 800;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(0,0,0,0.7);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(201,151,58,0.2);
}
.home-master-card__body {
  padding: 1.2rem;
  background: #1a1a1a;
}
.home-master-card__title {
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
  color: #fff;
  min-height: 2.7rem;
  overflow: hidden;
}
.home-master-card__cta {
  background: linear-gradient(135deg, #c9973a, #a67c2e);
  color: #1a1a1a;
  font-weight: 800;
  justify-content: center;
  border: none;
  padding: 0.6rem;
  font-size: 0.8rem;
}
.home-master-card__cta:hover {
  color: #1a1a1a;
}

/* ── 20. Series Cards ─────────────────────────── */
.series-card {
  background: var(--clr-surface); border-radius: var(--r-md);
  border: 1px solid var(--clr-border); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: var(--transition);
  display: flex; flex-direction: column; height: 100%;
}
.series-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: rgba(201,151,58,0.5); }
.series-card__cover-wrap { position: relative; width: 100%; aspect-ratio: 2/3; overflow: hidden; }
.series-card__cover { width: 100%; height: 100%; object-fit: cover; background: var(--clr-bg-alt); transition: transform 0.5s ease; }
.series-card:hover .series-card__cover { transform: scale(1.05); }
.series-card__body { padding: 1.25rem; display: flex; flex-direction: column; flex-grow: 1; }
.series-card__title { font-weight: 700; font-size: 1.05rem; color: var(--clr-text); margin-bottom: 0.5rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.series-card__title:hover { color: var(--clr-accent); }
.series-card__gate-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.55rem; }
.series-gate-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.18rem 0.55rem; border-radius: 999px;
  background: rgba(201,151,58,0.12); color: #9a6700;
  border: 1px solid rgba(201,151,58,0.25); font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.series-card__gate-copy { font-size: 0.78rem; color: var(--clr-muted); line-height: 1.55; margin-bottom: 0.8rem; }
.series-card__meta { margin-top: auto; font-size: 0.85rem; color: var(--clr-muted); font-weight: 600; display: flex; align-items: center; justify-content: space-between; padding-top: 0.75rem; border-top: 1px dashed var(--clr-border); }
.status-badge { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px; }
.status-badge--ongoing { background: #e8f5e9; color: #2e7d32; }
.status-badge--completed { background: #fff8e1; color: #f57f17; border: 1px solid #fbd38d; }
.status-badge--paused { background: #f5f5f5; color: #616161; }
.gate-pill-badges {
  display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.45rem;
  font-size: 0.68rem; font-weight: 800; color: #9a6700;
}

/* ── 21. Episode List (Series Page) ──────────────*/
.episode-list { list-style: none; }
.episode-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--clr-border);
  transition: var(--transition); gap: 1rem;
}
.episode-item:last-child { border-bottom: none; }
.episode-item:hover { background: var(--clr-bg-alt); }
.ep-num { font-size: 0.8rem; color: var(--clr-muted); font-weight: 700; flex-shrink: 0; width: 50px; }
.ep-title { font-weight: 600; color: var(--clr-text); flex-grow: 1; }
.ep-status { font-size: 0.75rem; flex-shrink: 0; }

/* ── 22. Countdown / Expiry Chip ─────────────── */
.countdown { color: var(--clr-jade); font-weight: 700; }
.countdown.expiring { color: var(--clr-danger); }

/* ── 23. Badges (Payment Status) ─────────────── */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge--pending  { background: #fff3cd; color: #856404; }
.badge--approved { background: #d4edda; color: #155724; }
.badge--rejected { background: #f8d7da; color: #721c24; }

/* ── 24. Admin Specific ───────────────────────── */
.admin-section { padding: 2rem 0 4rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--clr-border); }
.page-header h1 { font-size: 1.8rem; }

/* ── 25. Footer ───────────────────────────────── */
.footer {
  padding: 3rem 0; text-align: center;
  color: var(--clr-muted); font-size: 0.85rem;
  border-top: 1px solid var(--clr-border); margin-top: 4rem;
}
.footer a { color: var(--clr-accent); }
.footer__links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 0.75rem; flex-wrap: wrap; }

/* ── 26. Dark Mode Toggle ─────────────────────── */
[data-theme="dark"] .form-control { background: var(--clr-bg-alt); }

/* ── 27. Specific Page Layouts (Dashboard, Pricing, Payment) ─ */
.dashboard-container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.welcome-header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--clr-border); }
.welcome-header h1 { font-size: 2.2rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.75rem; }
.dash-progress-wrap { margin-bottom: 1.5rem; }
.dash-progress-bg { background: var(--clr-border); height: 8px; border-radius: 4px; overflow: hidden; }
.dash-progress-fill { background: linear-gradient(90deg, var(--clr-accent), var(--clr-gold)); height: 100%; border-radius: 4px; transition: width 1s ease-out; }
.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 10px; }

.pricing-wrapper { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.checkout-container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.pkg-card { border: 2px solid var(--clr-border); border-radius: var(--r-md); padding: 1.25rem; cursor: pointer; background: var(--clr-surface); transition: all 0.2s ease; position: relative; overflow: hidden; }
.pkg-card:hover { border-color: var(--clr-accent); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.pkg-card.selected { border-color: var(--clr-accent); background: rgba(201,151,58,0.05); box-shadow: 0 4px 15px rgba(201,151,58,0.15); }
.pkg-card.selected::after { content: '✓'; position: absolute; top: -5px; right: -5px; background: var(--clr-accent); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.pkg-card input[type="radio"] { display: none; }
.pkg-title { font-weight: 700; font-size: 1.1rem; color: var(--clr-text); margin-bottom: 0.25rem; }
.pkg-desc { font-size: 0.85rem; color: var(--clr-muted); margin-bottom: 0.75rem; }
.pkg-price { font-size: 1.5rem; font-weight: 700; color: var(--clr-jade); }
.pkg-price small { font-size: 0.9rem; font-weight: 400; color: var(--clr-muted); }

.payment-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.qr-box { background: #fff; border: 1px solid var(--clr-border); border-radius: var(--r-md); padding: 2rem; text-align: center; box-shadow: inset 0 0 20px rgba(0,0,0,0.02); }
.qr-img-wrapper { width: 220px; height: 220px; margin: 0 auto 1.5rem; background: #f9f9f9; border: 2px dashed #ddd; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.qr-img-wrapper img { width: 100%; height: 100%; object-fit: contain; position: absolute; top: 0; left: 0; background: #fff; }
.upload-zone { border: 2px dashed var(--clr-accent); border-radius: var(--r-md); padding: 2rem 1.5rem; text-align: center; background: rgba(201,151,58,0.02); cursor: pointer; transition: all 0.2s; position: relative; }
.upload-zone:hover { background: rgba(201,151,58,0.08); }
.upload-zone input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; opacity: 0.8; }

/* ── 28. Specific Page Layouts (Watch, Series, Episode) ─ */
.wl-container { max-width:1100px; margin:0 auto; padding:2rem 1.5rem 5rem; }
.wl-player-wrap { background:var(--clr-surface); border:1px solid var(--clr-border); border-radius:var(--r-md); overflow:hidden; margin-bottom:2rem; }
.wl-player-head { padding:1.25rem 1.5rem; background:var(--clr-surface2); border-bottom:1px solid var(--clr-border); display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.75rem; }
.wl-player-head h2 { font-size:1.2rem; }
.wl-player-body { padding:1.5rem; }
.wl-iframe-wrap { position:relative; padding-bottom:56.25%; height:0; border-radius:var(--r-sm); overflow:hidden; background:#000; margin-bottom:1.25rem; }
.wl-iframe-wrap iframe { position:absolute; inset:0; width:100%; height:100%; }
.wl-filter { display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; margin-bottom:1.25rem; }
.wl-pill { padding:.45rem 1rem; border-radius:999px; border:1.5px solid var(--clr-border); font-size:.85rem; font-weight:600; cursor:pointer; text-decoration:none; color:var(--clr-text); transition:all .2s; }
.wl-pill:hover { border-color:var(--clr-accent); color:var(--clr-accent); }
.wl-pill.active { background:var(--clr-accent); border-color:var(--clr-accent); color:#fff; }
.wl-table-wrap { background:var(--clr-surface); border:1px solid var(--clr-border); border-radius:var(--r-md); overflow-x:auto; -webkit-overflow-scrolling: touch; }
.wl-table { width:100%; border-collapse:collapse; min-width: 600px; }
.wl-table th { background:var(--clr-surface2); padding:.85rem 1.25rem; text-align:left; font-size:.8rem; font-weight:700; color:var(--clr-muted); border-bottom:1px solid var(--clr-border); white-space:nowrap; }
.wl-table td { padding:.9rem 1.25rem; border-bottom:1px solid var(--clr-border); vertical-align:middle; }
.wl-table tr:last-child td { border-bottom:none; }
.wl-table tr:hover td { background:var(--clr-bg-alt); }
.wl-thumb { width:160px; height:90px; object-fit:cover; border-radius:6px; background:#111; display:block; }
.wl-locked-banner { background:linear-gradient(135deg,#1a0e00,#2d1a00); border:1px solid rgba(201,151,58,.3); border-radius:var(--r-md); padding:3rem 2rem; text-align:center; margin-bottom:2rem; }
.wl-locked-banner h2 { color:var(--clr-accent); margin-bottom:.75rem; }

.ep-group { border-bottom: 1px solid var(--clr-border); }
.ep-group__header { padding: 1rem; cursor: pointer; font-weight: bold; background: var(--clr-surface2); display: flex; align-items: center; color: var(--clr-text); }
.ep-group[open] .ep-group__header { border-bottom: 1px solid var(--clr-border); color: var(--clr-accent); }
.ep-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--clr-border);
  gap: 1rem;
  transition: var(--transition);
}
.ep-row:hover { background: var(--clr-bg-alt); }
.ep-row__info { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }
.ep-row__meta { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.ep-row__num { font-size: 0.9rem; font-weight: 700; color: var(--clr-muted); min-width: 45px; }
.ep-row__title { font-size: 1rem; font-weight: 700; color: var(--clr-text); line-height: 1.4; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-row__title:hover { color: var(--clr-accent); }
.ep-row__action { flex-shrink: 0; }

.show-on-mobile-li { display: none; }
.hr-mobile { height: 1px; background: var(--clr-border); margin: 0.5rem 0; }

/* ── 30. Video Cards (Watch Page) ─────────────── */
.grid--video { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.video-card { background: var(--clr-surface); border-radius: var(--r-md); border: 1px solid var(--clr-border); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); display: flex; flex-direction: column; }
.video-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--clr-accent); }
.video-card__thumb { position: relative; width: 100%; aspect-ratio: 16/9; background: #111; overflow: hidden; }
.video-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; opacity: 0.9; }
.video-card:hover .video-card__thumb img { transform: scale(1.05); opacity: 1; }
.video-card__duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.75); color: #fff; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; backdrop-filter: blur(4px); }
.video-card__body { padding: 1.25rem; display: flex; flex-direction: column; flex-grow: 1; }
.video-card__title { font-weight: 700; font-size: 1.05rem; color: var(--clr-text); margin-bottom: 0.5rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-card__desc { font-size: 0.85rem; color: var(--clr-muted); margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.video-card__meta { margin-top: auto; font-size: 0.8rem; color: var(--clr-muted); display: flex; align-items: center; justify-content: space-between; padding-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.video-card__action { border-top: 1px dashed var(--clr-border); padding-top: 1rem; display: flex; }

/* ── 29. Responsive ───────────────────────────── */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 992px) {
  .navbar__inner { flex-wrap: wrap; }
  .navbar__brand { order: 1; }
  .navbar__actions { order: 2; margin-left: auto; }
  .navbar__toggle { display: block; order: 3; margin-left: 0.5rem; }
  .navbar__nav {
    display: none; order: 4; width: 100%; flex-direction: column; gap: 0.5rem;
    padding-top: 1rem; border-top: 1px solid var(--clr-border); margin-top: 0.5rem;
  }
  .navbar__nav.is-open { display: flex; }
  .hide-on-mobile { display: none !important; }
  .show-on-mobile-li { display: block; }
  .hero__title  { font-size: 2.3rem; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .stats-row    { flex-direction: column; }
  .page-header  { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .home-tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-master-promo__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .btn-group-responsive { flex-direction: column; width: 100%; }
  .btn-group-responsive .btn { width: 100%; }
  .payment-split { grid-template-columns: 1fr; }
  .auth-card__body { padding: 1.5rem; }
  .welcome-header h1 { font-size: 1.8rem; }
  .ep-row { flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 1.25rem 1rem; }
  .ep-row__info { flex-direction: column; align-items: flex-start; gap: 0.5rem; width: 100%; }
  .ep-row__title { white-space: normal; overflow: visible; font-size: 1.05rem; }
  .ep-row__meta { width: 100%; gap: 0.5rem; flex-wrap: wrap; }
  .ep-row__num { min-width: auto; }
  .ep-row__action { width: 100%; margin-top: 0.5rem; }
  .ep-row__action .btn { width: 100%; justify-content: center; }
  .hero { padding: 4.5rem 1rem; }
  .hero__subtitle { font-size: 1rem; margin-bottom: 1.8rem; }
  .home-hero__actions { flex-direction: column; align-items: stretch; }
  .home-hero__actions .btn { width: 100%; }
  .home-hero__primary-btn { max-width: 100%; }
  .home-tier-grid { grid-template-columns: 1fr; }
  .home-tier-card { padding: 1.5rem; }
  .home-master-promo { padding: 2rem 0; }
  .home-master-promo__title { font-size: 1.35rem; }
  .home-master-promo__subtitle { font-size: 0.88rem; }
  .home-master-promo__grid { grid-template-columns: 1fr; gap: 1rem; }
  .home-master-card__cover-wrap { height: 160px; }
}
@media (max-width: 480px) {
  .navbar__actions { flex-wrap: nowrap; gap: 0.5rem; }
  .pc-price { font-size: 2.2rem; }
  .hero__title { font-size: 2rem; }
  .section-title h2, .section-title h1 { font-size: 1.7rem; }
  .home-tier__cta .btn { width: 100%; }
}
