/* ==========================================================================
   TINGLI EXAM SYSTEM — AUDITORY & VISUAL ADDONS (IELTS MATE CANVAS COMPATIBLE)
   Phục vụ đề thi Nghe Hán ngữ TTTH 1 & TTTH 5 (ĐH Huế: TRU4012 & TRU4052)
   ========================================================================== */

/* Global Pinyin & Meaning Toggle Rules */
body.hide-pinyin .pinyin-text,
body.hide-pinyin .pinyin-badge,
body.hide-pinyin .dialogue-py,
body.hide-pinyin .expl-pinyin,
body.hide-pinyin .py-sub,
body.hide-pinyin .py-line,
body.hide-pinyin .idiom-pinyin,
body.hide-pinyin .s-py,
body.hide-pinyin .notebook-py-cell,
body.hide-pinyin [data-lang="pinyin"],
body.hide-pinyin .py {
  display: none !important;
}

body.hide-meaning .vi-trans,
body.hide-meaning .meaning-box,
body.hide-meaning .dialogue-vi,
body.hide-meaning .expl-vi,
body.hide-meaning .vi-sub,
body.hide-meaning .vi-line,
body.hide-meaning .lesson-title-vi,
body.hide-meaning .pic-label-text,
body.hide-meaning .idiom-vi,
body.hide-meaning .s-vi,
body.hide-meaning .notebook-vi-cell,
body.hide-meaning [data-lang="meaning"],
body.hide-meaning .vi {
  display: none !important;
}

/* Floating Quick Control Bar */
.floating-quick-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-floating-tool {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-floating-tool:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.btn-floating-tool.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Section Title Badges */
.tingli-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-glow);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tingli-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.tingli-section-header {
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.tingli-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.35rem 0;
}

.tingli-section-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

/* Audio Player Bar */
.audio-ctrl-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.btn-audio-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-audio-play:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-audio-play.playing {
  background: #15803d;
  animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(21, 128, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}

.audio-speed-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px 4px;
}

.speed-pill-btn {
  background: none;
  border: none;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.speed-pill-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.audio-repeat-tag {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-left: auto;
  font-weight: 600;
}

/* Exam Sidebar Filter Pills */
.exam-filter-pills-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-bottom: 0.75rem;
}

.exam-filter-pill {
  flex: 1;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.exam-filter-pill:hover {
  color: var(--primary);
}

.exam-filter-pill.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Part 1: Picture Choice Grid */
.picture-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .picture-options-grid {
    grid-template-columns: 1fr;
  }
}

.picture-option-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer !important;
  transition: all 0.22s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  user-select: none;
  min-height: 170px;
}

.picture-option-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.picture-option-card.selected {
  border-color: #dd6552 !important;
  background: #fdf2f0 !important;
  box-shadow: 0 0 0 3px rgba(221, 101, 82, 0.3) !important;
}

.picture-option-card.correct-answer {
  border-color: #15803d !important;
  background: #edf7ee !important;
}

.picture-option-card.wrong-answer {
  border-color: #dc2626 !important;
  background: #fdf2f0 !important;
}

.pic-badge-letter {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picture-option-card.selected .pic-badge-letter {
  background: #dd6552 !important;
  color: #ffffff !important;
  border-color: #dd6552 !important;
}

.tingli-svg-icon {
  width: 80px;
  height: 80px;
  transition: transform 0.2s ease;
}

.picture-option-card:hover .tingli-svg-icon {
  transform: scale(1.08);
}

.pic-label-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Part 2: Dialogue Choice Question */
.dialogue-box {
  background: var(--bg-main);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.dialogue-turn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0.65rem;
}

.dialogue-turn:last-child {
  margin-bottom: 0;
}

.speaker-tag {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.speaker-tag.female {
  background: #fdf2f8;
  color: #db2777;
}

.dialogue-text {
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-main);
}

.dialogue-py {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 2px;
}

.dialogue-vi {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.exam-options-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  .exam-options-list {
    grid-template-columns: 1fr;
  }
}

.exam-opt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.92rem;
  color: var(--text-main);
  cursor: pointer !important;
  text-align: left;
  transition: var(--transition);
}

.exam-opt-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.exam-opt-btn.selected {
  border-color: #dd6552 !important;
  background: #fdf2f0 !important;
  color: #dd6552 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 0 2px rgba(221, 101, 82, 0.25);
}

