:root {
  /* Warm Beauty/Makeup Palette */
  --bg-main: #fdfaf6;
  --bg-sidebar: #f5eee6;
  --bg-card: #ffffff;
  --bg-hover: #f1ebd9;
  --bg-code: #fbf6f0;

  --text-primary: #3d2b1f;
  --text-heading: #2c1a0f;
  --text-secondary: #6e594d;
  --text-muted: #9b8a7f;

  --accent: #d28e82;
  --accent-hover: #c07a6e;
  --border: #e6dace;

  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 4px 12px rgba(61, 43, 31, 0.04);
  --shadow-md: 0 8px 24px rgba(61, 43, 31, 0.08);

  --sidebar-width: 280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 32px 24px 24px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 2px;
  margin-bottom: 2px;
}

.sidebar-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sidebar-nav { padding: 16px 12px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link.active {
  background: rgba(210, 142, 130, 0.15);
  color: var(--accent);
  font-weight: 600;
}
.nav-icon { width: 22px; text-align: center; flex-shrink: 0; }
.nav-label { 
  white-space: normal; 
  line-height: 1.4; 
  display: block; 
}
.nav-sub {
  padding-left: 32px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.85;
}
.nav-sub:hover { opacity: 1; }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 48px 56px 80px;
}

/* ── Hero ── */
.hero {
  padding: 32px 0 48px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: 40px;
  color: var(--text-heading);
  margin-bottom: 12px;
  font-style: italic;
}
.hero-tagline {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.hero-author {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 24px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-heading);
}
.hero-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Teacher Intro ── */
.teacher-card {
  background: linear-gradient(135deg, rgba(210,142,130,0.08), rgba(183,110,121,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.teacher-name {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.teacher-role {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 20px;
}
.teacher-bio {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 16px;
}
.teacher-bio strong {
  color: var(--accent);
  font-weight: 700;
}
.teacher-highlights {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.teacher-highlight { text-align: center; }
.highlight-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-heading);
}
.highlight-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Sections ── */
.section { margin-bottom: 72px; }

.chapter-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.chapter-num {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 26px;
  color: var(--text-heading);
  font-weight: 600;
}

.section-divider {
  width: 40px; height: 3px;
  background: var(--accent);
  margin-bottom: 20px;
  border-radius: 2px;
}

/* Two-column body: left 2/3 (intro + cards), right 1/3 (image) */
.section-body-row {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}
.section-body-left {
  flex: 2;
  min-width: 0;
}
.section-body-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.section-body-right .section-image {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 4px solid #fff;
}

/* Matched height: cards and image align top & bottom */
.section-body-matched {
  align-items: flex-start;
}
.section-body-matched .section-body-right {
  display: flex;
}
.section-body-matched .section-body-right .section-image {
  max-height: 380px;
  object-fit: cover;
}

/* Fallback for sections without images */
.section-intro {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 28px;
}

/* Glossary group headers */
.glossary-group-header {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  padding: 12px 16px 8px;
  margin-top: 16px;
  border-bottom: 2px solid var(--accent);
  letter-spacing: 0.5px;
}
.glossary-group-header:first-child {
  margin-top: 0;
}

/* ── Cards ── */
.info-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.info-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.info-card-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 10px;
}

.info-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.styled-list {
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 12px;
  line-height: 1.9;
}
.styled-list li { margin-bottom: 6px; }

/* ── Nav Divider ── */
.nav-divider {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin: 20px 12px 8px;
  text-transform: uppercase;
}

/* ── Glossary Table ── */
.glossary-table-wrap {
  overflow-x: auto;
}
.glossary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.glossary-table thead {
  background: var(--bg-hover);
}
.glossary-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-heading);
  border-bottom: 2px solid var(--border);
  font-family: var(--font-heading);
}
.glossary-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.glossary-table tr:hover {
  background: var(--bg-hover);
}
.glossary-num {
  color: var(--text-muted);
  font-weight: 600;
  width: 40px;
  text-align: center;
}
.glossary-en {
  font-weight: 600;
  color: var(--accent);
}
.glossary-vi {
  color: var(--text-primary);
}

