/* =========================
   RESET & BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f5f8ff;
  --bg-soft: #eef4ff;
  --white: #ffffff;

  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;

  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;

  --accent: #06b6d4;
  --accent-dark: #0891b2;

  --success: #10b981;
  --success-dark: #059669;

  --border: #dbe4f0;
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(37, 99, 235, 0.12);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --container: 1200px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
    radial-gradient(circle at top left, rgba(6, 182, 212, 0.08), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  padding-left: 18px;
}

li {
  margin-bottom: 6px;
}

/* =========================
   LAYOUT
========================= */
.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 72px 0;
  
}

.section-heading {
  margin-bottom: 28px;
  text-align: center;
}

.section-heading.center {
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: linear-gradient(135deg, #dbeafe, #ecfeff);
  border: 1px solid rgba(37, 99, 235, 0.14);
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}

.section-heading p {
  max-width: 760px;
  margin: 0 auto;
  font-size: 17px;
  color: var(--text-soft);
}

/* =========================
   BUTTONS
========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.35);
}

.btn-outline {
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.18);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

/* NÚT XEM CHI TIẾT - LÀM NỔI BẬT RÕ */
.btn-card {
  width: 100%;
  margin-top: auto;
  padding: 15px 18px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #0ea5e9 100%);
  box-shadow:
    0 12px 24px rgba(37, 99, 235, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.btn-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 35%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    transparent
  );
  transform: skewX(-18deg);
  transition: left 0.6s ease;
}

.btn-card:hover::before {
  left: 120%;
}

.btn-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 18px 34px rgba(37, 99, 235, 0.34),
    0 0 0 4px rgba(37, 99, 235, 0.08);
}

.btn-card:active {
  transform: translateY(0);
}

/* =========================
   HERO
========================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 70px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.25), transparent 20%),
    radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.18), transparent 18%),
    linear-gradient(135deg, #1d4ed8 0%, #2563eb 38%, #0ea5e9 100%);
  color: #ffffff;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}

.hero::before {
  width: 280px;
  height: 280px;
  top: -90px;
  right: -60px;
  background: rgba(255, 255, 255, 0.08);
}

.hero::after {
  width: 180px;
  height: 180px;
  bottom: -40px;
  left: -40px;
  background: rgba(255, 255, 255, 0.08);
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero h1 {
  max-width: 900px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 18px;
}

.hero-subtitle {
  max-width: 760px;
  font-size: clamp(16px, 2.2vw, 20px);
  color: rgba(255, 255, 255, 0.92);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

/* =========================
   INTRO
========================= */
.intro {
  position: relative;
}

.intro-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(219, 228, 240, 0.9);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.intro-card ul {
  list-style: none;
  padding-left: 0;
}

.intro-card li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
  color: var(--text-soft);
  font-size: 16px;
}

.intro-card li:last-child {
  margin-bottom: 0;
}

.intro-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: 800;
}

/* =========================
   TOC / CHAPTER GRID
========================= */
.toc-section {
  position: relative;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.chapter-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(219, 228, 240, 0.9);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  position: relative;
  overflow: hidden;
}

.chapter-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(37, 99, 235, 0.015),
    rgba(14, 165, 233, 0.03)
  );
  pointer-events: none;
}

.chapter-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.18);
}

.chapter-number {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
  position: relative;
  z-index: 1;
}

.chapter-card h3 {
  position: relative;
  z-index: 1;
  font-size: 22px;
  line-height: 1.35;
  color: var(--text);
}

.chapter-card p {
  position: relative;
  z-index: 1;
  color: var(--text-soft);
  font-size: 15.5px;
}

.chapter-list {
  position: relative;
  z-index: 1;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.chapter-list li {
  margin-bottom: 8px;
}

/* =========================
   APPENDIX
========================= */
.appendix {
  position: relative;
}

.appendix-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 10px;
}

/* PHỤ LỤC - LÀM GIỐNG NÚT, DỄ NHÌN, DỄ BẤM */
.appendix-item {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 84px;
  padding: 18px 16px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 55%, #1d4ed8 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 12px 24px rgba(37, 99, 235, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.appendix-item::before {
  content: "📎";
  margin-right: 8px;
  font-size: 16px;
  flex-shrink: 0;
}