.exam-opt-btn.correct {
  border-color: #15803d !important;
  background: #edf7ee !important;
  color: #15803d !important;
  font-weight: 700;
}

.exam-opt-btn.wrong {
  border-color: #dc2626 !important;
  background: #fdf2f0 !important;
  color: #dc2626 !important;
}

.opt-letter-badge {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.exam-opt-btn.selected .opt-letter-badge {
  background: #dd6552 !important;
  color: #ffffff !important;
  border-color: #dd6552 !important;
}

/* Part 3: True / False Judgment Statements */
.passage-context-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.tf-statement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 10px;
  transition: var(--transition);
}

.tf-statement-row:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-focus);
}

.tf-statement-content {
  flex: 1;
}

.tf-statement-text {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.tf-statement-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tf-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tf-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-muted);
  cursor: pointer !important;
  transition: var(--transition);
}

.tf-btn:hover {
  border-color: var(--text-main);
}

.tf-btn.true-btn.selected {
  background: #15803d !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

.tf-btn.false-btn.selected {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
}

.tf-btn.reviewed-correct {
  outline: 3px solid #15803d;
}

.tf-btn.reviewed-wrong {
  outline: 3px solid #dc2626;
  opacity: 0.6;
}

/* Transcript & Explanation Box */
.question-expl-drawer {
  display: none;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 12px;
  animation: fadeIn 0.25s ease;
}

.question-expl-drawer.open {
  display: block;
}

.expl-header-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
}

.expl-transcript-box {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-subtle);
  font-size: 0.92rem;
  line-height: 1.6;
}

.expl-trap-box {
  font-size: 0.86rem;
  line-height: 1.55;
  background: var(--gold-light);
  color: #92400e;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
}

/* Clickable Hanzi Character Hover */
.hz-char {
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.hz-char:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  text-decoration: underline;
}

.hz-char.hz-selected {
  background-color: var(--primary) !important;
  color: #ffffff !important;
}

/* Workshop Hidden Transcript Card */
.workshop-listen-card {
  background: var(--bg-card);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.workshop-transcript-drawer {
  display: none;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.8;
  animation: fadeIn 0.3s ease;
}

.workshop-transcript-drawer.open {
  display: block;
}

/* Tab 1 Lesson Audio Player */
.lesson-mp3-player-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.lesson-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.lesson-player-info h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.lesson-player-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.lesson-audio-element {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-full);
  outline: none;
}

/* ==================== FULLSCREEN LESSON MODAL & TABS ==================== */
.lesson-modal-card.fullscreen-modal {
  width: 98vw !important;
  max-width: 98vw !important;
  height: 96vh !important;
  max-height: 96vh !important;
  border-radius: var(--radius-md) !important;
}

.lesson-modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 6px;
}

.lesson-modal-tab-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lesson-modal-tab-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.lesson-modal-tab-btn.active {
  color: #ffffff !important;
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.lesson-tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.lesson-tab-pane.active {
  display: block;
}

.theory-lecture-box {
  background: var(--bg-main);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-size: 0.96rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

.grammar-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.grammar-formula-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.75rem;
  border: 1px solid var(--primary-glow);
}

.sgk-exercise-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

/* ==================== PHẦN 1: HÌNH ẢNH DẠNG NGANG (HORIZONTAL IMAGE OPTIONS) ==================== */
.pic-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 14px 0 16px 0;
}

@media (max-width: 900px) {
  .pic-options-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .pic-options-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.pic-option-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 12px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  min-height: 145px;
  user-select: none;
}

.pic-option-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: rgba(221, 101, 82, 0.04);
}

.pic-option-card.selected {
  border-color: var(--primary) !important;
  background: rgba(221, 101, 82, 0.09) !important;
  box-shadow: 0 0 0 2px var(--primary) !important;
}

.pic-choice-label {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  background: var(--border-color);
  color: var(--text-main);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.pic-option-card:hover .pic-choice-label,
.pic-option-card.selected .pic-choice-label {
  background: var(--primary);
  color: #ffffff;
}

.pic-option-card .pic-icon-wrap,
.pic-option-card svg,
.pic-option-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  margin: 6px 0 10px 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

.pic-label-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-top: 4px;
}


/* ==========================================================================
   TẤT CẢ ĐÁP ÁN DẠNG DỌC (VERTICAL OPTIONS LIST) - TRỪ CHỌN ẢNH (NGANG)
   ========================================================================== */
.q-options-list,
.mcq-options-list,
.options-list,
.exam-part2-options {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin: 14px 0 16px 0 !important;
  width: 100% !important;
}