/* ── Footer ── */
.footer {
  text-align: center;
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.footer-brand {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 4px;
}

/* ── Mobile Menu Button ── */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px; right: 16px;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 44px; height: 44px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.mobile-menu-btn span {
  width: 22px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(44, 26, 15, 0.4);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s;
}

/* ── Sidebar Toggle ── */
.sidebar-toggle-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.15);
  color: #111;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s;
  z-index: 100;
}
.sidebar-toggle-btn:hover { background: rgba(0,0,0,0.05); }
.sidebar.collapsed { width: 80px; }
.sidebar.collapsed .sidebar-title { font-size: 12px; }
.sidebar.collapsed .sidebar-subtitle { display: none; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-divider { font-size: 0; padding: 4px; border-top: 1px solid rgba(255,255,255,0.1); margin: 8px 16px; margin-bottom: 2px;}
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; margin-bottom: 8px; }
.sidebar.collapsed .nav-icon { margin-right: 0; width: auto; font-size: 18px; }
.sidebar.collapsed .sidebar-toggle-btn { transform: rotate(180deg); }
body:has(.sidebar.collapsed) .main-content { margin-left: 80px; }

/* ── Glossary Accordion ── */
.nav-link.has-sub { justify-content: space-between; }
.nav-link.has-sub .nav-toggle-icon {
  font-size: 10px;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  margin-left: auto;
}
.nav-link.has-sub.open .nav-toggle-icon { transform: rotate(90deg); }
.sidebar.collapsed .nav-link.has-sub .nav-toggle-icon { display: none; }
.glossary-subnav {
  display: none;
  flex-direction: column;
}
.glossary-subnav.open { display: flex; }
.sidebar.collapsed .glossary-subnav.open { display: none; } /* Hide subnav when sidebar is collapsed */

/* ── Login Overlay ── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: #111;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #1c1c1c;
  padding: 40px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  border: 1px solid #333;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.login-logo {
  max-width: 140px;
  margin-bottom: 16px;
}
.login-title {
  color: #fff;
  font-family: var(--font-heading);
  letter-spacing: 1px;
  font-size: 18px;
  margin-bottom: 32px;
  font-weight: 400;
}
.login-form .input-group {
  margin-bottom: 16px;
}
.login-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #2a2a2a;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.2s;
}
.login-form input:focus {
  outline: none;
  border-color: var(--primary);
}
.login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.login-actions button {
  width: 100%;
  padding: 14px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #ab6a5e; }
.btn-outline { background: transparent; color: #fff; border: 1px solid #555; }
.btn-outline:hover { background: rgba(255,255,255,0.05); }
.remember-group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aaa;
  font-size: 13px;
  margin-top: 8px;
  margin-bottom: 0 !important;
}
.remember-group input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}
.remember-group label {
  cursor: pointer;
  user-select: none;
}
.login-error {
  color: #ff5252;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}
.login-actions.row {
  flex-direction: row;
}
.login-actions.row button {
  flex: 1;
}
.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.6;
  user-select: none;
}
.toggle-password:hover {
  opacity: 1;
}
.login-form input:read-only {
  background: #222;
  color: #888;
  border-color: #333;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 80px 24px 40px; }
  .mobile-menu-btn { display: flex; }
  .sidebar-overlay.open { display: block; opacity: 1; }
  .section-body-row { flex-direction: column; }
  .section-body-right .section-image { max-height: 320px; }
}

@media (max-width: 768px) {
  .hero-title { font-size: 30px; }
  .hero-tagline { font-size: 15px; }
  .hero-author { font-size: 17px; }
  .hero-stats { gap: 24px; }
  .hero-stat-num { font-size: 26px; }
  .section-title { font-size: 22px; }
  .chapter-num { width: 30px; height: 30px; font-size: 12px; }
  .info-card { padding: 16px; }
  .section-body-right .section-image { max-height: 260px; }
}

@media (max-width: 480px) {
  .main-content { padding: 72px 16px 32px; }
  .hero-title { font-size: 26px; }
  .hero-tagline { font-size: 14px; }
  .section-title { font-size: 20px; }
  .section-body-right .section-image { max-height: 200px; border-radius: var(--radius-md); }
  .info-card-title { font-size: 15px; }
  .info-card-desc { font-size: 13px; }
  .styled-list { font-size: 13px; }
}

/* ==========================================================================
   ── INTEGRATION: COURSE SYLLABUS & ROADMAP STYLES ──
   ========================================================================== */

