/* =====================================================================
   HỆ THỐNG GIAO DIỆN ÔN TẬP VĂN TUYỂN SINH 10 - EDTECH STUDIO
   Tác giả: Thầy Võ Ngọc Tùng - Trường THCS Nhuận Phú Tân
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Playfair+Display:ital,wght@0,600;0,700;0,900;1,400;1,600&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --font-main: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-num: 'Outfit', sans-serif;

  /* Theme: Classic Light */
  --bg-app: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-heading: #0f172a;

  /* Accent Colors */
  --primary: #1e3a8a;          /* Deep Regal Navy */
  --primary-light: #3b82f6;    /* Vibrant Blue */
  --primary-glow: rgba(59, 130, 246, 0.15);
  --accent-gold: #d97706;      /* Amber Gold */
  --accent-emerald: #059669;   /* Green Bareme */
  --accent-rose: #e11d48;      /* Urgent/Error */
  --highlight-color: #fef08a;  /* Bút dạ vàng */
  --highlight-pink: #fbcfe8;   /* Bút dạ hồng */

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

/* Sepia Mode (Chế độ giấy ngà thư viện) */
body.mode-sepia {
  --bg-app: #f7f3eb;
  --bg-surface: #fdfbf7;
  --bg-subtle: #f3ede2;
  --border-color: #e6dcce;
  --text-main: #382c1e;
  --text-muted: #796854;
  --text-heading: #261d13;
  --primary: #854d0e;
  --primary-light: #b45309;
  --primary-glow: rgba(180, 83, 9, 0.12);
  --highlight-color: #fde047;
}

/* Dark Mode (Bảo vệ mắt ban đêm) */
body.mode-dark {
  --bg-app: #0f172a;
  --bg-surface: #1e293b;
  --bg-subtle: #162032;
  --border-color: #334155;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-heading: #f8fafc;
  --primary: #60a5fa;
  --primary-light: #93c5fd;
  --primary-glow: rgba(96, 165, 250, 0.2);
  --highlight-color: rgba(234, 179, 8, 0.4);
}

/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* HEADER BRANDING */
.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%);
  color: #ffffff;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: #cbd5e1;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-tag {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fde047;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-pill-group {
  display: flex;
  background: rgba(255, 255, 255, 0.12);
  padding: 3px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-theme {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-theme.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-weight: 600;
}

/* NAVIGATION TABS */
.nav-tabs-wrapper {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 70px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.nav-tabs {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.65rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
  color: var(--primary-light);
  background: var(--bg-subtle);
}

.tab-btn.active {
  color: var(--primary);
  background: var(--primary-glow);
  border-bottom: 2px solid var(--primary);
}

/* MAIN CONTAINER */
.main-content {
  max-width: 1500px;
  margin: 1.5rem auto;
  padding: 0 1.25rem 3rem;
  flex: 1;
  width: 100%;
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
   TAB 1: PHÒNG LUYỆN ĐỀ SPLIT-SCREEN
   ===================================================================== */
.exam-header-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.exam-select-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.exam-select-box label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-heading);
}

.select-exam {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  min-width: 320px;
}
.select-exam:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.exam-info-badge {
  font-size: 0.82rem;
  color: var(--accent-gold);
  background: rgba(217, 119, 6, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

/* SPLIT SCREEN LAYOUT */
.split-screen-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .split-screen-grid {
    grid-template-columns: 1fr;
  }
}

/* LEFT COLUMN: PASSAGE STUDIO */
.passage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: sticky;
  top: 135px;
  max-height: calc(100vh - 155px);
  display: flex;
  flex-direction: column;
}

.passage-toolbar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.82rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  font-weight: 500;
}
.tool-btn:hover {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: var(--primary-light);
}
.tool-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.passage-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.85;
}

.passage-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-heading);
  text-align: center;
  margin-bottom: 0.25rem;
}

