/* ==========================================================================
   Components Stylesheet - English 9-12
   Cards, Quiz Interface, Modals, Flashcards, Floating Bar, Teacher Views
   ========================================================================== */

/* Main Content Wrapper */
.main-wrapper {
  padding: 2rem 0 4rem;
  flex: 1;
}

/* Page Titles & Hero Section */
.hero-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: "ENG";
  position: absolute;
  right: -20px;
  bottom: -30px;
  font-size: 8rem;
  font-weight: 900;
  color: rgba(59, 130, 246, 0.04);
  pointer-events: none;
}

.hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 650px;
}

.hero-stats {
  display: flex;
  gap: 1.25rem;
}

.hero-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.hero-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title i {
  color: var(--primary);
}

/* Grid Layouts */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

/* Unit Card */
.unit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.unit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.unit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.unit-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  letter-spacing: 0.5px;
}

.unit-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.unit-topic {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.unit-meta {
  background: var(--bg-alt);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.unit-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-sub);
}

.unit-meta-item strong {
  color: var(--text-main);
}

.unit-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}

/* Exam Card */
.exam-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--primary);
}

.exam-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.exam-card.midterm1 { border-top-color: #3b82f6; }
.exam-card.semester1 { border-top-color: #10b981; }
.exam-card.midterm2 { border-top-color: #f59e0b; }
.exam-card.semester2 { border-top-color: #8b5cf6; }

.exam-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.exam-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.exam-info-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.exam-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-alt);
  color: var(--text-sub);
}

/* Practice & Quiz Arena */
.quiz-container {
  max-width: 960px;
  margin: 0 auto;
}

.quiz-top-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.quiz-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.quiz-info span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Filter buttons for Difficulty */
.level-filter-bar {
  display: flex;
  gap: 0.4rem;
  background: var(--bg-alt);
  padding: 4px;
  border-radius: var(--radius-full);
}

.level-filter-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.level-filter-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Exam Timer Display */
.timer-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-md);
  font-family: monospace;
}

.timer-display.warning {
  color: var(--danger);
  background: var(--danger-bg);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.8; transform: scale(1); }
  to { opacity: 1; transform: scale(1.04); }
}

/* Question Card */
.question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.question-card.answered {
  border-color: #cbd5e1;
}

.question-card.correct-submission {
  border-left: 6px solid var(--success);
}

.question-card.wrong-submission {
  border-left: 6px solid var(--danger);
}

.q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.q-num-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.q-number {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
}

.q-category-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-weight: 600;
}

.q-instruction {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.6rem;
}

.q-content {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  user-select: text;
  white-space: pre-line;
}

.q-content .underline {
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--primary);
}

/* Sentence Ordering (a, b, c, d, e) Clean Layout */
.sentence-ordering-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.85rem 0 1.25rem 0;
  padding: 1rem 1.15rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ordering-intro {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.ordering-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-alt);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  transition: all 0.2s ease;
}

.ordering-row:hover {
  background: rgba(99, 102, 241, 0.08);
  transform: translateX(4px);
}

.ordering-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
  box-shadow: 0 2px 5px rgba(99, 102, 241, 0.35);
}

.ordering-text {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.6;
  font-size: 1.02rem;
  flex: 1;
}

/* Dialogue / Conversation Layout */
.dialogue-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.85rem 0 1.15rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.dialogue-line {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.dialogue-speaker {
  font-weight: 800;
  color: var(--primary);
  min-width: 80px;
  flex-shrink: 0;
}

.dialogue-msg {
  font-weight: 600;
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.05);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.dialogue-prompt {
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Notice / Sign / Announcement Layout */
.notice-card {
  margin: 0.85rem 0 1rem 0;
  padding: 1.1rem 1.35rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.09) 0%, rgba(234, 179, 8, 0.04) 100%);
  border: 2px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.1);
}

.notice-header {
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: #d97706;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notice-body {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.6;
  white-space: pre-line;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border-radius: 8px;
  border-left: 4.5px solid #f59e0b;
}

.notice-prompt {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text-main);
  margin-top: 0.85rem;
  line-height: 1.55;
}

/* Error Identification Badges (A), (B), (C), (D) */
.error-choice-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  margin: 0 0.2rem;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.88rem;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.15);
}

/* Distinct Spacing for Phonetics & Stress Options (A, B, C, D) */
.phonetics-options-strip {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.85rem 0 0.5rem 0;
}

.phonetics-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  background: var(--bg-alt);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: var(--transition);
}

.phonetics-chip:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.06);
  transform: translateY(-1px);
}

.phonetics-chip .chip-letter {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.05rem;
}

.phonetics-chip .chip-word {
  color: var(--text-main);
}

.phonetics-chip u {
  text-decoration: underline;
  text-decoration-color: #2563eb;
  text-decoration-thickness: 2.5px;
  text-underline-offset: 3px;
  font-weight: 700;
}

/* Reading Comprehension & Cloze Test Passage Card */
.reading-passage-box {
  background: var(--bg-surface);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-left: 6px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 2rem 0 1.5rem 0;
  box-shadow: var(--shadow-md);
}

.reading-passage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.reading-passage-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.reading-passage-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-main);
  text-align: justify;
}

.reading-passage-body p {
  margin-bottom: 0.85rem;
}

.reading-passage-body p:last-child {
  margin-bottom: 0;
}

.reading-passage-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.55rem;
  margin: 0 0.25rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1.5px dashed var(--primary);
  border-radius: 6px;
  font-weight: 800;
  color: var(--primary);
  font-size: 0.92rem;
}

.passage-reference-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.2);
  margin-bottom: 0.65rem;
}

/* Audio Pronunciation Button */
.btn-speech {
  background: rgba(59, 130, 246, 0.1);
  border: none;
  color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 0.4rem;
  vertical-align: middle;
  transition: var(--transition);
}

.btn-speech:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .options-grid.two-cols {
    grid-template-columns: 1fr 1fr;
  }
}

.option-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  font-size: 0.96rem;
}

.option-item:hover {
  background: var(--bg-alt);
  border-color: #cbd5e1;
}

.option-item.selected {
  border-color: var(--primary) !important;
  background: rgba(59, 130, 246, 0.08) !important;
  font-weight: 600;
  color: var(--primary-dark) !important;
}

.option-letter,
.opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.option-item.selected .option-letter,
.option-item.selected .opt-letter {
  background: var(--primary) !important;
  color: #ffffff !important;
}

/* Reveal State: Correct & Wrong Highlighting - High Contrast */
.option-item.is-correct {
  border-color: #059669 !important;
  background: #ecfdf5 !important;
  color: #065f46 !important;
  font-weight: 700;
}

.option-item.is-correct .option-letter,
.option-item.is-correct .opt-letter {
  background: #059669 !important;
  color: #ffffff !important;
}

.option-item.is-wrong {
  border-color: #dc2626 !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
  font-weight: 700;
}

.option-item.is-wrong .option-letter,
.option-item.is-wrong .opt-letter {
  background: #dc2626 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .option-item.is-correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.22) !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .option-item.is-wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.22) !important;
  color: #fca5a5 !important;
}

[data-theme="dark"] .option-item.selected {
  border-color: #60a5fa !important;
  background: rgba(59, 130, 246, 0.2) !important;
  color: #bfdbfe !important;
}

/* Explanation Panel - Crisp High Contrast */
.explanation-box {
  margin-top: 1rem;
  padding: 1.15rem 1.35rem;
  background: var(--bg-alt);
  border-left: 5px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.95rem;
  display: none;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.explanation-box.show {
  display: block;
}

.exp-header {
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.96rem;
  letter-spacing: 0.02em;
}

.exp-content {
  color: var(--text-main);
  line-height: 1.65;
  font-weight: 500;
}

[data-theme="dark"] .explanation-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-left: 5px solid #60a5fa;
}

[data-theme="dark"] .exp-header {
  color: #93c5fd;
}

[data-theme="dark"] .exp-content {
  color: #f1f5f9;
}

/* Question Bottom Toolbar */
.q-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.btn-unlock-answer {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-unlock-answer:hover {
  color: var(--primary);
  background: var(--bg-alt);
}

/* Bottom Floating Submission Bar */
.bottom-submit-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 90;
}

.submit-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.submit-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-track {
  width: 200px;
  height: 8px;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-sub);
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.modal-input-group {
  margin-bottom: 1.25rem;
}

.modal-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  font-size: 1.1rem;
  background: var(--bg-alt);
  color: var(--text-main);
  text-align: center;
  letter-spacing: 4px;
  outline: none;
  transition: var(--transition);
}

.modal-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Result & Score Summary Card */
.result-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

.score-num {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
}

.score-max {
  font-size: 0.85rem;
  opacity: 0.85;
}