/* Segmented View Switcher in Sidebar */
.sidebar-view-toggle {
  display: flex;
  background: rgba(44, 26, 15, 0.06);
  border-radius: 20px;
  padding: 3px;
  margin: 15px 12px 0;
  border: 1px solid rgba(44, 26, 15, 0.08);
}

.view-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.view-toggle-btn i {
  font-size: 11px;
}

.view-toggle-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(44, 26, 15, 0.08);
}

.sidebar.collapsed .sidebar-view-toggle {
  flex-direction: column;
  border-radius: 8px;
  margin: 10px 4px 0;
}

.sidebar.collapsed .view-toggle-btn {
  font-size: 0;
  padding: 10px 0;
  border-radius: 6px;
}

.sidebar.collapsed .view-toggle-btn i {
  font-size: 16px;
}

/* --- Brand Logo Container --- */
.brand-container {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
  margin-top: 10px;
}

.brand-logo-img {
  height: 48px;
  object-fit: contain;
  opacity: 0.85;
}

/* --- Tab Switched Syllabus --- */
.tabs-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 0 0 25px;
  flex-wrap: wrap;
  z-index: 20;
  position: relative;
}

.tab-btn {
  background: #ffffff;
  border: 1px solid rgba(184, 149, 100, 0.18);
  color: var(--text-muted);
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(184, 149, 100, 0.05);
}

.tab-btn:hover {
  background: #fbf9f4;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tab-btn.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(184, 149, 100, 0.25);
}

.course-wrapper {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.6s ease forwards;
}

.course-wrapper:not(#course-contract) {
  background: #ffffff;
  border: 1px solid rgba(184, 149, 100, 0.22);
  border-radius: 8px;
  padding: 45px 55px;
  margin: 15px auto 35px;
  max-width: 850px;
  box-shadow: 0 10px 40px rgba(184, 149, 100, 0.04);
  position: relative;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .course-wrapper:not(#course-contract) {
    padding: 30px 20px;
    margin-bottom: 25px;
  }
}

.course-wrapper.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Course Title Header --- */
.course-header {
  text-align: center;
  margin-bottom: 5px;
}

.course-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1.3;
}

.course-subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* --- Tuition Info Box --- */
.info-box {
  border: 2px solid rgba(184, 149, 100, 0.35);
  border-radius: 12px;
  padding: 22px 26px 18px;
  margin-top: 15px;
  position: relative;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(184, 149, 100, 0.05);
}

.info-box-title {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fdfaf6;
  padding: 4px 20px;
  border: 1px solid rgba(184, 149, 100, 0.35);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.info-box-price {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-list li {
  font-size: 0.98rem;
  color: var(--text-primary);
  line-height: 1.5;
  position: relative;
  padding-left: 20px;
}

.info-list li::before {
  content: '•';
  color: var(--accent);
  position: absolute;
  left: 4px;
  font-size: 1.2rem;
  top: -1px;
}

.info-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Syllabus Roadmap Grid --- */
.roadmap-container {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.roadmap-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  position: relative;
}

.roadmap-section-title::before, .roadmap-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 149, 100, 0.3) 50%, transparent);
  max-width: 180px;
}

.roadmap-grid {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.roadmap-section {
  display: block;
}

.roadmap-section h4.roadmap-section-title {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(184, 149, 100, 0.15);
  padding-bottom: 4px;
  display: block;
  text-align: left;
}

.roadmap-section h4.roadmap-section-title::before,
.roadmap-section h4.roadmap-section-title::after {
  display: none;
}

.roadmap-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 800px;
  margin: 0 auto;
}

.roadmap-list li {
  position: relative;
  padding-left: 24px;
  font-size: 1.08rem;
  color: var(--text-primary);
  line-height: 1.5;
  transition: transform 0.2s ease;
}

.roadmap-list li:hover {
  transform: translateX(2px);
}

.roadmap-list li::before {
  content: '•';
  color: var(--accent);
  position: absolute;
  left: 6px;
  font-size: 1.3rem;
  top: -3px;
}

/* --- Floating Double Gold Action Buttons --- */
.action-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 35px 0 15px;
  z-index: 30;
  position: relative;
}

