/* CSS specific to the TOPIK IBT Exam Simulation Page */

/* Base Layout Config */
.quiz-page-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  font-family: "Be Vietnam Pro", sans-serif;
}

/* Custom Korean Font Family styling */
:root {
  --korean-font: "NanumSquare", "Noto Sans KR", sans-serif;
  --vietnamese-font: "Be Vietnam Pro", sans-serif;
}

/* For all Korean content elements */
.quiz-instruction-ko,
.dialogue-text,
.dialogue-line,
.option-content,
.option-text,
.essay-textarea,
.gap-fill-input,
.graphic-title,
.graphic-content,
.transcript-ko,
.question-prompt-ko,
.essay-prompt-ko,
.tab-ko {
  font-family: var(--korean-font) !important;
}

/* TOPIK Exam Header */
.topik-exam-header {
  background-color: #023059; /* TOPIK Brand Navy */
  color: #ffffff;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(2, 48, 89, 0.15);
}

.topik-logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topik-logo-svg {
  width: 32px;
  height: 32px;
  animation: rotateEmblem 20s linear infinite;
}

@keyframes rotateEmblem {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.topik-logo-text {
  display: flex;
  flex-direction: column;
}

.topik-logo-main {
  font-family: var(--korean-font);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.topik-logo-sub {
  font-family: var(--korean-font);
  font-size: 0.7rem;
  color: #93c5fd;
  letter-spacing: 1px;
}

.topik-exam-title {
  font-family: var(--korean-font);
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.2px;
}

.topik-timer-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topik-timer-box {
  background-color: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  padding: 6px 16px;
  border-radius: 20px;
  font-family: monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s;
}

.topik-timer-box.warning {
  background-color: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
  animation: pulseTimer 1s infinite alternate;
}

@keyframes pulseTimer {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* Part Tabs Bar */
.topik-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
  border-bottom: 3px solid #e2e8f0;
  padding-bottom: 12px;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--vietnamese-font);
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

.tab-btn:hover {
  border-color: #023059;
  background-color: #f0f4f8;
  transform: translateY(-2px);
}

.tab-btn.active {
  background-color: #023059;
  border-color: #023059;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(2, 48, 89, 0.2);
}

.tab-btn.active .tab-vi {
  color: #93c5fd;
}

.tab-ko {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tab-vi {
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  transition: color 0.3s;
}

/* 2-Column Grid Layout */
.quiz-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: start;
}

/* Sidebar Navigation */
.quiz-sidebar {
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.sidebar-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #023059;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Navigation Grid */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.nav-grid::-webkit-scrollbar {
  width: 4px;
}
.nav-grid::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.nav-btn {
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  color: #475569;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.nav-btn:hover {
  border-color: #023059;
  color: #023059;
  background-color: #f8fafc;
}

.nav-btn.active {
  border-color: #023059;
  color: #023059;
  background-color: #eef6fc;
  box-shadow: 0 0 0 3px rgba(2, 48, 89, 0.15);
}

.nav-btn.answered {
  background-color: #023059;
  border-color: #023059;
  color: #ffffff;
}

.nav-btn.answered.active {
  box-shadow: 0 0 0 3px rgba(2, 48, 89, 0.3);
}

/* Feedback states in sidebar grid */
.nav-btn.correct {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}

.nav-btn.incorrect {
  background-color: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}

/* Sidebar Legend */
.sidebar-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.82rem;
  color: #64748b;
  border-top: 1.5px solid #f1f5f9;
  padding-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
}

.legend-dot.answered {
  background-color: #023059;
  border-color: #023059;
}

.legend-dot.correct {
  background-color: #10b981;
  border-color: #10b981;
}

.legend-dot.incorrect {
  background-color: #ef4444;
  border-color: #ef4444;
}

/* Main Panel for active question */
.quiz-main-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Quiz Card */
.quiz-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 35px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Instruction Section */
.quiz-instruction-box {
  border-left: 5px solid #023059; /* TOPIK Accent Color */
  background-color: #f0f6fc;
  padding: 15px 25px;
  border-radius: 0 12px 12px 0;
  margin-bottom: 25px;
}

.quiz-instruction-ko {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 6px;
}

.quiz-instruction-vi {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
}

/* Dialogue Box (Conversation) */
.dialogue-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #475569;
  border-radius: 8px 16px 16px 8px;
  padding: 24px 30px;
  margin-bottom: 25px;
  font-size: 1.15rem;
  color: #334155;
  line-height: 1.8;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.dialogue-line {
  display: flex;
  margin-bottom: 10px;
}

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

.speaker {
  font-weight: 700;
  color: #1e293b;
  width: 30px;
  flex-shrink: 0;
}

.dialogue-text {
  flex-grow: 1;
}

/* Underline Highlight in Dialogue */
.highlight-underline {
  border-bottom: 3px solid #ee6759; /* Red highlight */
  padding-bottom: 2px;
  font-weight: 700;
  color: #1e293b;
  display: inline-block;
  cursor: help;
  position: relative;
}

.highlight-underline:hover::after {
  content: "Từ được gạch chân cần tìm từ đồng nghĩa/trái nghĩa";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #334155;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 8px;
  z-index: 10;
  font-family: var(--vietnamese-font);
  font-weight: 400;
}

/* Passage Box for reading questions */
.passage-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 30px;
  margin-bottom: 25px;
  font-family: var(--korean-font);
  font-size: 1.15rem;
  color: #1e293b;
  line-height: 1.9;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.01);
}