.result-msg {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.result-breakdown {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.breakdown-item {
  text-align: center;
}

.breakdown-val {
  font-size: 1.3rem;
  font-weight: 800;
}

.breakdown-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Flashcard 3D Interactive Card */
.flashcard-wrapper {
  max-width: 580px;
  margin: 1.5rem auto;
  perspective: 1000px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
}

.flashcard-inner.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

.fc-word {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.fc-ipa {
  font-family: monospace;
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.fc-meaning {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.fc-example {
  font-size: 0.95rem;
  color: var(--text-sub);
  font-style: italic;
  line-height: 1.5;
}

.fc-hint {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile and Smartphone Enhancements */
@media (max-width: 768px) {
  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem 1rem;
    gap: 1rem;
  }

  .hero-banner::after {
    display: none;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  .hero-stats {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .hero-stat-card {
    padding: 0.5rem 0.75rem;
  }

  .unit-grid, .exam-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .unit-card, .exam-card {
    padding: 1.15rem;
  }

  .quiz-top-bar {
    padding: 0.75rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    top: 60px;
  }

  .quiz-info {
    text-align: left;
  }

  .level-filter-bar {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  .question-card {
    padding: 1.15rem 0.95rem;
    margin-bottom: 1rem;
  }

  .q-content {
    font-size: 0.95rem;
  }

  .options-grid {
    grid-template-columns: 1fr !important;
  }

  .option-item {
    padding: 0.75rem 0.85rem;
    font-size: 0.9rem;
    min-height: 48px; /* High touch target */
  }

  .q-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .bottom-submit-bar {
    padding: 0.6rem 0;
    padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
  }

  .submit-bar-inner {
    flex-direction: column;
    gap: 0.6rem;
  }

  .submit-status {
    width: 100%;
    justify-content: space-between;
  }

  .progress-track {
    flex: 1;
    max-width: 160px;
  }

  .bottom-submit-bar .btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
  }

  /* Flashcard Mobile */
  .flashcard-wrapper {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  .flashcard-inner {
    min-height: 240px;
  }

  .flashcard-face {
    padding: 1.5rem 1rem;
  }

  .fc-word {
    font-size: 1.75rem;
  }

  .fc-meaning {
    font-size: 1.15rem;
  }

  .fc-example {
    font-size: 0.85rem;
  }

  /* Modal on Mobile */
  .modal-card {
    padding: 1.5rem 1rem;
    max-width: 95vw;
  }

  .score-circle {
    width: 95px;
    height: 95px;
    margin-bottom: 1rem;
  }

  .score-num {
    font-size: 2rem;
  }

  .result-msg {
    font-size: 1.15rem;
  }

  .result-breakdown {
    gap: 1rem;
  }

  /* Teacher Layout Mobile */
  .teacher-layout {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  .app-header,
  .sub-nav,
  .quiz-top-bar,
  .bottom-submit-bar,
  .q-footer,
  .btn,
  .btn-speech {
    display: none !important;
  }
  
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .question-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 1rem !important;
    padding: 1rem !important;
  }
}

/* ==========================================================================
   Teacher Tab Security Modal & Fullscreen Lock Screen
   ========================================================================== */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.auth-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 440px;
  width: 100%;
  padding: 2rem;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(37, 99, 235, 0.15));
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  border: 2px solid rgba(124, 58, 237, 0.25);
}

.auth-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.auth-modal-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.auth-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.auth-input-field {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-alt);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  letter-spacing: 2px;
}

.auth-input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: var(--bg-surface);
}

.auth-error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: shakeError 0.35s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.auth-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.auth-modal-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Fullscreen Lock Screen for teacher.html */
.auth-lock-fullscreen {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-lock-box {
  max-width: 440px;
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2.25rem 2rem;
  text-align: center;
}

.auth-lock-box h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.auth-lock-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.auth-icon-shield {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

/* ==========================================================================
   Mobile-First Responsive Enhancements
   ========================================================================== */
.sub-nav .container {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.nav-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  white-space: nowrap;
  padding: 0.25rem 0.25rem 0.5rem;
}

.nav-pills::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-sub);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
}

.nav-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.5rem 0;
  }

  .header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.4rem;
  }

  .grade-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    margin-top: 0.25rem;
  }

  .grade-btn {
    padding: 0.5rem 0.25rem;
    font-size: 0.82rem;
    text-align: center;
    border-radius: var(--radius-sm);
  }

  .quiz-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .level-filter-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    gap: 0.25rem;
  }

  .level-filter-btn {
    padding: 0.4rem 0.2rem;
    font-size: 0.78rem;
    text-align: center;
  }

  .reading-passage-box {
    padding: 1.15rem;
    margin: 1.25rem 0 1rem;
    border-left-width: 4px;
  }

  .reading-passage-title {
    font-size: 1rem;
  }

  .reading-passage-body {
    font-size: 0.94rem;
    line-height: 1.75;
  }

  .question-card {
    padding: 1.1rem;
    margin-bottom: 1rem;
  }

  .phonetics-options-strip {
    gap: 0.5rem;
  }

  .phonetics-chip {
    padding: 0.35rem 0.75rem;
    font-size: 0.95rem;
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 120px;
    justify-content: center;
  }

  .bottom-submit-bar {
    padding: 0.6rem 0.75rem;
  }

  .submit-bar-inner {
    flex-direction: column;
    gap: 0.5rem;
  }

  .submit-bar-inner > div:last-child {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1.2fr 1.5fr;
    gap: 0.4rem !important;
  }

  .submit-bar-inner .btn {
    padding: 0.55rem 0.4rem;
    font-size: 0.78rem;
    text-align: center;
    justify-content: center;
  }

  .quiz-container {
    padding-bottom: 7.5rem; /* prevent bar overlap on mobile */
  }
}

/* ==========================================================================
   Unit Theory Hub (Lý Thuyết Unit)
   ========================================================================== */
.theory-hub {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.theory-unit-navigation-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
  box-shadow: var(--shadow-sm);
}

.theory-nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--border-color);
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.theory-dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 260px;
}

.theory-dropdown-wrapper label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
}

.theory-select-dropdown {
  flex: 1;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--primary);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.theory-select-dropdown:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.theory-unit-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.theory-unit-pill {
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-alt);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.theory-unit-pill:hover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.theory-unit-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.theory-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  transition: var(--transition);
}

.theory-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.3);
}

.theory-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.theory-section-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.theory-section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.theory-rule-box {
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
}

/* Theory Markdown Content Presentation */
.theory-md-block {
  margin: 0.75rem 0;
  line-height: 1.75;
}

.theory-md-heading {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--primary);
  margin: 1rem 0 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(37, 99, 235, 0.07);
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.theory-md-p {
  font-size: 0.94rem;
  color: var(--text-main);
  margin: 0.35rem 0;
  line-height: 1.7;
}

.theory-spacer {
  height: 0.5rem;
}

.theory-md-signpost {
  background: rgba(2, 132, 199, 0.08);
  border-left: 3px solid #0284c7;
  padding: 0.45rem 0.75rem;
  border-radius: 0 6px 6px 0;
  margin: 0.5rem 0;
  font-size: 0.92rem;
  color: var(--text-main);
}

.theory-md-callout {
  background: rgba(245, 158, 11, 0.09);
  border-left: 3px solid #f59e0b;
  padding: 0.5rem 0.85rem;
  border-radius: 0 6px 6px 0;
  margin: 0.6rem 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #92400e;
}

[data-theme="dark"] .theory-md-callout {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.15);
}

.theory-md-list {
  margin: 0.4rem 0 0.6rem 1.25rem;
  padding-left: 0.5rem;
}

.theory-md-list li {
  margin-bottom: 0.35rem;
  font-size: 0.93rem;
  color: var(--text-main);
  line-height: 1.65;
}

.theory-inline-code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 700;
}

[data-theme="dark"] .theory-inline-code {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.25);
}

/* Formula Pattern Rows */
.formula-row {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  margin: 0.35rem 0;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.92rem;
}

.formula-row.pos {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.formula-row.neg {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.formula-row.q {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-formula {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-formula.pos {
  background: #10b981;
  color: white;
}

.badge-formula.neg {
  background: #ef4444;
  color: white;
}

.badge-formula.q {
  background: #3b82f6;
  color: white;
}

.formula-text {
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}

.formula-example-line {
  margin: 0.35rem 0 0.35rem 1rem;
  font-size: 0.92rem;
  color: var(--text-sub);
  display: flex;
  align-items: baseline;
}

/* Watch Out Section Cards */
.watchout-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-top: 0.5rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.watchout-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.watchout-badge {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

.watchout-badge.wrong {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="dark"] .watchout-badge.wrong {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.watchout-badge.correct {
  background: #d1fae5;
  color: #047857;
}

[data-theme="dark"] .watchout-badge.correct {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.watchout-badge.note {
  background: #fef3c7;
  color: #b45309;
}

[data-theme="dark"] .watchout-badge.note {
  background: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.watchout-text.wrong {
  color: #dc2626;
  text-decoration: line-through;
  font-weight: 600;
}

[data-theme="dark"] .watchout-text.wrong {
  color: #f87171;
}

.watchout-text.correct {
  color: #15803d;
  font-weight: 700;
}

[data-theme="dark"] .watchout-text.correct {
  color: #4ade80;
}

.watchout-text.note {
  color: var(--text-main);
  font-weight: 600;
}

.theory-formula {
  display: block;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-weight: 700;
  color: #1e40af;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  font-size: 0.94rem;
  white-space: pre-wrap;
  line-height: 1.65;
}

[data-theme="dark"] .theory-formula {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.35);
}

.theory-example-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.95rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  margin-top: 0.6rem;
  font-size: 0.92rem;
}

.theory-watchout {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid #f59e0b;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.1rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.theory-vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.theory-vocab-table th {
  background: var(--bg-alt);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-sub);
  border-bottom: 1.5px solid var(--border-color);
}

.theory-vocab-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  vertical-align: middle;
}

@media (max-width: 640px) {
  .theory-card {
    padding: 1.15rem;
  }

  .theory-nav-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .theory-dropdown-wrapper {
    min-width: 100%;
  }

  .theory-unit-pills {
    justify-content: center;
  }

  .theory-vocab-table th:nth-child(3),
  .theory-vocab-table td:nth-child(3) {
    display: none; /* Hide example on small screens to prevent scroll */
  }
}

/* ==========================================================================
   Main Hero App Title Banner
   ========================================================================== */
.main-app-hero-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(99, 102, 241, 0.07));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.main-app-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.main-app-hero-content {
  flex: 1 1 500px;
}

.main-app-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.main-app-hero-title {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 0.5rem 0;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.main-app-hero-subtitle {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-sub);
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.main-app-hero-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-sub);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ==========================================================================
   Unit Theory - Phrasal Verbs Handbook Callout Banner
   ========================================================================== */
.pv-handbook-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(124, 58, 237, 0.08));
  border: 1.5px dashed rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.pv-handbook-banner-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 320px;
}

.pv-handbook-banner-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.pv-handbook-banner-card h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
}