.btn-download {
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(184, 149, 100, 0.2);
  transition: all 0.3s ease;
}

.btn-download:hover {
  background: #a38153;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(184, 149, 100, 0.35);
}

.btn-download:active {
  transform: translateY(0);
}

.btn-contract {
  background: #ffffff;
  color: var(--accent);
  border: 2px solid rgba(184, 149, 100, 0.18);
  padding: 12px 38px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(184, 149, 100, 0.05);
}

.btn-contract:hover {
  background: #fbf9f4;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(184, 149, 100, 0.12);
}

.btn-contract:active {
  transform: translateY(0);
}

/* --- Preset Poster Export Wrapper (Hidden on screen) --- */
.poster-wrapper {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1200px;
  height: 1720px;
  background-color: #fcfaf5;
  background-image: radial-gradient(circle at 50% 50%, #ffffff 0%, #fcfaf5 100%);
  color: var(--text-primary);
  font-family: var(--font-body);
  padding: 70px 75px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 2px solid var(--border);
}

.poster-frame {
  position: absolute;
  inset: 22px;
  border: 1px solid var(--border);
  pointer-events: none;
}

.poster-frame-inner {
  position: absolute;
  inset: 5px;
  border: 2px solid var(--border);
  opacity: 0.45;
}

.poster-header {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 30px;
}

.poster-logo {
  height: 52px;
  object-fit: contain;
  margin-bottom: 24px;
}

.poster-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--text-heading);
  letter-spacing: 3px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.poster-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
}

.poster-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 25px;
}

.poster-info-box {
  background: #ffffff;
  border: 2px solid rgba(184, 149, 100, 0.35); /* Elegant gold border */
  padding: 35px 45px 25px 45px;
  border-radius: 12px;
  position: relative; /* Essential for absolute title badge */
  box-shadow: 0 10px 30px rgba(184, 149, 100, 0.03);
  margin-top: 15px;
}

.poster-info-box-title {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fdfaf6; /* Matches the base cream background of the poster */
  padding: 4px 24px;
  border: 1px solid rgba(184, 149, 100, 0.35);
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  padding-bottom: 4px;
}

.poster-info-box-price {
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 10px;
  margin-bottom: 20px;
  letter-spacing: 1px;
  font-family: var(--font-heading);
  text-align: center;
}

.poster-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 0;
}

.poster-info-list li {
  font-size: 1.05rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 25px;
  line-height: 1.5;
  text-align: left;
}

.poster-info-list li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--accent);
  font-size: 1.4rem;
  top: -2px;
}

.poster-info-list li strong {
  color: var(--text-heading);
}

.poster-roadmap {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.poster-roadmap-header {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--text-heading);
  margin-bottom: 30px;
  letter-spacing: 1px;
  font-weight: 600;
  text-align: center;
  border-bottom: none;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.poster-roadmap-header::before,
.poster-roadmap-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 149, 100, 0.45) 50%, transparent);
  max-width: 180px;
}

.poster-roadmap-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.poster-roadmap-node {
  margin-bottom: 5px;
  text-align: left;
}

.poster-roadmap-node-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-heading);
  margin-bottom: 12px;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid rgba(184, 149, 100, 0.15);
  padding-bottom: 6px;
}

.poster-roadmap-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 0;
}

.poster-roadmap-list li {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.5;
  position: relative;
  padding-left: 20px;
  text-align: left;
}

.poster-roadmap-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-size: 1.3rem;
  top: -2px;
}