/* Custom Notice Board/Flyer Graphics */
.flyer-card {
  margin: 15px 0 25px 0;
  border-radius: 14px;
  padding: 24px 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  position: relative;
}

.flyer-card::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 12px;
  border-radius: 4px;
  opacity: 0.8;
}

.flyer-card.flyer-roommate {
  background-color: #fffbeb;
  border: 2px solid #fde68a;
  border-top: 5px solid #f59e0b;
}

.flyer-card.flyer-roommate::before {
  background-color: #f59e0b;
}

.flyer-card.flyer-pool {
  background-color: #f0fdfa;
  border: 2px solid #99f6e4;
  border-top: 5px solid #0d9488;
}

.flyer-card.flyer-pool::before {
  background-color: #0d9488;
}

.graphic-title {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 15px;
  color: #1e293b;
  letter-spacing: 0.5px;
}

.flyer-card.flyer-roommate .graphic-title { color: #b45309; }
.flyer-card.flyer-pool .graphic-title { color: #0f766e; }

.graphic-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #334155;
  font-weight: 500;
}

/* Audio Player Simulator */
.audio-simulator-box {
  background-color: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.audio-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.audio-play-btn {
  background-color: #0062ff;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-family: var(--vietnamese-font);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 98, 255, 0.2);
}

.audio-play-btn:hover {
  background-color: #0052d4;
  transform: translateY(-1px);
}

.audio-play-btn:active {
  transform: translateY(1px);
}

.audio-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  padding-right: 10px;
}

.audio-wave span {
  display: block;
  width: 3px;
  background-color: #023059;
  border-radius: 2px;
  height: 4px;
  transition: height 0.2s ease;
}

.audio-wave.playing span {
  animation: jumpWave 1.2s infinite ease-in-out;
}

.audio-wave.playing span:nth-child(1) { height: 18px; animation-delay: 0.1s; }
.audio-wave.playing span:nth-child(2) { height: 24px; animation-delay: 0.3s; }
.audio-wave.playing span:nth-child(3) { height: 14px; animation-delay: 0.5s; }
.audio-wave.playing span:nth-child(4) { height: 20px; animation-delay: 0.2s; }
.audio-wave.playing span:nth-child(5) { height: 10px; animation-delay: 0.4s; }

@keyframes jumpWave {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

.toggle-transcript-btn {
  background: none;
  border: 1.5px dashed #64748b;
  color: #475569;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.2s ease;
}

.toggle-transcript-btn:hover, .toggle-transcript-btn.active {
  background-color: #cbd5e1;
  border-color: #475569;
  color: #0f172a;
}

.listening-transcript {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.transcript-ko {
  font-size: 1.05rem;
  color: #1e293b;
  font-weight: 700;
  margin-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.transcript-vi {
  color: #475569;
  font-style: italic;
}

/* Prompt Elements */
.question-prompt-box, .essay-prompt-box {
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.question-prompt-ko, .essay-prompt-ko {
  font-weight: 700;
  color: #023059;
  margin-bottom: 6px;
  line-height: 1.6;
}

.question-prompt-vi, .essay-prompt-vi {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}

.grammar-helper-box {
  background-color: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 10px 15px;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: #1e40af;
  margin-bottom: 20px;
}

/* Text Input (Gap-fill) Styling */
.text-input-container {
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 25px;
  margin-top: 20px;
}

.text-input-label {
  font-weight: 700;
  color: #023059;
  font-size: 1rem;
  margin-bottom: 12px;
}

.gap-fill-input {
  width: 100%;
  padding: 12px 18px;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  transition: all 0.3s;
  box-sizing: border-box;
  background-color: #ffffff;
}

.gap-fill-input:focus {
  outline: none;
  border-color: #0062ff;
  box-shadow: 0 0 0 3px rgba(0, 98, 255, 0.15);
}

.gap-fill-input:disabled {
  background-color: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
  border-color: #cbd5e1;
}

.correct-answers-list-box {
  margin-top: 15px;
  background-color: #ecfdf5;
  border-left: 4px solid #10b981;
  padding: 10px 15px;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  color: #065f46;
}

.correct-answers-list-box strong {
  color: #047857;
}

/* Essay Input Styling */
.essay-input-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.essay-textarea {
  width: 100%;
  height: 180px;
  padding: 16px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.6;
  color: #0f172a;
  resize: vertical;
  transition: all 0.3s;
  box-sizing: border-box;
  background-color: #ffffff;
}

.essay-textarea:focus {
  outline: none;
  border-color: #0062ff;
  box-shadow: 0 0 0 3px rgba(0, 98, 255, 0.15);
}

.essay-textarea:disabled {
  background-color: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
}

.essay-counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #475569;
  padding: 0 5px;
}

.char-count-text strong {
  font-size: 1.05rem;
}

#charCount.under-limit { color: #f59e0b; }
#charCount.in-range { color: #10b981; font-weight: 700; }
#charCount.over-limit { color: #ef4444; }

.char-count-status {
  font-weight: 600;
}

.char-count-status.under-limit { color: #d97706; }
.char-count-status.in-range { color: #059669; }
.char-count-status.over-limit { color: #dc2626; }

.essay-model-answer {
  background-color: #eff6ff;
  border-left: 4px solid #0062ff;
  padding: 15px 20px;
  border-radius: 0 10px 10px 0;
  font-size: 1rem;
  line-height: 1.7;
  color: #1e3a8a;
}

.question-title-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #023059;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.question-title-text::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background-color: #023059;
  border-radius: 2px;
}

/* Options Grid Layout */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 20px;
}

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

/* Option Cards */
.option-card {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 24px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-size: 1.05rem;
  font-weight: 500;
  color: #334155;
}

.option-number {
  color: #64748b;
  font-size: 1.35rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}

.option-text {
  line-height: 1.2;
}

/* Hover State */
.option-card:hover {
  border-color: #023059;
  background-color: #f0f6fc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 48, 89, 0.08);
}

.option-card:hover .option-number {
  border-color: #023059;
  color: #023059;
}

/* Selected State */
.option-card.selected {
  border-color: #0062ff; /* TOPIK Accent Blue */
  background-color: #eff6ff;
  box-shadow: 0 4px 12px rgba(0, 98, 255, 0.1);
  transform: translateY(-2px);
}

.option-card.selected .option-number {
  color: #0062ff;
}

.option-card.selected .option-text {
  color: #0062ff;
  font-weight: 700;
}

/* Feedback States (Correct / Incorrect after submit) */
.option-card.correct-answer {
  border-color: #10b981 !important;
  background-color: #ecfdf5 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1) !important;
}

.option-card.correct-answer .option-number {
  color: #10b981 !important;
}

.option-card.correct-answer .option-text {
  color: #065f46 !important;
  font-weight: 700 !important;
}

.option-card.incorrect-answer {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

.option-card.incorrect-answer .option-number {
  color: #ef4444 !important;
}

.option-card.incorrect-answer .option-text {
  color: #991b1b !important;
  font-weight: 700 !important;
}

.option-card.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* Verification indicators */
.feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 15px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.feedback-badge.show {
  opacity: 1;
  transform: translateY(0);
}

.feedback-badge.correct {
  background-color: #d1fae5;
  color: #065f46;
}

.feedback-badge.incorrect {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Explanations Card */
.explanation-card {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin 0.3s;
  background-color: #f8fafc;
  border-left: 4px solid #0062ff;
  border-radius: 0 12px 12px 0;
}

.explanation-card.show {
  max-height: 2000px; /* high enough for essay response */
  margin-top: 25px;
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.explanation-content {
  padding: 20px 24px;
}

.explanation-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 12px;
}

.explanation-translation {
  font-style: italic;
  font-size: 0.95rem;
  color: #475569;
  border-left: 2px solid #cbd5e1;
  padding-left: 12px;
  margin-bottom: 15px;
  line-height: 1.5;
}

.explanation-detail {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.6;
}

.explanation-detail ul {
  padding-left: 20px;
  margin-top: 8px;
}

.explanation-detail li {
  margin-bottom: 4px;
}

.explanation-detail strong {
  color: #ee6759;
}

/* Interactive Control Buttons */
.quiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px 30px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.nav-buttons-left {
  display: flex;
  gap: 15px;
}

.action-buttons-right {
  display: flex;
  gap: 15px;
}

.quiz-btn {
  font-family: var(--vietnamese-font);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quiz-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.quiz-btn-prev {
  background-color: #f1f5f9;
  color: #475569;
  border: 1.5px solid #cbd5e1;
}

.quiz-btn-prev:hover:not(:disabled) {
  background-color: #e2e8f0;
}

.quiz-btn-next {
  background-color: #023059;
  color: #ffffff;
}

.quiz-btn-next:hover:not(:disabled) {
  background-color: #0b457b;
}

.quiz-btn-submit-q {
  background-color: #0062ff;
  color: #ffffff;
}

.quiz-btn-submit-q:hover:not(:disabled) {
  background-color: #004ecc;
  box-shadow: 0 4px 12px rgba(0, 98, 255, 0.2);
}

.quiz-btn-finish {
  background-color: #ee6759; /* Red-orange submit */
  color: #ffffff;
}

.quiz-btn-finish:hover:not(:disabled) {
  background-color: #d65143;
  box-shadow: 0 4px 12px rgba(238, 103, 89, 0.3);
}

.quiz-btn-reset {
  background-color: #f1f5f9;
  color: #475569;
  border: 1.5px solid #cbd5e1;
}

.quiz-btn-reset:hover {
  background-color: #e2e8f0;
}

.hidden {
  display: none !important;
}

/* Scoring Screen */
.score-panel {
  text-align: center;
  background: #f0fdf4;
  border: 2px solid #10b981;
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 25px;
  animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.score-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 10px;
}

.score-value {
  font-size: 3.5rem;
  font-weight: 900;
  color: #10b981;
  margin-bottom: 8px;
}

.score-message {
  font-size: 1rem;
  color: #374151;
  line-height: 1.6;
}

.score-breakdown {
  display: flex;
  justify-content: space-around;
  gap: 15px;
  margin: 24px 0 10px 0;
  flex-wrap: wrap;
}

.breakdown-card {
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 20px;
  flex: 1;
  min-width: 140px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.breakdown-title {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 6px;
}

.breakdown-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
}

.score-time {
  font-size: 0.95rem;
  color: #475569;
  margin-top: 10px;
  font-weight: 500;
}

@keyframes scaleUp {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Responsive configurations */
@media (max-width: 900px) {
  .quiz-grid {
    grid-template-columns: 1fr;
  }
  .quiz-sidebar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .quiz-page-container {
    margin: 15px auto;
  }

  .topik-exam-header {
    flex-direction: column;
    gap: 15px;
    padding: 15px 20px;
    text-align: center;
  }

  .topik-logo-area {
    justify-content: center;
  }

  .quiz-card {
    padding: 25px 20px;
  }

  .quiz-instruction-box {
    padding: 12px 18px;
  }

  .quiz-instruction-ko {
    font-size: 1.1rem;
  }

  .dialogue-box {
    padding: 16px 20px;
    font-size: 1.05rem;
  }

  .quiz-actions {
    flex-direction: column-reverse;
    gap: 15px;
    padding: 15px 20px;
  }

  .nav-buttons-left, .action-buttons-right {
    width: 100%;
    gap: 10px;
  }

  .quiz-btn {
    flex: 1;
    justify-content: center;
  }
}