.pv-handbook-banner-card p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-sub);
  line-height: 1.45;
}

/* ==========================================================================
   Phrasal Verbs Handbook Tab Styles
   ========================================================================== */
.pv-handbook-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pv-filter-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pv-search-input-wrapper {
  position: relative;
  width: 100%;
}

.pv-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pv-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.96rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.pv-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.pv-tier-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pv-tier-btn {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-alt);
  color: var(--text-sub);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pv-tier-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.pv-tier-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.pv-alphabet-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.pv-alpha-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-sub);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pv-alpha-btn:hover {
  background: var(--bg-alt);
  color: var(--primary);
}

.pv-alpha-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pv-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.pv-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: var(--transition);
  position: relative;
}

.pv-card:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pv-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.pv-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pv-card-word {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.pv-card-ipa {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: #6366f1;
  font-weight: 600;
}

.pv-card-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.pv-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.pv-badge.separable {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pv-badge.inseparable {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.pv-badge.tier {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.pv-card-meaning {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.pv-card-example-box {
  background: rgba(241, 245, 249, 0.6);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--primary);
  font-size: 0.88rem;
  line-height: 1.5;
}

[data-theme="dark"] .pv-card-example-box {
  background: rgba(30, 41, 59, 0.6);
}

.pv-card-example-en {
  color: var(--text-main);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.pv-card-example-vi {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.82rem;
}

.pv-card-tip {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  color: #92400e;
  line-height: 1.4;
}

[data-theme="dark"] .pv-card-tip {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.15);
}

.pv-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 0.4rem;
}

@media (max-width: 640px) {
  .pv-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .main-app-hero-banner {
    padding: 1.25rem 1.2rem;
  }
  
  .main-app-hero-title {
    font-size: 1.3rem;
  }
}



/* ==========================================================================
   ENHANCED STYLES FOR 9 NEW FEATURES (GDPT 2018 SUITE)
   ========================================================================== */

/* --- SUB NAVIGATION GROUPING (TWO SEPARATE DEDICATED ROWS) --- */
.sub-nav {
  padding: 0.25rem 0 !important;
}
.sub-nav-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.35rem 0;
}
.sub-nav-row.row-grade {
  border-bottom: 1px dashed var(--border-color, #e2e8f0);
}
.sub-nav-row.row-common {
  padding-top: 0.45rem;
}
.nav-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}
.nav-section-tag.tag-grade {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.25);
}
.nav-section-tag.tag-common {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.28);
}
.nav-pill.pill-special {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #4f46e5;
  font-weight: 600;
}
.nav-pill.pill-special:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #4338ca;
}
.nav-pill.pill-special.active {
  background: #4f46e5 !important;
  color: #fff !important;
  border-color: #4f46e5 !important;
}

.nav-pill.pill-danger-tag {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #dc2626;
  font-weight: 600;
}
.nav-pill.pill-danger-tag:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}
.nav-pill.pill-danger-tag.active {
  background: #dc2626 !important;
  color: #fff !important;
  border-color: #dc2626 !important;
}

/* --- CLICK-TO-DEFINE POPOVER --- */
.ctd-word {
  cursor: pointer;
  border-bottom: 1px dashed rgba(59, 130, 246, 0.4);
  transition: all 0.15s ease;
  border-radius: 2px;
  padding: 0 1px;
}
.ctd-word:hover {
  background-color: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  border-bottom-color: #2563eb;
}
.ctd-popover-box {
  position: absolute;
  z-index: 9999;
  width: 280px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-main, #1e293b);
  animation: ctdFadeIn 0.15s ease-out;
}
@keyframes ctdFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ctd-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.ctd-word-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.ctd-word-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e40af;
}
.ctd-word-pos {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.ctd-word-ipa {
  font-size: 0.82rem;
  color: #6366f1;
  font-family: monospace;
  margin-bottom: 0.35rem;
}
.ctd-word-meaning {
  font-size: 0.9rem;
  color: #334155;
  margin-bottom: 0.65rem;
  font-weight: 500;
}
.ctd-popover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.4rem;
}
.ctd-btn-speak {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.ctd-btn-speak:hover {
  background: #2563eb;
  color: #fff;
}
.ctd-btn-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}
.ctd-btn-close:hover {
  color: #ef4444;
}
.ctd-btn-save {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s;
}
.ctd-btn-save:hover {
  background: #f8fafc;
  color: #eab308;
  border-color: #fde047;
}

/* --- MISTAKE BANK & BOOKMARK BUTTON --- */
.btn-bookmark {
  background: none;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}
.btn-bookmark:hover {
  color: #eab308;
  border-color: #facc15;
  background: rgba(234, 179, 8, 0.08);
}
.btn-bookmark.bookmarked {
  color: #d97706;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.mistake-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.mistake-stat-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mistake-stat-card.danger {
  border-left: 4px solid #ef4444;
}
.mistake-stat-card.success {
  border-left: 4px solid #10b981;
}
.mistake-stat-card.warning {
  border-left: 4px solid #f59e0b;
}
.mistake-stat-card.primary {
  border-left: 4px solid #6366f1;
}
.mistake-stat-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.25rem;
}
.mistake-stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

/* --- LEARNING PATHS: CHỐNG LIỆT vs SĂN 9+ --- */
.paths-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 768px) {
  .paths-hero-grid { grid-template-columns: 1fr; }
}
.path-selector-card {
  border-radius: 16px;
  padding: 1.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border: 2px solid transparent;
}
.path-selector-card.pass-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
  border-color: rgba(16, 185, 129, 0.4);
}
.path-selector-card.pass-card:hover, .path-selector-card.pass-card.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.1));
  border-color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.25);
}
.path-selector-card.elite-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.05));
  border-color: rgba(99, 102, 241, 0.4);
}
.path-selector-card.elite-card:hover, .path-selector-card.elite-card.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(79, 70, 229, 0.1));
  border-color: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.25);
}