.poster-footer {
  border-top: 1px solid var(--border);
  padding-top: 25px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.poster-footer-item {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.poster-footer-item i {
  color: var(--accent);
}

/* --- Processing Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 26, 15, 0.6);
  backdrop-filter: blur(5px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: #ffffff;
  padding: 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 450px;
  width: 90%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.spinner {
  width: 50px; height: 50px;
  border: 3px solid rgba(210, 142, 130, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-card h4 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--text-heading);
  margin-bottom: 10px;
  font-weight: 600;
}

.modal-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Obsolete print block removed to prevent conflict with modern layout below */

/* ==========================================================================
   ── CONTRACT PAPERS STYLES (HỢP ĐỒNG MAKEUP TRỰC TUYẾN) ──
   ========================================================================== */
.contract-paper {
  background: #ffffff;
  border: 1px solid rgba(184, 149, 100, 0.22);
  border-radius: 8px;
  padding: 45px 55px;
  margin: 15px auto 30px;
  max-width: 850px;
  box-shadow: 0 10px 40px rgba(184, 149, 100, 0.05);
  font-family: "Times New Roman", Times, serif;
  color: #2b231d;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .contract-paper {
    padding: 30px 20px;
  }
}

.contract-national {
  text-align: center;
  margin-bottom: 25px;
}

.contract-national p {
  margin: 3px 0;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  font-family: "Times New Roman", Times, serif;
}

.contract-national p.line {
  margin-top: 5px;
  color: var(--accent);
}

.contract-paper h2.contract-title {
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.55rem;
  font-weight: bold;
  color: #2b231d;
  margin: 20px 0 5px;
  letter-spacing: 0.5px;
}

.contract-paper p.contract-subtitle {
  text-align: center;
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 30px;
  color: var(--text-muted);
}

.contract-preamble {
  margin-bottom: 25px;
}

.contract-preamble p {
  margin: 6px 0;
  font-size: 1rem;
}

.contract-party {
  margin-bottom: 25px;
  border-bottom: 1px dashed rgba(184, 149, 100, 0.18);
  padding-bottom: 15px;
}

.contract-party:last-of-type {
  border-bottom: none;
}

.contract-party h3 {
  font-size: 1.08rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: #2b231d;
}

.contract-party p {
  margin: 7px 0;
  font-size: 1rem;
}

.contract-clause {
  margin-bottom: 25px;
}

.contract-clause h4 {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: #2b231d;
  border-bottom: 1px solid rgba(184, 149, 100, 0.18);
  padding-bottom: 4px;
}

.contract-clause p {
  margin: 7px 0;
  font-size: 1rem;
}

.contract-clause p.indent {
  padding-left: 20px;
}

.contract-clause p.indent2 {
  padding-left: 40px;
}

.contract-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  gap: 30px;
}

@media (max-width: 576px) {
  .contract-signatures {
    flex-direction: column;
    gap: 40px;
  }
}

.signature-col {
  flex: 1;
  text-align: center;
}

.signature-col p {
  margin: 5px 0;
  font-size: 1rem;
}

.sig-space {
  height: 80px;
}

.contract-paper .bold {
  font-weight: bold;
}

.contract-paper .italic {
  font-style: italic;
}


/* ==========================================================================
   ── CURRICULUM PAGINATION STYLES (MÔ PHỎNG PHÂN TRANG A4 TRÊN MÀN HÌNH) ──
   ========================================================================== */
.curriculum-page {
  background: #ffffff;
  border: 1px solid rgba(184, 149, 100, 0.22);
  border-radius: 8px;
  padding: 45px 55px;
  margin: 15px auto 35px;
  max-width: 850px;
  box-shadow: 0 10px 40px rgba(184, 149, 100, 0.04);
  position: relative;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .curriculum-page {
    padding: 30px 20px;
    margin-bottom: 25px;
  }
}

/* Page footer text-run simulator for elegant branding & numbering */
.curriculum-page::after {
  content: "";
  position: absolute;
  bottom: 12px;
  right: 30px;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
  opacity: 0.85;
}