.appendix-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: -45%;
  width: 35%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.22),
    transparent
  );
  transform: skewX(-18deg);
  transition: left 0.6s ease;
}

.appendix-item:hover::after {
  left: 120%;
}

.appendix-item:hover {
  transform: translateY(-4px);
  box-shadow:
    0 18px 34px rgba(37, 99, 235, 0.28),
    0 0 0 4px rgba(37, 99, 235, 0.07);
  filter: saturate(1.05);
}

/* Nếu sau này đổi appendix-item thành <a>, vẫn đẹp */
.appendix-item a {
  color: inherit;
  font-weight: inherit;
}

/* =========================
   CTA SECTION
========================= */
.cta-section {
  padding-top: 24px;
  padding-bottom: 72px;
}

.cta-box {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(6, 182, 212, 0.08)),
    rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(219, 228, 240, 0.95);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: center;
  backdrop-filter: blur(10px);
}

/* =========================
   FOOTER
========================= */
.footer {
  padding: 28px 0 40px;
  border-top: 1px solid rgba(219, 228, 240, 0.8);
  background: rgba(255, 255, 255, 0.6);
}

.footer-inner {
  text-align: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.footer p:last-child {
  margin-bottom: 0;
}

/* =========================
   FOCUS ACCESSIBILITY
========================= */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.appendix-item:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 3px;
  border-radius: 16px;
}

/* =========================
   TABLET
========================= */
@media (max-width: 1024px) {
  .section {
    padding: 64px 0;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
  }

  .appendix-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chapter-card h3 {
    font-size: 20px;
  }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {
  .container {
    width: min(100%, calc(100% - 20px));
  }

  .hero {
    padding: 64px 0 52px;
  }

  .hero h1 {
    font-size: clamp(28px, 8vw, 40px);
    margin-bottom: 14px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .section {
    padding: 52px 0;
  }

  .section-heading h2 {
    font-size: 28px;
  }

  .section-heading p {
    font-size: 15px;
  }

  .intro-card {
    padding: 20px;
    border-radius: 20px;
  }

  .chapter-grid {
    gap: 18px;
  }

  .chapter-card {
    padding: 18px;
    border-radius: 20px;
    gap: 14px;
  }

  .chapter-number {
    width: 50px;
    height: 50px;
    font-size: 16px;
    border-radius: 16px;
  }

  .chapter-card h3 {
    font-size: 18px;
  }

  .chapter-card p,
  .chapter-list,
  .chapter-list li {
    font-size: 14.5px;
  }

  .btn-card {
    min-height: 50px;
    font-size: 15px;
    padding: 14px 16px;
  }

  .appendix-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .appendix-item {
    min-height: 70px;
    padding: 16px 14px;
    font-size: 14.5px;
    border-radius: 16px;
  }

  .cta-box {
    padding: 18px;
    border-radius: 22px;
  }

  .footer {
    padding: 24px 0 32px;
  }

  .footer p {
    font-size: 13px;
  }
}

/* =========================
   SMALL MOBILE
========================= */
@media (max-width: 420px) {
  .section-tag {
    font-size: 12px;
    padding: 7px 12px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .chapter-card h3 {
    font-size: 17px;
  }

  .btn {
    font-size: 14px;
  }

  .btn-card {
    font-size: 14px;
  }

  .appendix-item {
    font-size: 14px;
  }
}


/* =========================
   AUDIO + ẢNH
========================= */
.media-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(203, 213, 225, 0.7);
}

.audio-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  border: none;
  padding: 13px 20px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
  transition: all 0.25s ease;
}

.listen-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.35);
}

.listen-btn.playing {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.22);
}

.btn-icon {
  font-size: 18px;
  line-height: 1;
}

.audio-status {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.image-frame {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 22px;
  padding: 12px;
  border: 1px solid rgba(203, 213, 225, 0.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.illustration {
  width: 100%;
  display: block;
  border-radius: 18px;
  object-fit: cover;
  max-height: 420px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
}