.path-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.path-card-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
  font-weight: 500;
}
.path-selector-card.pass-card .path-card-title { color: #065f46; }
.path-selector-card.pass-card .path-card-desc { color: #047857; }
.path-selector-card.elite-card .path-card-title { color: #312e81; }
.path-selector-card.elite-card .path-card-desc { color: #3730a3; }

[data-theme="dark"] .path-selector-card.pass-card .path-card-title { color: #6ee7b7; }
[data-theme="dark"] .path-selector-card.pass-card .path-card-desc { color: #a7f3d0; }
[data-theme="dark"] .path-selector-card.elite-card .path-card-title { color: #a5b4fc; }
[data-theme="dark"] .path-selector-card.elite-card .path-card-desc { color: #c7d2fe; }

.rule-3sec-box {
  background: #ecfdf5;
  border: 1px solid #86efac;
  border-left: 5.5px solid #15803d;
  border-radius: 10px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.25rem;
  white-space: pre-line;
  font-size: 0.94rem;
  line-height: 1.65;
  color: #064e3b;
  font-weight: 500;
}
.rule-3sec-box.elite {
  background: #f5f3ff;
  border-color: #c4b5fd;
  border-left-color: #6d28d9;
  color: #2e1065;
}

[data-theme="dark"] .rule-3sec-box {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-left: 5.5px solid #10b981;
  color: #a7f3d0;
}
[data-theme="dark"] .rule-3sec-box.elite {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.35);
  border-left-color: #8b5cf6;
  color: #ddd6fe;
}

/* --- GDPT 2018 SENTENCE ORDERING & NOTICES --- */
.sentence-ordering-box {
  background: var(--bg-surface, #fff);
  border: 1.5px solid var(--border-color, #cbd5e1);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.sentence-item-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0.95rem;
  margin-bottom: 0.55rem;
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
}
.sentence-key-badge {
  background: #4f46e5;
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notice-graphic-box {
  background: #fefce8;
  border: 2px dashed #ca8a04;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  text-align: center;
  font-family: monospace, sans-serif;
  white-space: pre-line;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.6;
  color: #713f12;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}
.notice-graphic-box.warning {
  background: #fff1f2;
  border-color: #be123c;
  color: #881337;
}
.notice-graphic-box.info {
  background: #f0fdfa;
  border-color: #0f766e;
  color: #042f2e;
}

[data-theme="dark"] .notice-graphic-box {
  background: #292524;
  border: 2px dashed #eab308;
  color: #fef08a;
}
[data-theme="dark"] .notice-graphic-box.warning {
  background: #2a1215;
  border-color: #f43f5e;
  color: #fecdd3;
}
[data-theme="dark"] .notice-graphic-box.info {
  background: #042f2e;
  border-color: #14b8a6;
  color: #99f6e4;
}

/* --- BUBBLE SHEET & PRESSURE TIMER --- */
.exam-arena-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  position: relative;
}
.exam-main-stream {
  flex: 1;
  min-width: 0;
}
.bubble-sheet-sidebar {
  width: 260px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 14px;
  padding: 1.2rem;
  position: sticky;
  top: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
@media (max-width: 1024px) {
  .exam-arena-layout { flex-direction: column; }
  .bubble-sheet-sidebar { width: 100%; position: static; max-height: 280px; }
}

.bubble-sheet-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main, #1e293b);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding-bottom: 0.5rem;
}
.bubble-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
}
.bubble-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--bg-surface, #fff);
  color: var(--text-main, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
}
.bubble-cell:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}
.bubble-cell.answered {
  background: #10b981;
  color: #fff;
  border-color: #059669;
}
.bubble-cell.flagged {
  background: #f59e0b;
  color: #fff;
  border-color: #d97706;
}
.bubble-cell.wrong {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
}

/* Pressure Timer Red Pulse Alarm */
.timer-display.danger-pulse {
  background: #ef4444 !important;
  color: #ffffff !important;
  border: 2px solid #b91c1c !important;
  animation: timerPulse 1s infinite alternate;
}
@keyframes timerPulse {
  from { transform: scale(1); box-shadow: 0 0 0 rgba(239, 68, 68, 0.4); }
  to { transform: scale(1.04); box-shadow: 0 0 15px rgba(239, 68, 68, 0.8); }
}

/* --- RADAR ANALYTICS AFTER EXAM --- */
.radar-analytics-box {
  background: var(--bg-alt, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  text-align: left;
}
.radar-bar-row {
  margin-bottom: 0.75rem;
}
.radar-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.radar-bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.radar-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease;
}

.smart-advice-banner {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: #1e40af;
  margin-top: 1rem;
  line-height: 1.5;
}

/* --- IDIOMS HANDBOOK STYLES --- */
.idioms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.idiom-card {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}
.idiom-card:hover {
  transform: translateY(-2px);
  border-color: #818cf8;
  box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.12);
}
.idiom-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.idiom-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #4338ca;
  margin: 0;
}
.idiom-meaning {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main, #1e293b);
  margin-bottom: 0.75rem;
}
.idiom-example {
  background: var(--bg-alt, #f8fafc);
  border-left: 3px solid #6366f1;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  font-size: 0.86rem;
  color: var(--text-muted, #475569);
  margin-bottom: 0.75rem;
  font-style: italic;
}
.idiom-tip {
  font-size: 0.8rem;
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  margin-top: auto;
}

/* ==========================================================================
   PROFESSIONAL PRINT SHEET (CHUẨN BỘ GIÁO DỤC & ĐÀO TẠO)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 1.2cm 1cm 1.5cm 1cm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10.5pt !important;
    line-height: 1.4 !important;
    font-family: 'Times New Roman', Times, serif !important;
  }

  .app-header,
  .sub-nav,
  .quiz-top-bar,
  .bottom-submit-bar,
  .bubble-sheet-sidebar,
  .btn,
  .btn-speech,
  .btn-bookmark,
  .btn-unlock-answer,
  .q-footer,
  .level-filter-bar,
  .app-footer,
  .auth-modal-overlay,
  .modal-overlay,
  #ctd-popover {
    display: none !important;
  }

  .quiz-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Printable Ministry/School Header */
  .printable-exam-header {
    display: block !important;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }
  .print-head-top {
    display: flex;
    justify-content: space-between;
    text-align: center;
    margin-bottom: 8px;
  }
  .print-org {
    font-size: 10pt;
    font-weight: bold;
    text-transform: uppercase;
  }
  .print-motto {
    font-size: 9.5pt;
    font-weight: bold;
  }
  .print-title-box {
    text-align: center;
    margin: 6px 0;
  }
  .print-exam-name {
    font-size: 13pt;
    font-weight: bold;
    text-transform: uppercase;
  }
  .print-exam-meta {
    font-size: 10pt;
    font-style: italic;
  }

  .print-student-info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    border: 1px solid #000;
    padding: 6px 10px;
    font-size: 10pt;
    margin-top: 6px;
    gap: 8px;
  }

  .print-score-box {
    display: grid;
    grid-template-columns: 100px 1fr;
    border: 1px solid #000;
    margin-top: 6px;
    height: 60px;
  }
  .print-score-col {
    border-right: 1px solid #000;
    text-align: center;
    padding: 4px;
    font-weight: bold;
  }
  .print-remark-col {
    padding: 4px 8px;
  }

  /* Questions formatting */
  .questions-list {
    display: block !important;
  }
  .question-card {
    border: none !important;
    box-shadow: none !important;
    padding: 6px 0 !important;
    margin-bottom: 8px !important;
    page-break-inside: avoid;
  }
  .q-header {
    display: flex !important;
    margin-bottom: 4px !important;
  }
  .q-number {
    font-weight: bold !important;
    font-size: 10.5pt !important;
    color: #000 !important;
  }
  .q-content {
    font-size: 10.5pt !important;
    color: #000 !important;
    margin-bottom: 4px !important;
  }
  .options-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
  }
  .option-item {
    border: none !important;
    background: transparent !important;
    padding: 2px 0 !important;
    font-size: 10pt !important;
    color: #000 !important;
  }
  .option-letter {
    font-weight: bold !important;
    color: #000 !important;
  }

  /* Backpage Answer Matrix & Detailed Solutions */
  .print-answer-key-page {
    display: block !important;
    page-break-before: always;
  }
  .print-ak-header {
    text-align: center;
    font-size: 13pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 12px;
    border-bottom: 2px solid #000;
    padding-bottom: 4px;
  }
  .print-ak-matrix {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    border: 1px solid #000;
    text-align: center;
    font-size: 9.5pt;
    margin-bottom: 16px;
  }
  .print-ak-cell {
    border: 1px solid #ccc;
    padding: 4px 2px;
  }
  .print-ak-cell.num {
    background: #f0f0f0;
    font-weight: bold;
  }
  .print-ak-cell.ans {
    font-weight: bold;
    color: #000;
  }

  .explanation-box {
    display: block !important;
    border: 1px dashed #666 !important;
    background: #fafafa !important;
    padding: 6px !important;
    margin: 4px 0 8px 0 !important;
    font-size: 9pt !important;
    color: #222 !important;
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   VOCABULARY GAME ARENA (ĐẤU TRƯỜNG TRÒ CHƠI HỌC TỪ VỰNG)
   ========================================================================== */

.vocab-game-hub {
  padding-bottom: 3rem;
}

.game-hub-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  border-radius: 20px;
  padding: 2.2rem 2.5rem;
  color: #ffffff;
  margin-bottom: 2rem;
  box-shadow: 0 12px 30px rgba(49, 46, 129, 0.25);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.game-hub-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.game-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fde047;
  margin-bottom: 0.8rem;
}

.game-hero-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  background: linear-gradient(to right, #ffffff, #fed7aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.game-hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.92;
  max-width: 820px;
  margin-bottom: 1.5rem;
}

.game-hero-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.game-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.55rem 1.1rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

/* Filter Card */
.game-filter-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 1.25rem 1.75rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.game-filter-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main, #1e293b);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.game-filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 4 Game Cards Grid */
.game-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.5rem;
}

.game-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 18px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.game-card-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #ffffff;
  margin-bottom: 1.2rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.game-card-badge {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.badge-hot {
  background: #fdf2f8 !important;
  color: #be185d !important;
  border: 1px solid #fbcfe8;
}

.badge-elite {
  background: #f5f3ff !important;
  color: #6d28d9 !important;
  border: 1px solid #ddd6fe;
}

.game-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-bottom: 0.6rem;
}

.game-card-desc {
  font-size: 0.92rem;
  color: var(--text-muted, #64748b);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex: 1;
}

.game-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #64748b;
  padding: 0.75rem 0;
  border-top: 1px solid #f1f5f9;
  margin-bottom: 1rem;
}

.btn-game-play {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: filter 0.2s ease, transform 0.1s ease;
}

.btn-game-play:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.btn-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.btn-pink { background: linear-gradient(135deg, #ec4899, #be185d); }
.btn-green { background: linear-gradient(135deg, #10b981, #047857); }
.btn-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

/* Active Game Screen */
.active-game-container {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  position: relative;
}

.active-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  margin-bottom: 1.5rem;
}

.active-game-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main, #0f172a);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.active-game-stats {
  display: flex;
  gap: 0.75rem;
}

.game-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-weight: 700;
  font-size: 0.92rem;
  color: #1e293b;
}

.stat-score {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
}

.stat-streak {
  background: #fff7ed !important;
  color: #c2410c !important;
  border-color: #fed7aa !important;
}

.timer-warning {
  color: #ef4444 !important;
  animation: pulse 1s infinite;
}

.game-instruction-hint {
  font-size: 0.95rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 1.5rem;
  background: #f8fafc;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border-left: 4px solid #3b82f6;
}

/* Word Match Blitz Grid */
.match-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .match-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.match-card {
  min-height: 110px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s ease;
  user-select: none;
}

.match-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.12);
}

.match-card.selected {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2) !important;
}

.match-card.matched {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #16a34a !important;
  cursor: default;
  opacity: 0.6;
  font-size: 2rem;
  justify-content: center;
}

.match-card.en {
  border-top: 4px solid #3b82f6;
}

.match-card.vi {
  border-top: 4px solid #10b981;
}

.match-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.match-card-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.match-card-sub {
  font-size: 0.8rem;
  color: #64748b;
}

.card-speak-btn {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition: color 0.15s ease;
}

.card-speak-btn:hover {
  color: #2563eb;
}

/* Speed Blitz Arena */
.speed-timer-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.speed-timer-bar {
  height: 100%;
  background: linear-gradient(to right, #ec4899, #ef4444);
  transition: width 0.1s linear;
}

.speed-question-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.75rem;
}

.speed-word-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.speed-main-word {
  font-size: 2.2rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.btn-sound-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.btn-sound-circle:hover {
  background: #2563eb;
  color: #ffffff;
}

.speed-word-meta {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.meta-tag {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
}

.tag-type {
  font-style: italic;
  color: #2563eb;
}

.speed-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .speed-options-grid {
    grid-template-columns: 1fr;
  }
}

.speed-opt-btn {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.speed-opt-btn:hover {
  border-color: #ec4899;
  background: #fdf2f8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(236, 72, 153, 0.15);
}

.opt-key {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #475569;
  flex-shrink: 0;
}

.opt-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
}

.fever-active {
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.35) !important;
  border-color: #ec4899 !important;
  animation: fever-glow 2s infinite alternate;
}

@keyframes fever-glow {
  0% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.3); }
  100% { box-shadow: 0 0 40px rgba(236, 72, 153, 0.6); }
}

/* Scramble & Phonics Master */
.scramble-clue-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.clue-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.clue-meaning {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.clue-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: #64748b;
}

.btn-sound-small {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.scramble-slot-row {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.letter-slot {
  width: 52px;
  height: 58px;
  border-radius: 12px;
  border: 2px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #0f172a;
  background: #ffffff;
  transition: all 0.2s ease;
}

.letter-slot.filled {
  border-style: solid;
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}

.letter-slot.solved {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
}

.scramble-actions-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.letter-bubbles-grid {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.letter-bubble-btn {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 2px solid #cbd5e1;
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.15s ease;
}

.letter-bubble-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: #10b981;
  color: #059669;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.2);
}

.letter-bubble-btn.used {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
}

.phonics-stress-card {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 16px;
  padding: 1.75rem;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.stress-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.stress-prompt {
  font-size: 1.05rem;
  color: #1e293b;
  margin-bottom: 1.25rem;
}

.stress-buttons-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn-stress {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  background: #ffffff;
  border: 2px solid #10b981;
  color: #047857;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-stress:hover {
  background: #10b981;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Collocation & Idiom Connect Arena */
.colloc-connect-arena {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  .colloc-connect-arena {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.colloc-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.colloc-column-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  text-align: center;
  margin-bottom: 0.25rem;
}

.colloc-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  color: #1e293b;
  transition: all 0.2s ease;
}

.colloc-card:hover {
  border-color: #8b5cf6;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.12);
}

.colloc-card.selected {
  border-color: #7c3aed !important;
  background: #f5f3ff !important;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2) !important;
}

.colloc-card.matched {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #16a34a !important;
  cursor: default;
  opacity: 0.7;
}

.colloc-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #cbd5e1;
}

/* Game Over Modal */
.game-over-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: fadeIn 0.25s ease;
}

.game-over-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  border: 1px solid #e2e8f0;
}

.game-over-trophy {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.game-over-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 0.3rem;
}

.game-over-subtitle {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

.game-over-score-box {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.score-number {
  font-size: 3rem;
  font-weight: 900;
  color: #1d4ed8;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.score-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #3b82f6;
}

.game-over-rank {
  margin-bottom: 1.75rem;
}

.rank-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 800;
}

.game-over-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ==========================================================================
   VOCAB GAME UNIT SELECTOR & SCOPE BANNER
   ========================================================================== */

.game-unit-selector-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.05);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.03) 0%, var(--bg-surface, #ffffff) 100%);
}

.unit-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.unit-selector-title {
  font-size: 0.95rem;
  color: var(--text-main, #1e293b);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.game-unit-select {
  padding: 0.55rem 1.2rem;
  border-radius: 10px;
  border: 1.5px solid #10b981;
  background: var(--bg-surface, #ffffff);
  color: var(--text-main, #1e293b);
  font-size: 0.9rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
  transition: all 0.2s ease;
  min-width: 280px;
}

.game-unit-select:focus {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.unit-chips-scroll {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}

.unit-chips-scroll::-webkit-scrollbar {
  height: 4px;
}

.unit-chips-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.unit-chip-btn {
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-surface, #ffffff);
  color: var(--text-muted, #64748b);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.unit-chip-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
  color: #059669;
}

.unit-chip-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
}

.unit-chip-btn .chip-count {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Active Scope Summary Banner */
.game-scope-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #3b82f6;
  border-radius: 14px;
  padding: 1rem 1.4rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .game-scope-banner {
  background: linear-gradient(135deg, #1e293b 0%, #1e3a8a 100%);
  border-color: #3b82f6;
}

.scope-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #3b82f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.scope-banner-content {
  flex: 1;
}

.scope-banner-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #1d4ed8;
  margin-bottom: 0.2rem;
}

[data-theme="dark"] .scope-banner-title {
  color: #93c5fd;
}

.scope-banner-desc {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.45;
}

[data-theme="dark"] .scope-banner-desc {
  color: #cbd5e1;
}

.game-scope-meta {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  background: rgba(0, 0, 0, 0.03);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  margin: 0.6rem 0 0.8rem 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

[data-theme="dark"] .game-scope-meta {
  background: rgba(255, 255, 255, 0.05);
}

.game-header-scope-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  margin-left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: middle;
}

/* ==========================================================================
   PEDAGOGICAL ANSWER LOCKING STYLES
   ========================================================================== */

.option-item.locked-choice {
  cursor: default !important;
}

.btn-unlock-answer.btn-require-answer {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: #b45309;
}

.btn-unlock-answer.btn-require-answer:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
}

.badge-locked {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

/* ==========================================================================
   MASTER PORTAL SWITCHER BAR (SIÊU CỔNG HỌC TẬP)
   ========================================================================== */

.portal-nav-bar {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #31104b 100%);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  padding: 0.5rem 0;
  position: relative;
  z-index: 1001;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.portal-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portal-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fde047;
  text-transform: uppercase;
}

.portal-brand-tag i {
  color: #38bdf8;
}

.portal-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-pill {
  padding: 0.42rem 1.1rem;
  border-radius: 24px;
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-pill:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.portal-pill.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  border-color: #a78bfa;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.portal-pill#portal-btn-international.active {
  background: linear-gradient(135deg, #059669, #0284c7);
  border-color: #34d399;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
}

/* ==========================================================================
   INTERNATIONAL CERTIFICATION PORTAL (TOEIC • VSTEP)
   ========================================================================== */

.international-portal-wrapper {
  padding-bottom: 3rem;
  animation: fadeInPortal 0.3s ease-out;
}

@keyframes fadeInPortal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.intl-hero-banner {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 45%, #0f766e 100%);
  border-radius: 20px;
  padding: 2.2rem 2.5rem;
  color: #ffffff;
  margin-bottom: 1.75rem;
  box-shadow: 0 12px 30px rgba(6, 78, 59, 0.25);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.intl-hero-banner::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

.intl-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #a7f3d0;
  margin-bottom: 0.8rem;
}

.intl-hero-title {
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  background: linear-gradient(to right, #ffffff, #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intl-hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0.92;
  max-width: 820px;
}

.intl-nav-card {
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.intl-nav-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.25rem;
}

.intl-nav-tabs::-webkit-scrollbar {
  height: 4px;
}

.intl-nav-tabs::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.intl-nav-btn {
  white-space: nowrap;
  padding: 0.6rem 1.15rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.intl-nav-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
}

.intl-nav-btn.active {
  background: linear-gradient(135deg, #059669, #0d9488);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
}

.portal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1.5px solid var(--border-color, #e2e8f0);
}

/* Speaking Model Audio Controller with Pause, Resume, Stop */
.speech-ctrl-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface, #ffffff);
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
  border: 1px solid var(--border-color, #e2e8f0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.btn-speech-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 16px;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-speech-action.btn-play {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #ffffff;
}
.btn-speech-action.btn-play:hover {
  background: linear-gradient(135deg, #6d28d9, #5b21b6);
  transform: translateY(-1px);
}

.btn-speech-action.btn-pause {
  background: #f59e0b;
  color: #ffffff;
}
.btn-speech-action.btn-pause:hover {
  background: #d97706;
}

.btn-speech-action.btn-resume {
  background: #10b981;
  color: #ffffff;
}
.btn-speech-action.btn-resume:hover {
  background: #059669;
}

.btn-speech-action.btn-stop {
  background: #ef4444;
  color: #ffffff;
}
.btn-speech-action.btn-stop:hover {
  background: #dc2626;
}

.speech-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7c3aed;
  background: #f3e8ff;
  padding: 0.25rem 0.55rem;
  border-radius: 12px;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background: #7c3aed;
  border-radius: 50%;
  animation: pulse-ring 1.2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(124, 58, 237, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

/* ======================================================
   IELTS & CHUYÊN ANH / HSG STYLING EXTENSIONS
   ====================================================== */
.badge-gold {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #f59e0b;
}

/* Chuyên Anh Section Container */
.chuyen-anh-hub {
  animation: fadeIn 0.3s ease;
}

.ca-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.ca-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--border-color);
}

.ca-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ca-questions-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ca-card {
  background: var(--bg-body);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 1.15rem;
  transition: all 0.2s ease;
}

.ca-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ca-card-correct {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.03) !important;
}

.ca-card-wrong {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.03) !important;
}

.ca-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.ca-q-num {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.95rem;
}

.ca-root-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(236, 72, 153, 0.12);
  color: #db2777;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.ca-pos-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.ca-sentence-box {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.ca-blank-spot {
  font-weight: 700;
  color: #db2777;
  border-bottom: 2px dashed #db2777;
  padding: 0 4px;
}

.ca-input-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.ca-input {
  flex: 1;
  min-width: 220px;
  font-size: 0.92rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
}

.ca-explanation-box {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.6;
  animation: fadeIn 0.25s ease;
}

.ca-exp-correct {
  color: #10b981;
  font-weight: 700;
  font-size: 0.92rem;
}

.ca-exp-text {
  color: var(--text-main);
}

/* ==========================================================================
   CHUYEN ANH & HSG THEORY HANDBOOK & ACADEMIC MODULE STYLES
   ========================================================================== */
.ca-theory-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.ca-theory-tab-btn:hover {
  background: var(--bg-body);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ca-theory-tab-btn.active {
  background: var(--bg-body);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.ca-handbook-table th {
  background: rgba(99, 102, 241, 0.08);
  font-weight: 700;
}

.ca-handbook-table tr:hover td {
  background: rgba(99, 102, 241, 0.03);
}

.ca-callout {
  border-left: 4px solid #f59e0b;
}

.ca-callout-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.ca-callout-danger {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.ca-callout-info {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.ca-wf-item {
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.ca-wf-item:hover {
  transform: translateY(-2px);
  border-color: #ec4899 !important;
  box-shadow: 0 4px 10px rgba(236, 72, 153, 0.1);
}

.ca-trap-card {
  transition: transform 0.15s ease;
}

.ca-trap-card:hover {
  transform: translateX(4px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}


/* ==========================================================================
   ACADEMIC IELTS SPEAKING - DECLUTTERED UI SYSTEM
   ========================================================================== */
.speaking-subnav-container {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-alt);
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.speaking-subnav-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.speaking-subnav-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-main);
}

.speaking-subnav-btn.active {
  background: var(--bg-surface);
  color: #1e40af;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Dialogue Pair Container */
.speaking-dialogue-turn {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Examiner Bubble */
.dialogue-bubble-examiner {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3b82f6;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  position: relative;
}

.dialogue-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.badge-examiner {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-candidate {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.dialogue-text-question {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
}

/* Candidate Bubble */
.dialogue-bubble-candidate {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #10b981;
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.dialogue-text-answer {
  font-size: 1.02rem;
  color: #1e293b;
  line-height: 1.75;
  margin-bottom: 0.85rem;
}

/* Vocabulary Pills */
.vocab-chips-wrapper {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.vocab-chips-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vocab-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.vocab-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 9999px;
  font-size: 0.88rem;
  line-height: 1.4;
  transition: all 0.2s ease;
}

.vocab-chip:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

.vocab-chip .chip-en {
  font-weight: 700;
  color: #15803d;
}

.vocab-chip .chip-vn {
  color: #475569;
  font-style: italic;
  font-size: 0.82rem;
}

/* Cambridge Official Candidate Task Card (Part 2) */
.cambridge-task-card {
  background: #fdfbf7;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  position: relative;
  margin-bottom: 1.5rem;
}

.cambridge-card-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cambridge-card-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

.cambridge-prompt-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 1rem;
}

.cambridge-bullet-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.25rem;
}

.cambridge-bullet-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: #334155;
  line-height: 1.6;
}

.cambridge-bullet-list li::before {
  content: "•";
  position: absolute;
  left: 0.4rem;
  color: #2563eb;
  font-size: 1.4rem;
  line-height: 1;
}

/* 1-Minute Prep Timer Box */
.prep-timer-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.prep-timer-clock {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1d4ed8;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Audio Player Bar */
.speaking-audio-deck {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   WRITING VISUAL CHARTS & DIAGRAMS SYSTEM (IELTS & VSTEP)
   ========================================================================== */
.writing-chart-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.25rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  font-family: 'Times New Roman', Times, serif !important;
}

.writing-chart-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
}

.chart-svg-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  overflow-x: auto;
}

.chart-svg {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}

.chart-svg text {
  font-family: 'Times New Roman', Times, serif !important;
}

.chart-svg .chart-gridline {
  stroke: var(--border-color, #e2e8f0);
  stroke-dasharray: 4, 4;
  opacity: 0.8;
}

.chart-svg .chart-axis {
  stroke: var(--text-muted, #94a3b8);
  stroke-width: 1.5;
}

.chart-svg .chart-bar {
  transition: transform 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}

.chart-svg .chart-bar:hover {
  opacity: 0.85;
  filter: brightness(1.1);
}

.chart-svg .chart-point {
  transition: r 0.2s ease;
  cursor: pointer;
}

.chart-svg .chart-point:hover {
  r: 7;
}

.chart-legend-box {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem;
  margin-top: 0.75rem;
  background: var(--bg-body, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  font-size: 0.85rem;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--text-main);
}

.chart-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.chart-legend-line {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  display: inline-block;
}

/* Process Diagram Styling */
.process-flow-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  position: relative;
  margin: 1rem 0;
}

.process-step-card {
  background: var(--bg-body, #f8fafc);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 1.1rem;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.process-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.process-step-badge {
  background: #1e3a8a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.process-step-icon {
  font-size: 1.6rem;
}

.process-step-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 0.4rem;
  line-height: 1.35;
}

.process-step-desc {
  font-size: 0.86rem;
  color: var(--text-muted, #475569);
  line-height: 1.55;
}

/* Academic Table Styling */
.academic-chart-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.academic-chart-table th {
  background: #1e3a8a;
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-weight: 800;
  text-align: left;
  border: 1px solid #1e3a8a;
}

.academic-chart-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.academic-chart-table tr:nth-child(even) {
  background: var(--bg-body, #f8fafc);
}

.academic-chart-table tr:hover {
  background: rgba(30, 58, 138, 0.05);
}




/* ==========================================================================
   Word Formation (Cấu Tạo Từ) & Word Families Component Styles
   ========================================================================== */

.wf-hub-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.wf-unit-navigation-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.wf-nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.wf-dropdown-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wf-select-dropdown {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm, 6px);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  max-width: 320px;
}

.wf-family-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.wf-family-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.wf-search-input {
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.88rem;
  width: 260px;
  outline: none;
}

.wf-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.wf-family-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.wf-family-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.wf-family-table th {
  background: #1e3a8a;
  color: #ffffff;
  padding: 0.65rem 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid #1e3a8a;
}

.wf-family-table td {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  line-height: 1.5;
}

.wf-family-table tr:nth-child(even) {
  background: var(--bg-body, #f8fafc);
}

.wf-family-table tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

/* Badges for Word Categories */
.wf-badge-root {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.85rem;
  background: #f1f5f9;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  text-transform: uppercase;
}

.wf-badge-pos {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.82rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.wf-badge-noun {
  color: #1d4ed8;
  font-weight: 600;
}

.wf-badge-verb {
  color: #047857;
  font-weight: 600;
}

.wf-badge-adj {
  color: #b45309;
  font-weight: 600;
}

.wf-badge-adv {
  color: #7e22ce;
  font-weight: 600;
}

/* Question Practice Cards */
.wf-questions-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wf-question-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wf-question-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-md);
}

.wf-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--border-color);
}

.wf-q-index {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.95rem;
}

.wf-sentence-box {
  font-size: 1.08rem;
  line-height: 2.1;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.wf-input {
  display: inline-block;
  min-width: 140px;
  max-width: 220px;
  padding: 0.3rem 0.7rem;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  font-size: 1.02rem;
  font-weight: 800;
  color: #1e3a8a;
  text-align: center;
  outline: none;
  background: var(--bg-surface);
  transition: all 0.2s ease;
  vertical-align: baseline;
  margin: 0 4px;
}

.wf-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.18);
}

.wf-input.is-correct {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  color: #065f46 !important;
}

.wf-input.is-incorrect {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
}

.wf-actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.wf-result-box {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-top: 0.75rem;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wf-result-box.wf-correct {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
}

.wf-result-box.wf-incorrect {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.wf-hint-box {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wf-explanation-box {
  background: var(--bg-body, #f8fafc);
  border-left: 4px solid #2563eb;
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  margin-top: 0.75rem;
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
}

.wf-progress-banner {
  background: linear-gradient(135deg, #047857, #10b981);
  color: #ffffff;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg, 12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.wf-progress-text {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ==========================================================================
   SPOTLIGHT SEARCH MODAL (Ctrl + K)
   ========================================================================== */
.spotlight-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4.5rem 1rem 2rem;
  z-index: 10005;
  animation: fadeIn 0.18s ease-out;
}

.spotlight-card {
  width: 100%;
  max-width: 680px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.spotlight-search-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.spotlight-search-icon {
  font-size: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}

.spotlight-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  outline: none;
}

.spotlight-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.spotlight-esc-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
}

.spotlight-filter-strip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
}
.spotlight-filter-strip::-webkit-scrollbar { display: none; }

.spotlight-tag {
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.spotlight-tag:hover {
  color: var(--text-main);
  border-color: var(--primary);
}

.spotlight-tag.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.spotlight-results-container {
  overflow-y: auto;
  padding: 0.6rem 0.8rem;
  flex: 1;
  max-height: 480px;
}

.spotlight-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  margin-bottom: 0.3rem;
}

.spotlight-item:hover, .spotlight-item.selected {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
  transform: translateX(3px);
}

.spotlight-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.spotlight-item-content {
  flex: 1;
  min-width: 0;
}

.spotlight-item-title {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.spotlight-item-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.2rem;
  padding: 0.65rem 1.4rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-alt);
}

.spotlight-footer kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-weight: 700;
}

/* ==========================================================================
   STUDENT PERSONAL DASHBOARD MODAL
   ========================================================================== */
.student-dashboard-card {
  width: 100%;
  max-width: 640px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-xl);
  padding: 1.75rem;
  max-height: 90vh;
  overflow-y: auto;
}

.student-dashboard-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.student-avatar-wrap {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.student-name-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
}

.student-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-top: 0.25rem;
}

.streak-banner-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.12));
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md, 12px);
  padding: 1.1rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.streak-icon-fire {
  font-size: 2.2rem;
  animation: pulse 1.8s infinite ease-in-out;
}

.streak-count-text {
  font-size: 1.08rem;
  font-weight: 800;
  color: #b45309;
}

[data-theme="dark"] .streak-count-text {
  color: #fde047;
}

.streak-sub-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

.streak-pill-tag {
  font-size: 0.75rem;
  font-weight: 800;
  background: #ea580c;
  color: #fff;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.student-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

@media (max-width: 600px) {
  .student-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.student-metric-box {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 12px);
  padding: 0.9rem;
  text-align: center;
}

.metric-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.4rem auto;
  font-size: 0.95rem;
}

.metric-value-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.metric-label-text {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.badges-section-header {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.student-badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

@media (max-width: 600px) {
  .student-badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.badge-item-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
  opacity: 0.55;
  filter: grayscale(0.8);
  transition: var(--transition);
}

.badge-item-card.unlocked {
  opacity: 1;
  filter: none;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.05);
}

.badge-item-icon {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.badge-item-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge-item-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.student-dashboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

/* ==========================================================================
   BOOKMARKS MODAL
   ========================================================================== */
.bookmarks-card {
  width: 100%;
  max-width: 760px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-xl);
  padding: 1.75rem;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.bookmarks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--border-color);
}

.bookmarks-content-body {
  overflow-y: auto;
  flex: 1;
  padding-right: 0.4rem;
}

.bookmarks-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: 1rem;
}

/* Bookmark Button in Questions */
.btn-bookmark {
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.18s ease;
}

.btn-bookmark:hover {
  color: #f59e0b;
  border-color: #f59e0b;
}

.btn-bookmark.bookmarked {
  background: #fef3c7;
  color: #d97706;
  border-color: #f59e0b;
}

[data-theme="dark"] .btn-bookmark.bookmarked {
  background: rgba(245, 158, 11, 0.22);
  color: #fde047;
  border-color: #f59e0b;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS ENHANCEMENTS FOR SUB-NAV
   ========================================================================== */
@media (max-width: 992px) {
  .sub-nav-row {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
  .sub-nav-row::-webkit-scrollbar {
    height: 4px;
  }
  .sub-nav-row::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 4px;
  }
}

/* ==========================================================================
   PRINT ENGINE & A4 EXAM PAPER EXPORT
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 1.2cm 1.5cm 1.5cm 1.5cm;
  }

  /* Hide all interactive UI and web chrome */
  .portal-nav-bar,
  .app-header,
  .sub-nav,
  .quiz-top-bar,
  .level-filter-bar,
  .bubble-sheet-panel,
  .bottom-submit-bar,
  .floating-font-pill,
  .font-size-widget,
  .app-footer,
  .btn,
  .btn-speech,
  .btn-bookmark,
  .auth-modal-overlay,
  .spotlight-modal-overlay,
  #exam-timer,
  .passage-reference-badge a {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }

  .main-wrapper {
    padding: 0 !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  /* Ultra-compact Exam Header */
  .printable-exam-header {
    display: block !important;
    font-family: 'Times New Roman', Times, serif !important;
    margin-bottom: 6px !important;
    border-bottom: 1.5px solid #000 !important;
    padding-bottom: 4px !important;
  }

  .print-head-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    font-size: 8.5pt !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
  }

  .print-org {
    font-weight: 700;
    font-size: 8.5pt;
    text-transform: uppercase;
  }

  .print-motto {
    font-weight: 700;
    font-size: 8.5pt;
    text-align: right;
  }

  .print-title-box {
    text-align: center;
    margin: 3px 0 !important;
  }

  .print-exam-name {
    font-size: 11pt !important;
    font-weight: 800;
    text-transform: uppercase;
  }

  .print-exam-meta {
    font-size: 8.5pt !important;
    font-style: italic;
  }

  .print-student-info-grid {
    display: flex !important;
    justify-content: space-between !important;
    border: 1px solid #000 !important;
    padding: 2px 6px !important;
    font-size: 8.5pt !important;
    margin-bottom: 4px !important;
  }

  .print-score-box {
    display: flex !important;
    border: 1px solid #000 !important;
    height: 36px !important;
    margin-bottom: 6px !important;
  }

  .print-score-col {
    width: 100px;
    border-right: 1px solid #000;
    text-align: center;
    padding: 2px;
    font-weight: bold;
    font-size: 8pt;
  }

  .print-remark-col {
    flex: 1;
    padding: 2px 6px;
    font-size: 8pt;
  }

  /* Newspaper 2-Column Print Flow for Questions (Maximizes space & saves paper) */
  .exam-arena-layout {
    display: block !important;
  }

  .exam-main-stream {
    display: block !important;
    width: 100% !important;
    column-count: 2 !important;
    column-gap: 16px !important;
    column-rule: 0.5px solid #bbb !important;
  }

  /* Reading Passages Span Across Both Columns */
  .reading-passage-box {
    column-span: all !important;
    border: 1px solid #000 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 6px 10px !important;
    margin-bottom: 8px !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
  }

  .reading-passage-header {
    border-bottom: 0.5px solid #000 !important;
    padding-bottom: 2px !important;
    margin-bottom: 4px !important;
    font-size: 8.5pt !important;
  }

  .reading-passage-title {
    font-weight: bold;
    font-size: 9.5pt;
  }

  .reading-passage-body {
    font-size: 9pt !important;
    line-height: 1.35 !important;
    text-align: justify;
  }

  /* Compact Question Card (Dense layout fitting 8-12 questions per A4 page) */
  .question-card {
    border: none !important;
    border-bottom: 0.5px dashed #aaa !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 3px 0 !important;
    margin-bottom: 5px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .q-header {
    margin-bottom: 2px !important;
  }

  .q-number {
    font-weight: 800 !important;
    font-size: 9.5pt !important;
    color: #000 !important;
  }

  .q-category-tag, .q-header .badge, .q-num-box .badge {
    display: none !important;
  }

  .q-instruction {
    font-size: 8.5pt !important;
    font-style: italic !important;
    margin-bottom: 2px !important;
  }

  .q-content {
    font-size: 9.5pt !important;
    line-height: 1.28 !important;
    color: #000 !important;
    margin-bottom: 3px !important;
  }

  .options-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 2px 8px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .option-item {
    border: none !important;
    background: transparent !important;
    padding: 1px 0 !important;
    color: #000 !important;
    box-shadow: none !important;
    font-size: 9pt !important;
    line-height: 1.25 !important;
    display: flex !important;
    align-items: baseline !important;
  }

  .option-letter {
    font-weight: bold !important;
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    border-radius: 50% !important;
    width: 15px !important;
    height: 15px !important;
    line-height: 15px !important;
    font-size: 7.5pt !important;
    text-align: center !important;
    margin-right: 4px !important;
    flex-shrink: 0 !important;
  }

  .option-text {
    font-size: 9pt !important;
  }

  /* Clean Exam Paper Mode (Hide answers & explanations) */
  body.print-mode-clean .explanation-box,
  body.print-mode-clean .q-explanation,
  body.print-mode-clean .q-footer,
  body.print-mode-clean .option-item.is-correct,
  body.print-mode-clean .option-item.is-wrong {
    display: none !important;
  }

  /* Key Mode: Highlight correct answer and show explanations */
  body.print-mode-key .option-item.is-correct .option-letter {
    background: #000 !important;
    color: #fff !important;
  }

  body.print-mode-key .explanation-box,
  body.print-mode-key .q-explanation {
    display: block !important;
    background: #f8f8f8 !important;
    border-left: 2px solid #000 !important;
    padding: 2px 6px !important;
    font-size: 8pt !important;
    line-height: 1.25 !important;
    margin-top: 3px !important;
  }
}

/* =========================================================================
   VOCABULARY UPGRADE: DUAL LIST VIEW & FLASHCARDS
   ========================================================================= */

.vocab-container {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.vocab-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.vocab-mode-strip {
  display: inline-flex;
  background: var(--bg-main, #f1f5f9);
  border-radius: 9999px;
  padding: 4px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.vocab-mode-pill {
  border: none;
  background: transparent;
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.vocab-mode-pill:hover {
  color: var(--primary);
}

.vocab-mode-pill.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.vocab-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.vocab-search-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.vocab-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.vocab-search-wrap i.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.vocab-search-input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.vocab-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.vocab-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.vocab-filter-pill {
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.vocab-filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.vocab-filter-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.vocab-stats-badge {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Grid of Vocabulary Cards in List View */
.vocab-entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.15rem;
}

.vocab-entry-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.vocab-entry-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.4);
}

.vocab-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.vocab-card-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-main);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.vocab-badge-pos {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  letter-spacing: 0.3px;
}

.vocab-badge-pos.pos-n {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.vocab-badge-pos.pos-v {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.vocab-badge-pos.pos-adj {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.vocab-badge-pos.pos-adv {
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.vocab-badge-pos.pos-phr,
.vocab-badge-pos.pos-other {
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.vocab-card-word-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.vocab-card-word {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.vocab-card-ipa {
  font-family: 'Times New Roman', serif;
  font-size: 0.95rem;
  color: var(--text-muted);
  background: var(--bg-main);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.vocab-card-meaning {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.85rem;
  line-height: 1.4;
}

.vocab-card-example-box {
  margin-top: auto;
  background: var(--bg-main);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text-sub);
  position: relative;
}

.vocab-card-example-text {
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 0.35rem;
}

.vocab-kw {
  background: rgba(245, 158, 11, 0.22);
  color: inherit;
  font-weight: 700;
  padding: 0 3px;
  border-radius: 3px;
}

.vocab-example-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-sound-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-sound-small:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

/* Flashcard Progress Bar */
.vocab-progress-container {
  width: 100%;
  max-width: 580px;
  margin: 0 auto 1.25rem auto;
}

.vocab-progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.vocab-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.vocab-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 600;
}

/* Print Wordlist Layout */
@media print {
  body.print-wordlist #main-nav,
  body.print-wordlist .portal-nav-bar,
  body.print-wordlist .app-header,
  body.print-wordlist .sub-nav,
  body.print-wordlist .vocab-top-bar,
  body.print-wordlist .vocab-toolbar,
  body.print-wordlist .vocab-mode-strip,
  body.print-wordlist .btn-sound-small,
  body.print-wordlist .theme-toggle,
  body.print-wordlist .font-toggle-strip,
  body.print-wordlist footer,
  body.print-wordlist .quiz-top-bar {
    display: none !important;
  }

  body.print-wordlist .vocab-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* 2-Column Newspaper Layout for Vocabulary Printing to Save Paper */
  body.print-wordlist .vocab-entries-grid {
    display: block !important;
    column-count: 2 !important;
    column-gap: 14px !important;
  }

  body.print-wordlist .vocab-entry-card {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    padding: 4px 8px !important;
    margin-bottom: 6px !important;
    display: block !important;
  }

  body.print-wordlist .vocab-card-word {
    font-size: 10pt !important;
    color: #000 !important;
  }

  body.print-wordlist .vocab-card-meaning {
    font-size: 9.5pt !important;
    color: #111 !important;
  }

  body.print-wordlist .vocab-card-example-box {
    border-left: 2px solid #555 !important;
    background: #f9f9f9 !important;
    padding: 3px 6px !important;
    font-size: 8.5pt !important;
    color: #333 !important;
  }
}

/* =========================================================================
   WRITING RUBRICS MODAL & EVALUATION CALCULATOR (IELTS & VSTEP)
   ========================================================================= */

.rubric-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl, 16px);
  max-width: 1100px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: fadeIn 0.25s ease;
}

.rubric-modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
}

.rubric-tabs-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.rubric-tab-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.45rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.rubric-tab-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.rubric-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.rubric-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.rubric-grid-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .rubric-grid-layout {
    grid-template-columns: 1fr;
  }
}

.rubric-score-banner {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
  border: 1.5px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.rubric-criterion-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.rubric-criterion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.rubric-score-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.rubric-score-pill {
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}

.rubric-score-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.rubric-score-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.rubric-desc-box {
  background: var(--bg-main);
  border-left: 3px solid var(--primary);
  padding: 0.55rem 0.8rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.84rem;
  color: var(--text-sub);
  line-height: 1.45;
}

/* =========================================================================
   COMPREHENSIVE MOBILE RESPONSIVE OPTIMIZATIONS (TABLET & SMARTPHONE)
   ========================================================================= */

@media (max-width: 768px) {
  .portal-nav-inner {
    padding: 0.5rem 0.75rem;
  }

  .portal-pills {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .portal-pill {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    white-space: nowrap;
  }

  .header-inner {
    padding: 0.5rem 0.75rem;
  }

  .brand-title {
    font-size: 0.95rem;
    line-height: 1.25;
  }

  .brand-subtitle {
    display: none;
  }

  .author-banner-badge {
    display: none;
  }

  .header-actions {
    gap: 0.3rem;
  }

  .font-size-strip {
    display: none;
  }

  .quiz-top-bar {
    padding: 0.75rem;
    gap: 0.65rem;
  }

  .options-grid {
    grid-template-columns: 1fr !important;
  }

  .unit-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .vocab-entries-grid {
    grid-template-columns: 1fr;
  }

  .vocab-top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .vocab-mode-strip {
    width: 100%;
    justify-content: center;
  }

  .vocab-mode-pill {
    flex: 1;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
  }

  .spotlight-card,
  .student-dashboard-card,
  .bookmarks-card,
  .rubric-modal-card {
    width: 95vw !important;
    max-height: 90vh !important;
    margin: 10px auto !important;
    padding: 0.85rem !important;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 0.85rem;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .header-icon-btn,
  .streak-badge-btn,
  .theme-toggle-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .option-item {
    padding: 0.6rem 0.75rem;
    font-size: 0.88rem;
  }
}

/* =========================================================================
   AUTH, VIP MEMBERSHIP & PAYWALL STYLES
   ========================================================================= */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-backdrop[style*="display: none"] {
  display: none !important;
}

.modal-backdrop[style*="display: flex"] {
  display: flex !important;
}

.auth-dialog {
  max-width: 440px;
  width: 92%;
  background: var(--bg-surface);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  overflow: hidden;
  animation: modalFadeIn 0.25s ease-out;
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem 0 1rem;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
}

.auth-tab-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.auth-body {
  padding: 1.5rem;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap .auth-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-input-wrap input {
  padding-left: 36px !important;
}

.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.auth-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #f87171;
}

.auth-alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

/* VIP Upgrade Dialog */
.vip-dialog {
  max-width: 820px;
  width: 95%;
  background: var(--bg-surface);
  border-radius: 18px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.vip-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
}

.vip-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.vip-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* 4 Packages Grid */
.vip-packages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}

.vip-pkg-card {
  position: relative;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vip-pkg-card:hover {
  transform: translateY(-3px);
  border-color: #f59e0b;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.15);
}

.vip-pkg-card.active {
  border-color: #f59e0b;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.01) 100%);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.22);
}

.vip-pkg-tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.vip-pkg-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 6px;
  margin-bottom: 4px;
}

.vip-pkg-price {
  font-size: 1.25rem;
  font-weight: 900;
  color: #d97706;
  margin-bottom: 4px;
}

.vip-pkg-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 8px;
}

.vip-pkg-radio {
  color: #cbd5e1;
  font-size: 1rem;
}

.vip-pkg-card.active .vip-pkg-radio {
  color: #f59e0b;
}

/* Bank Transfer Box */
.vip-transfer-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.vip-qr-box {
  text-align: center;
  background: #fff;
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vip-qr-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 6px;
}

.vip-qr-image {
  width: 190px;
  height: 190px;
  object-fit: contain;
  border-radius: 6px;
}

.vip-qr-hint {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.3;
}

.vip-bank-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vip-info-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.vip-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-color);
}

.vip-label {
  color: var(--text-muted);
}

.vip-val {
  color: var(--text-main);
  text-align: right;
}

.highlight-val {
  cursor: pointer;
  color: var(--primary-color) !important;
  font-family: monospace;
  font-size: 0.95rem;
  transition: all 0.15s;
}

.highlight-val:hover {
  text-decoration: underline;
}

.copy-icon {
  font-size: 0.75rem;
  margin-left: 4px;
  opacity: 0.7;
}

.btn-zalo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.75rem;
  background: #0068ff !important;
  color: #fff !important;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 104, 255, 0.3);
  transition: all 0.2s;
}

.btn-zalo:hover {
  background: #0056d6 !important;
  transform: translateY(-2px);
}

.vip-subnote {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 0;
  line-height: 1.4;
  text-align: center;
}

/* VIP Benefits Grid */
.vip-benefits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(2, 132, 199, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 1rem;
}

.vip-benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-main);
}

/* Paywall Locked UI Elements */
.locked-unit-badge {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.unit-card.is-locked {
  position: relative;
  opacity: 0.85;
}

.unit-card.is-locked::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  border-radius: inherit;
}

/* Paywall Blurred Card Overlay */
.paywall-blur-card {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  border: 2px dashed #f59e0b;
}

.paywall-content-blurred {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  opacity: 0.45;
  padding: 1.25rem;
  background: var(--bg-surface);
}

.paywall-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  color: #fff;
  z-index: 10;
}

.paywall-lock-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fde047;
}

.paywall-lock-desc {
  font-size: 0.9rem;
  color: #cbd5e1;
  max-width: 520px;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.locked-blur-preview {
  filter: blur(4px) !important;
  opacity: 0.45 !important;
  user-select: none !important;
  cursor: pointer !important;
  position: relative !important;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.locked-blur-preview:hover {
  opacity: 0.65 !important;
  filter: blur(3px) !important;
}

@media (max-width: 768px) {
  .vip-packages-grid {
    grid-template-columns: 1fr 1fr;
  }
  .vip-transfer-container {
    grid-template-columns: 1fr;
  }
  .vip-benefits-grid {
    grid-template-columns: 1fr;
  }
}



/* =========================================================================
   PREMIUM AUTH MODAL STYLES (ĐĂNG NHẬP / ĐĂNG KÝ HIỆN ĐẠI)
   ========================================================================= */
.auth-dialog-premium {
  max-width: 480px !important;
  width: 92% !important;
  border-radius: 20px !important;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;
  border: none !important;
  overflow: hidden !important;
  background: var(--bg-surface) !important;
}

.auth-hero-banner {
  position: relative;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  padding: 1.5rem 1.75rem 1.25rem 1.75rem;
  color: #fff;
  overflow: hidden;
}

.auth-hero-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.35) 0%, rgba(234, 179, 8, 0) 70%);
  pointer-events: none;
}

.auth-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.auth-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fef08a;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.auth-hero-title {
  margin: 0 0 4px 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff;
}

.auth-hero-sub {
  margin: 0;
  font-size: 0.82rem;
  color: #c7d2fe;
  line-height: 1.4;
}

/* Segmented Tabs */
.auth-nav-tabs-wrapper {
  padding: 0.85rem 1.5rem 0 1.5rem;
  background: var(--bg-surface);
}

.auth-segmented-tabs {
  display: flex;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.auth-seg-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-seg-tab.active {
  background: var(--bg-surface);
  color: #4338ca;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .auth-seg-tab.active {
  background: #312e81;
  color: #c7d2fe;
}

/* Input Fields */
.auth-group {
  margin-bottom: 0.95rem !important;
}

.auth-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
}

.auth-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
  transition: color 0.2s;
}

.auth-input {
  width: 100%;
  padding: 0.65rem 0.9rem 0.65rem 40px !important;
  font-size: 0.92rem;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-input:focus {
  outline: none;
  border-color: #6366f1;
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-input:focus + .auth-field-icon,
.auth-input-container:focus-within .auth-field-icon {
  color: #6366f1;
}

.auth-pwd-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.auth-pwd-toggle:hover {
  color: var(--text-main);
}

.auth-helper-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.auth-password-row {
  display: flex;
  gap: 10px;
}

@media (max-width: 520px) {
  .auth-password-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Submit buttons */
.auth-submit-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0.5rem;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.45);
}

.auth-submit-reg {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.auth-submit-reg:hover {
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.45);
}

.auth-footer-prompt {
  text-align: center;
  margin-top: 1.15rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer-prompt a {
  color: #6366f1;
  font-weight: 700;
  text-decoration: none;
}

.auth-footer-prompt a:hover {
  text-decoration: underline;
}