/* Page Number Simulator based on Section ID */
#home.curriculum-page::after { content: "Trang 1 / 20 — Giáo Trình Makeup (Mở đầu)"; }
#teacher-intro.curriculum-page::after { content: "Trang 2 / 20 — Giới thiệu Giảng viên"; }
#the-light.curriculum-page::after { content: "Trang 3 / 20 — Chương 1: Lý thuyết Ánh sáng"; }
#face-anatomy.curriculum-page::after { content: "Trang 4 / 20 — Chương 2: Giải phẫu khuôn mặt"; }
#color-wheel.curriculum-page::after { content: "Trang 5 / 20 — Chương 3: Bánh xe Màu sắc"; }
#tools.curriculum-page::after { content: "Trang 6 / 20 — Chương 4: Dụng cụ Trang điểm"; }
#cleansing.curriculum-page::after { content: "Trang 7 / 20 — Chương 5: Làm sạch & Dưỡng da"; }
#primer.curriculum-page::after { content: "Trang 8 / 20 — Chương 6: Kem lót (Primer)"; }
#color-corrector.curriculum-page::after { content: "Trang 9 / 20 — Chương 7: Triệt sắc & Che khuyết điểm"; }
#foundation.curriculum-page::after { content: "Trang 10 / 20 — Chương 8: Kem nền (Foundation)"; }
#concealer.curriculum-page::after { content: "Trang 11 / 20 — Chương 9: Che khuyết điểm chuyên sâu"; }
#powder.curriculum-page::after { content: "Trang 12 / 20 — Chương 10: Phấn phủ (Powder)"; }
#contour-highlight.curriculum-page::after { content: "Trang 13 / 20 — Chương 11: Khối & Sáng (Contour & Highlight)"; }
#blush.curriculum-page::after { content: "Trang 14 / 20 — Chương 12: Đánh má phấn (Blush)"; }
#eyebrow.curriculum-page::after { content: "Trang 15 / 20 — Chương 13: Chân mày (Eyebrow)"; }
#eyeshape.curriculum-page::after { content: "Trang 16 / 20 — Chương 14: Kỹ thuật đánh mắt (Eye Shape)"; }
#eyeliner.curriculum-page::after { content: "Trang 17 / 20 — Chương 15: Eyeliner & Mi"; }
#lips.curriculum-page::after { content: "Trang 18 / 20 — Chương 16: Trang điểm Môi (Lips)"; }
#foundation-skin-type.curriculum-page::after { content: "Trang 19 / 20 — Chương 17: Đọc loại da & Nền tương ứng"; }
#glossary.curriculum-page::after { content: "Trang 20 / 20 — Bảng Thuật ngữ Anh - Việt"; }

/* ── Table of Contents (Mục lục) Styles ── */
.toc-container {
  margin-top: 35px;
  padding: 25px 30px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-code);
  text-align: left;
}

.toc-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-heading);
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 20px;
  font-weight: 700;
}

.toc-grid {
  display: flex;
  gap: 40px;
}

.toc-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.toc-item:hover {
  color: var(--accent);
}

.toc-chapter-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.toc-dots {
  flex: 1;
  border-bottom: 1px dotted var(--text-muted);
  margin: 0 8px;
  opacity: 0.5;
}

.toc-page-num {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .toc-grid {
    flex-direction: column;
    gap: 10px;
  }
}

/* ── Print Optimization for Pristine 20-Page A4 PDF Export ── */
@page {
  size: A4;
  margin: 12mm 5mm 15mm 5mm; /* Top 12mm, Right 5mm, Bottom 15mm, Left 5mm */
}