.passage-author {
  text-align: center;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.passage-text p {
  margin-bottom: 1rem;
  text-align: justify;
}

/* Highlight style */
::selection {
  background: var(--highlight-color);
  color: #000;
}
.hl-yellow {
  background-color: var(--highlight-color);
  border-radius: 3px;
  padding: 0 2px;
}
.hl-pink {
  background-color: var(--highlight-pink);
  border-radius: 3px;
  padding: 0 2px;
}

/* RIGHT COLUMN: QUESTIONS & BAREME STUDIO */
.exercise-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-color);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-score-pill {
  background: var(--primary-glow);
  color: var(--primary);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Question Items */
.question-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-bottom: 1.15rem;
  transition: all 0.2s ease;
}
.question-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.q-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.q-number {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.q-points {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(5, 150, 105, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.q-text {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.q-clue-box {
  background: rgba(217, 119, 6, 0.08);
  border-left: 3px solid var(--accent-gold);
  padding: 0.5rem 0.85rem;
  font-size: 0.86rem;
  color: var(--text-main);
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.75rem;
  display: none;
}
.q-clue-box.show {
  display: block;
}

.q-textarea {
  width: 100%;
  min-height: 70px;
  padding: 0.75rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 0.65rem;
  outline: none;
}
.q-textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.q-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-clue {
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-answer {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease;
}
.btn-answer:hover {
  background: var(--primary-light);
}

.bareme-box {
  margin-top: 0.85rem;
  background: var(--bg-surface);
  border: 1px dashed var(--accent-emerald);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  display: none;
  animation: fadeIn 0.25s ease;
}
.bareme-box.show {
  display: block;
}

.bareme-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-emerald);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bareme-table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
  margin-top: 0.4rem;
}
.bareme-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-color);
}
.bareme-table td:last-child {
  font-weight: 700;
  color: var(--accent-emerald);
  text-align: right;
  white-space: nowrap;
}

.keyword-tag {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
  display: inline-block;
  margin: 2px;
}

/* WRITING CARD (200 WORDS) */
.writing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.writing-prompt {
  background: var(--primary-glow);
  border-left: 4px solid var(--primary);
  padding: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.6;
}

.editor-box {
  position: relative;
  margin-bottom: 0.75rem;
}

.essay-textarea {
  width: 100%;
  min-height: 220px;
  padding: 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.98rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}
.essay-textarea:focus {
  border-color: var(--primary-light);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.word-counter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 0.2rem;
}

.counter-badge {
  font-family: var(--font-num);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}
.counter-badge.optimal {
  background: rgba(5, 150, 105, 0.15);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}
.counter-badge.warning {
  background: rgba(225, 29, 72, 0.12);
  color: var(--accent-rose);
  border-color: var(--accent-rose);
}

.outline-accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 1rem;
}
.accordion-header {
  background: var(--bg-subtle);
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion-body {
  padding: 1rem;
  font-size: 0.92rem;
  line-height: 1.65;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  display: none;
}
.accordion-body.show {
  display: block;
}

/* =====================================================================
   TAB 2: TRẠM ĐỌC HIỂU (FLASHCARDS & QUIZ)
   ===================================================================== */
.speed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .speed-grid { grid-template-columns: 1fr; }
}

/* Flashcard Engine */
.flashcard-stage {
  perspective: 1000px;
  min-height: 280px;
  margin: 1.5rem 0;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard-stage.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border-color);
}

.card-front {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-subtle) 100%);
}

.card-back {
  background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
  color: #ffffff;
  transform: rotateY(180deg);
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
  border-color: #3b82f6;
}

.card-category {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.card-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.card-back-text {
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-line;
  color: #f1f5f9;
}

.fc-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* Quiz Engine */
.quiz-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.quiz-q-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.quiz-opt-btn {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s ease;
  font-weight: 500;
}
.quiz-opt-btn:hover {
  border-color: var(--primary-light);
  background: var(--primary-glow);
}
.quiz-opt-btn.correct {
  background: rgba(5, 150, 105, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  font-weight: 700;
}
.quiz-opt-btn.wrong {
  background: rgba(225, 29, 72, 0.15);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
  font-weight: 700;
}

.quiz-expl-card {
  margin-top: 1rem;
  background: var(--bg-subtle);
  border-left: 4px solid var(--accent-emerald);
  padding: 0.9rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  line-height: 1.6;
  display: none;
}
.quiz-expl-card.show {
  display: block;
}

/* =====================================================================
   TAB 3: CỖ MÁY NGHỊ LUẬN XÃ HỘI (FACTS & WORKBENCH)
   ===================================================================== */
.nlxh-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}
@media (max-width: 960px) {
  .nlxh-grid { grid-template-columns: 1fr; }
}

.facts-filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.filter-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.fact-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.fact-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fact-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.fact-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(217, 119, 6, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.fact-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.fact-summary {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.fact-quote {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--primary);
  border-top: 1px dashed var(--border-color);
  padding-top: 0.5rem;
}

/* =====================================================================
   TAB 4: BẢO TÀNG NGHỊ LUẬN VĂN HỌC (MINDMAPS & QUOTES)
   ===================================================================== */
.nlvh-selector-bar {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
}

.nlvh-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
}
.nlvh-tab-btn.active {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  border-color: #1e3a8a;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.mindmap-display-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.mm-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.mm-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
}

.mm-intro-box {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(217, 119, 6, 0.08) 100%);
  border-left: 4px solid var(--accent-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.mm-intro-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.4rem;
}
.mm-intro-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-heading);
  font-style: italic;
}