.q-option-btn,
.mcq-option-btn {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: left !important;
  padding: 12px 16px !important;
  background: var(--bg-card, #ffffff) !important;
  border: 1.5px solid var(--border-color, #e5dbcd) !important;
  border-radius: var(--radius-md, 10px) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
  position: relative !important;
}

.q-option-btn:hover,
.mcq-option-btn:hover {
  background: rgba(221, 101, 82, 0.06) !important;
  border-color: var(--primary, #dd6552) !important;
  transform: translateX(4px) !important;
}

.q-option-btn.selected,
.mcq-option-btn.selected {
  background: rgba(221, 101, 82, 0.1) !important;
  border-color: var(--primary, #dd6552) !important;
  box-shadow: 0 0 0 2px rgba(221, 101, 82, 0.25) !important;
}

.q-option-btn .opt-indicator,
.mcq-option-btn .opt-indicator,
.q-option-btn .opt-tag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: rgba(221, 101, 82, 0.12) !important;
  color: var(--primary, #dd6552) !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
  margin-right: 14px !important;
  flex-shrink: 0 !important;
  border: 1.5px solid rgba(221, 101, 82, 0.25) !important;
  transition: all 0.2s ease !important;
}

.q-option-btn:hover .opt-indicator,
.q-option-btn.selected .opt-indicator {
  background: var(--primary, #dd6552) !important;
  color: #ffffff !important;
  border-color: var(--primary, #dd6552) !important;
}

.q-option-btn .opt-text,
.mcq-option-btn .opt-text {
  font-family: var(--hanzi-font, 'Noto Serif SC', serif) !important;
  font-size: 1.05rem !important;
  color: var(--text-main, #33210f) !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  flex-grow: 1 !important;
}

.q-option-btn.selected-correct {
  background: #f0fdf4 !important;
  border-color: #10b981 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2) !important;
}
.q-option-btn.selected-correct .opt-indicator {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}

.q-option-btn.selected-wrong {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2) !important;
}
.q-option-btn.selected-wrong .opt-indicator {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

/* Phán đoán Đúng / Sai (True / False) */
.tf-btn-group,
.tf-options-list {
  display: flex !important;
  flex-direction: row !important;
  gap: 14px !important;
  margin: 12px 0 !important;
  width: 100% !important;
}
.tf-btn,
.tf-option-btn {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 12px 18px !important;
  border-radius: var(--radius-md, 10px) !important;
  background: var(--bg-card, #ffffff) !important;
  border: 2px solid var(--border-color, #e5dbcd) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
}
.tf-btn:hover,
.tf-option-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}
.tf-btn.true-btn:hover,
.tf-option-btn.tf-btn-true:hover {
  border-color: #10b981 !important;
  background: #f0fdf4 !important;
  color: #047857 !important;
}
.tf-btn.false-btn:hover,
.tf-option-btn.tf-btn-false:hover {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
}
.tf-btn.selected,
.tf-option-btn.selected {
  background: var(--primary, #dd6552) !important;
  color: #ffffff !important;
  border-color: var(--primary, #dd6552) !important;
}
.tf-btn.true-btn.selected,
.tf-option-btn.tf-btn-true.selected {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
}
.tf-btn.false-btn.selected,
.tf-option-btn.tf-btn-false.selected {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}


/* ==========================================================================
   VOCAB TRAINER (FLASHCARD 3D, MATCH WORDS, VOCAB QUIZ) STYLES
   ========================================================================== */
.vt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 5, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5rem;
}

.vt-modal-overlay.active {
  display: flex !important;
  animation: fadeIn 0.2s ease;
}

.vt-modal-card {
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border-color, #e5dbcd);
  border-radius: var(--radius-lg, 16px);
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0,0,0,0.35);
  animation: modalFadeIn 0.25s ease-out;
}

.vt-modal-header {
  padding: 16px 24px;
  background: var(--bg-elevated, #faf5ee);
  border-bottom: 1.5px solid var(--border-color, #e5dbcd);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vt-subnav-bar {
  padding: 12px 24px;
  background: var(--bg-main, #fbf7f1);
  border-bottom: 1px solid var(--border-color, #e5dbcd);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.vt-scope-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm, 6px);
  border: 1.5px solid var(--border-color, #e5dbcd);
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #33210f);
  font-weight: 700;
  font-size: 0.9rem;
}

.vt-mode-tabs {
  display: flex;
  gap: 8px;
}

.vt-mode-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--border-color, #e5dbcd);
  background: var(--bg-card, #ffffff);
  color: var(--text-muted, #7a583a);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vt-mode-btn:hover {
  border-color: var(--primary, #dd6552);
  color: var(--text-main, #33210f);
}

.vt-mode-btn.active {
  background: var(--primary, #dd6552);
  color: #ffffff;
  border-color: var(--primary, #dd6552);
  box-shadow: 0 2px 8px rgba(221,101,82,0.3);
}

.vt-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.vt-tab-pane {
  display: none;
}
.vt-tab-pane.active {
  display: block;
}

/* 3D Flashcard */
.vt-card-3d-wrapper {
  perspective: 1000px;
  width: 100%;
  max-width: 580px;
  height: 320px;
  margin: 0 auto 20px auto;
  cursor: pointer;
}

.vt-card-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.vt-card-3d.flipped {
  transform: rotateY(180deg);
}

.vt-card-front,
.vt-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg, 16px);
  border: 2px solid var(--border-color, #e5dbcd);
  padding: 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.vt-card-front {
  background: linear-gradient(135deg, #ffffff, #faf6f0);
}

.vt-card-back {
  background: linear-gradient(135deg, #faf5ee, #f5ebd9);
  transform: rotateY(180deg);
}

.vt-card-hanzi {
  font-family: var(--hanzi-font, 'Noto Serif SC', serif);
  font-size: 3.8rem;
  font-weight: 800;
  color: var(--primary, #dd6552);
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.vt-card-pinyin {
  font-size: 1.4rem;
  color: var(--accent, #b5733a);
  font-style: italic;
  font-weight: 600;
}

.vt-card-meaning {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main, #33210f);
  margin: 10px 0;
  line-height: 1.4;
}

.vt-card-example {
  background: rgba(255,255,255,0.7);
  border: 1px dashed var(--border-color, #e5dbcd);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--text-main, #33210f);
  text-align: left;
  width: 100%;
}

.vt-card-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.vt-btn-action {
  padding: 10px 20px;
  border-radius: var(--radius-md, 10px);
  border: 1.5px solid var(--border-color, #e5dbcd);
  background: var(--bg-card, #ffffff);
  color: var(--text-main, #33210f);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vt-btn-action:hover {
  background: rgba(221,101,82,0.08);
  border-color: var(--primary, #dd6552);
  transform: translateY(-2px);
}

.vt-btn-action.mastered {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.vt-progress-bar-wrapper {
  width: 100%;
  max-width: 580px;
  height: 6px;
  background: var(--border-color, #e5dbcd);
  border-radius: 9999px;
  margin: 0 auto;
  overflow: hidden;
}

.vt-progress-bar {
  height: 100%;
  background: var(--primary, #dd6552);
  transition: width 0.3s ease;
}

/* Match Grid */
.vt-match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .vt-match-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.vt-match-card {
  background: var(--bg-card, #ffffff);
  border: 2px solid var(--border-color, #e5dbcd);
  border-radius: var(--radius-md, 10px);
  padding: 16px 12px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.vt-match-card:hover {
  border-color: var(--primary, #dd6552);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.vt-match-card.selected {
  border-color: var(--primary, #dd6552);
  background: rgba(221,101,82,0.12);
  box-shadow: 0 0 0 3px rgba(221,101,82,0.3);
}

.vt-match-card.matched {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, visibility 0.3s;
}

.vt-match-card-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main, #33210f);
}

.vt-match-card-text.hanzi {
  font-family: var(--hanzi-font, 'Noto Serif SC', serif);
  font-size: 1.5rem;
  color: var(--primary, #dd6552);
}

.vt-match-card-sub {
  font-size: 0.8rem;
  color: var(--accent, #b5733a);
  margin-top: 4px;
}

/* Vocab Quiz */
.vt-quiz-stem {
  background: var(--bg-elevated, #faf5ee);
  border: 1.5px solid var(--border-color, #e5dbcd);
  border-radius: var(--radius-md, 10px);
  padding: 24px;
  text-align: center;
}

.vt-quiz-hanzi {
  font-family: var(--hanzi-font, 'Noto Serif SC', serif);
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--primary, #dd6552);
  margin-bottom: 4px;
}

.vt-quiz-pinyin {
  font-size: 1.25rem;
  color: var(--accent, #b5733a);
  font-style: italic;
  font-weight: 600;
}