@media print {
  /* Hide interactive / non-curriculum elements */
  .sidebar,
  .sidebar-overlay,
  .mobile-menu-btn,
  .curriculum-header-only,
  .login-overlay,
  #loading-modal,
  .action-container,
  .sidebar-view-toggle,
  .brand-container,
  .tabs-container,
  .modal-overlay,
  .poster-wrapper {
    display: none !important;
  }

  /* Reset main layout for print flow */
  html, body {
    background: #ffffff !important;
    color: #3d2b1f !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important; /* Spans standard printable area without scaling down */
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: auto !important;
  }

  /* Allow curriculum pages to flow continuously, breaking naturally only when the physical page is full */
  .curriculum-page {
    page-break-after: auto !important;
    break-after: auto !important;
    margin: 0 0 35px 0 !important; /* Space between chapters in the flow */
    padding: 0 !important; /* Rely completely on @page margin for pristine margins */
    width: 100% !important;
    height: auto !important;
    min-height: auto !important; /* Allow natural A4 height scaling based on content */
    box-sizing: border-box !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    position: relative !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  /* Hide simulated page numbers on print since pages are now continuous */
  .curriculum-page::after {
    display: none !important;
  }

  /* Cover page and Teacher Intro stand on their own pristine A4 pages */
  #home.curriculum-page,
  #teacher-intro.curriculum-page {
    page-break-after: always !important;
    break-after: page !important;
    min-height: 268mm !important;
  }

  /* Hero Section Print Tuning */
  .hero {
    padding: 0 !important;
  }
  .hero-title {
    font-size: 30px !important;
    margin-bottom: 8px !important;
  }
  .hero-tagline {
    font-size: 15px !important;
    margin-bottom: 18px !important;
  }
  .hero-author {
    font-size: 16px !important;
    margin-bottom: 18px !important;
  }
  .hero-stats {
    margin-bottom: 22px !important;
    gap: 24px !important;
  }
  .hero-stat-num {
    font-size: 26px !important;
  }
  .hero-stat-label {
    font-size: 11px !important;
  }
  .toc-container {
    margin-top: 22px !important;
    padding: 20px 25px !important;
  }
  .toc-title {
    font-size: 1.05rem !important;
    margin-bottom: 15px !important;
  }
  .toc-item {
    font-size: 0.8rem !important;
  }

  /* Teacher Profile Section Print Tuning */
  .teacher-card {
    padding: 18px 22px !important;
    margin-top: 10px !important;
  }
  .teacher-name {
    font-size: 20px !important;
    margin-bottom: 4px !important;
  }
  .teacher-role {
    font-size: 12px !important;
    margin-bottom: 12px !important;
  }
  .teacher-bio {
    font-size: 13px !important;
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
  }
  .teacher-highlights {
    margin-top: 15px !important;
    padding-top: 15px !important;
    gap: 20px !important;
  }
  .highlight-num {
    font-size: 24px !important;
  }
  .highlight-label {
    font-size: 10px !important;
  }

  /* Core Chapters Print Spacing Tuning */
  .chapter-header {
    margin-bottom: 8px !important;
    gap: 12px !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
  .chapter-num {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
  }
  .section-title {
    font-size: 22px !important;
  }
  .section-divider {
    height: 3px !important;
    margin-bottom: 15px !important;
    width: 40px !important;
  }
  .section-intro {
    font-size: 13.5px !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
  }
  
  .info-card {
    padding: 14px 18px !important;
    margin-bottom: 12px !important;
  }
  .info-card-title {
    font-size: 15px !important;
    margin-bottom: 6px !important;
  }
  .info-card-desc {
    font-size: 12.5px !important;
    line-height: 1.6 !important;
  }
  .styled-list {
    margin-top: 8px !important;
    font-size: 12.5px !important;
    line-height: 1.6 !important;
    padding-left: 18px !important;
  }
  .styled-list li {
    margin-bottom: 4px !important;
  }

  .section-body-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 20px !important;
  }
  .section-body-left {
    flex: 2 !important;
  }
  .section-body-right {
    flex: 1 !important;
    display: flex !important;
  }
  .section-body-right .section-image {
    width: 100% !important;
    max-height: 75mm !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    border: 1px solid #e6dace !important;
  }
  .section-body-row + .section-body-row {
    margin-top: 15px !important;
  }

  /* Compact Multi-Column Glossary Printing - flows naturally */
  .glossary-table-wrap {
    column-count: 2 !important;
    column-gap: 25px !important;
    display: block !important;
    overflow: visible !important;
  }
  .glossary-table {
    display: block !important;
    width: 100% !important;
  }
  .glossary-table thead {
    display: none !important;
  }
  .glossary-table tbody {
    display: block !important;
  }
  .glossary-table tr {
    display: flex !important;
    width: 100% !important;
    padding: 3px 0 !important;
    border-bottom: 1px solid rgba(184, 149, 100, 0.1) !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .glossary-group-header {
    display: block !important;
    width: 100% !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    background: rgba(184, 149, 100, 0.08) !important;
    padding: 3px 8px !important;
    margin-top: 8px !important;
    margin-bottom: 3px !important;
    border-bottom: none !important;
    color: var(--accent) !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
  }
  .glossary-num {
    display: none !important;
  }
  .glossary-en {
    flex: 1 !important;
    font-size: 9.5px !important;
    font-weight: 600 !important;
    color: var(--accent) !important;
    padding-right: 5px !important;
  }
  .glossary-vi {
    flex: 1.2 !important;
    font-size: 9.5px !important;
    color: var(--text-primary) !important;
  }

  /* Prevent row, card and table row page breaks */
  tr, .info-card {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  thead {
    display: table-header-group !important;
  }
}