.branch-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.branch-node {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.branch-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.branch-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.branch-points li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}
.branch-points li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--primary-light);
  font-size: 0.75rem;
  top: 3px;
}

/* Quotes Grid */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.quote-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.qc-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
}
.qc-author {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-gold);
  text-align: right;
  margin-bottom: 0.5rem;
}
.qc-apply {
  font-size: 0.8rem;
  background: var(--bg-subtle);
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-muted);
}

/* FOOTER */
.app-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* =====================================================================
   GENRE FILTER BAR (TAB 1)
   ===================================================================== */
.exam-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.genre-filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}
.genre-filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.genre-pills-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.genre-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.genre-pill:hover {
  border-color: var(--primary-light);
  background: var(--bg-surface);
  color: var(--primary);
  transform: translateY(-1px);
}
.genre-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* =====================================================================
   TAB 5: TOPCLASS VIP STYLES
   ===================================================================== */
.topclass-hero-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 60%, #4c1d95 100%);
  color: #ffffff;
  padding: 2.2rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.topclass-hero-banner::after {
  content: 'TOPCLASS';
  position: absolute;
  right: -20px;
  bottom: -25px;
  font-size: 5.5rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.06);
  font-family: var(--font-num);
  pointer-events: none;
}
.topclass-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid #f59e0b;
  color: #fef3c7;
  padding: 4px 14px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}
.topclass-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.6rem;
  color: #ffffff;
}
.topclass-desc {
  font-size: 0.95rem;
  color: #e2e8f0;
  max-width: 850px;
  line-height: 1.6;
}

/* Grid Layout for TopClass Cards */
.topclass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 1.75rem;
}

.topclass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.topclass-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.topclass-card-header {
  padding: 1.25rem 1.5rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topclass-card-header.bg-blue {
  background: linear-gradient(135deg, #1e40af, #2563eb);
}
.topclass-card-header.bg-emerald {
  background: linear-gradient(135deg, #065f46, #059669);
}
.topclass-card-header.bg-gold {
  background: linear-gradient(135deg, #92400e, #d97706);
}
.topclass-card-header.bg-rose {
  background: linear-gradient(135deg, #9f1239, #e11d48);
}

.card-icon {
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.2);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}
.card-subtitle {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 2px;
}

.topclass-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.subhead {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Formula Box */
.formula-box {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-subtle);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.formula-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.86rem;
  line-height: 1.5;
}
.step-num {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Mini Table */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}
.mini-table th {
  background: var(--bg-subtle);
  padding: 8px 10px;
  font-weight: 700;
  color: var(--text-heading);
  border-bottom: 1px solid var(--border-color);
}
.mini-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}
.mini-table tr:last-child td {
  border-bottom: none;
}

/* Trap Box */
.trap-box {
  background: #fff1f2;
  border-left: 4px solid #e11d48;
  padding: 0.9rem;
  border-radius: 6px;
  font-size: 0.83rem;
  line-height: 1.55;
  color: #881337;
}
body.mode-dark .trap-box {
  background: rgba(225, 29, 72, 0.15);
  color: #fecdd3;
}

/* Five Step Flow */
.five-step-flow {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.flow-item {
  background: var(--bg-subtle);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-light);
  font-size: 0.85rem;
}
.badge-step {
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 2px;
}

/* Model Openings */
.model-openings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.opening-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  line-height: 1.55;
}
.opening-card strong {
  color: var(--accent-gold);
  display: block;
  margin-bottom: 3px;
}

/* Pill Tags Group */
.pill-tags-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.work-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.78rem;
  color: var(--text-main);
  font-weight: 500;
}

/* Grammar Checklist */
.grammar-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.check-item {
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Hot Evidence Cards */
.hot-evidence-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.evidence-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.evidence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}
.tag-topic {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-rose);
}
.tag-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}
.evidence-content {
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--text-main);
}

@media (max-width: 768px) {
  .topclass-grid {
    grid-template-columns: 1fr;
  }
  .topclass-hero-banner {
    padding: 1.5rem 1.25rem;
  }
  .topclass-title {
    font-size: 1.4rem;
  }
}

/* =====================================================================
   TAB 6: BÀI VĂN MẪU THỜI SỰ
   ===================================================================== */
.essays-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .essays-grid { grid-template-columns: 1fr 1fr; }
}
.essay-card .section-head { flex-wrap: wrap; gap: 0.5rem; }

/* =====================================================================
   EMBED MODE CHO IFRAME (VNEDU, LMS, GOOGLE SITES)
   ===================================================================== */
body.embed-mode .app-header {
  display: none !important;
}
body.embed-mode .app-footer {
  display: none !important;
}
body.embed-mode .main-content {
  padding-top: 0.8rem;
}
body.embed-no-tabs .nav-tabs {
  display: none !important;
}



