/* ========================================
   VIOEDU PRACTICE - STYLES
   Giao diện luyện thi Vioedu cho trẻ em
   ======================================== */

/* ---- Google Font ---- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary: #2ecc71;
  --primary-dark: #27ae60;
  --primary-light: #a8f0c6;
  --secondary: #3498db;
  --secondary-dark: #2980b9;
  --accent: #f39c12;
  --accent-dark: #e67e22;
  --danger: #e74c3c;
  --danger-light: #fdeaea;
  --success: #2ecc71;
  --success-light: #eafaf1;
  --bg-dark: #1a1a2e;
  --bg-card: #16213e;
  --bg-surface: #0f3460;
  --text-light: #ffffff;
  --text-muted: #b0b8c8;
  --text-dark: #2c3e50;
  --gradient-green: linear-gradient(135deg, #11998e, #38ef7d);
  --gradient-blue: linear-gradient(135deg, #667eea, #764ba2);
  --gradient-orange: linear-gradient(135deg, #f093fb, #f5576c);
  --gradient-gold: linear-gradient(135deg, #f7971e, #ffd200);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.1);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Animated Background ---- */
.bg-animated {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  overflow: hidden;
}

.bg-animated::before,
.bg-animated::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: float 20s infinite ease-in-out;
}

.bg-animated::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(46, 204, 113, 0.15), transparent);
  top: -100px;
  right: -100px;
}

.bg-animated::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(52, 152, 219, 0.15), transparent);
  bottom: -50px;
  left: -50px;
  animation-delay: -7s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -50px) scale(1.1);
  }

  50% {
    transform: translate(-20px, 30px) scale(0.95);
  }

  75% {
    transform: translate(40px, 20px) scale(1.05);
  }
}

/* ---- Floating Stars / Particles ---- */
.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  animation: particle-float linear infinite;
  z-index: -1;
}

@keyframes particle-float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-10vh) rotate(720deg);
    opacity: 0;
  }
}

/* ---- Container ---- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* ---- Screen Management ---- */
.screen {
  display: none;
  animation: fadeSlideIn 0.5s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== HOME SCREEN ========== */
.home-header {
  text-align: center;
  padding: 40px 0 30px;
}

.logo {
  margin-bottom: 15px;
}

.logo-icon {
  font-size: 60px;
  display: block;
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.logo-text {
  font-size: 2.4rem;
  font-weight: 900;
  background: var(--gradient-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px;
}

.logo-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 5px;
}

.grade-badge {
  display: inline-block;
  background: var(--gradient-gold);
  color: #333;
  padding: 6px 20px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 0.9rem;
  margin-top: 10px;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(247, 151, 30, 0.5);
  }

  50% {
    box-shadow: 0 0 0 15px rgba(247, 151, 30, 0);
  }
}

/* Subject Cards */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.subject-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 30px 25px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.subject-card.english::before {
  background: var(--gradient-green);
}

.subject-card.vietnamese::before {
  background: var(--gradient-orange);
}

.subject-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.2);
}

.subject-card:active {
  transform: translateY(-4px) scale(0.98);
}

.subject-icon {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 15px;
}

.subject-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.subject-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.subject-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.subject-stats span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ========== TOPIC SCREEN ========== */
.screen-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}

.btn-back {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.screen-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.topic-list {
  display: grid;
  gap: 12px;
}

.topic-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
}

.topic-card:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(8px);
  border-color: rgba(255, 255, 255, 0.2);
}

.topic-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
}

.topic-info {
  flex: 1;
}

.topic-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.topic-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topic-badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.topic-badge.new {
  background: rgba(46, 204, 113, 0.2);
  color: var(--success);
}

.topic-badge.practiced {
  background: rgba(52, 152, 219, 0.2);
  color: var(--secondary);
}

.topic-questions-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.topic-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.topic-card:hover .topic-arrow {
  transform: translateX(5px);
}

/* History badge */
.topic-history {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.history-dot.good {
  background: var(--success);
}

.history-dot.average {
  background: var(--accent);
}

.history-dot.poor {
  background: var(--danger);
}

/* ========== QUIZ SCREEN ========== */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-text {
  font-weight: 700;
  font-size: 0.95rem;
}

.progress-bar-container {
  width: 120px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-green);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.quiz-score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--accent);
}

.quiz-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.3rem;
}

.timer-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-circle svg {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.timer-circle circle {
  fill: none;
  stroke-width: 4;
}

.timer-circle .timer-bg {
  stroke: rgba(255, 255, 255, 0.1);
}

.timer-circle .timer-progress {
  stroke: var(--success);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-circle .timer-progress.warning {
  stroke: var(--accent);
}

.timer-circle .timer-progress.danger {
  stroke: var(--danger);
}

.timer-text {
  font-size: 1rem;
  font-weight: 800;
  z-index: 1;
}

/* Question Card */
.question-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 20px;
  animation: fadeSlideIn 0.4s ease;
}

.question-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.question-type-badge.mc {
  background: rgba(52, 152, 219, 0.2);
  color: var(--secondary);
}

.question-type-badge.tf {
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
}

.question-type-badge.fb {
  background: rgba(243, 156, 18, 0.2);
  color: var(--accent);
}

.question-text {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 25px;
}

/* Multiple Choice Options */
.options-grid {
  display: grid;
  gap: 12px;
}

.option-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--text-light);
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.option-btn:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(5px);
}

.option-label {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all 0.3s;
}

.option-btn.correct {
  background: rgba(46, 204, 113, 0.15);
  border-color: var(--success);
  animation: correctPulse 0.5s ease;
}

.option-btn.correct .option-label {
  background: var(--success);
  color: #fff;
}

.option-btn.wrong {
  background: rgba(231, 76, 60, 0.15);
  border-color: var(--danger);
  animation: shake 0.5s ease;
}

.option-btn.wrong .option-label {
  background: var(--danger);
  color: #fff;
}

.option-btn.disabled {
  cursor: default;
  opacity: 0.5;
}

.option-btn.disabled:hover {
  transform: none;
}

@keyframes correctPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.03);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-5px);
  }

  80% {
    transform: translateX(5px);
  }
}

/* True/False Options */
.tf-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.tf-btn {
  padding: 20px;
  text-align: center;
  font-size: 1.2rem;
}

/* Fill in the Blank */
.fill-blank-container {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.fill-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text-light);
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
  transition: all 0.3s;
}

.fill-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.2);
}

.fill-input.correct {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.1);
}

.fill-input.wrong {
  border-color: var(--danger);
  background: rgba(231, 76, 60, 0.1);
}

.btn-submit-answer {
  background: var(--gradient-green);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-submit-answer:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
}

.btn-submit-answer:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* Hint */
.hint-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 10px;
  font-style: italic;
}

.hint-text::before {
  content: '💡 ';
}

/* Explanation */
.explanation-box {
  margin-top: 20px;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.6;
  animation: fadeSlideIn 0.3s ease;
}

.explanation-box.correct {
  background: rgba(46, 204, 113, 0.12);
  border-left: 4px solid var(--success);
  color: #a8f0c6;
}

.explanation-box.wrong {
  background: rgba(231, 76, 60, 0.12);
  border-left: 4px solid var(--danger);
  color: #f5a8a0;
}

.explanation-box .correct-answer {
  font-weight: 700;
  display: block;
  margin-bottom: 5px;
}

/* Next Button */
.btn-next {
  display: block;
  width: 100%;
  background: var(--gradient-green);
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 15px;
}

.btn-next:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(46, 204, 113, 0.3);
}

/* ========== RESULTS SCREEN ========== */
.results-container {
  text-align: center;
  padding: 30px 0;
}

.results-trophy {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

.results-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.results-title.excellent {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-title.good {
  background: var(--gradient-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-title.average {
  color: var(--accent);
}

.results-title.poor {
  color: var(--danger);
}

.results-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 30px;
}

.results-score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: 0 auto 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.results-score-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 5px;
  background: var(--gradient-green);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
}

.score-number {
  font-size: 3rem;
  font-weight: 900;
}

.score-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 15px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.stat-item.correct-stat .stat-value {
  color: var(--success);
}

.stat-item.wrong-stat .stat-value {
  color: var(--danger);
}

.stat-item.time-stat .stat-value {
  color: var(--secondary);
}

/* Stars animation */
.results-stars {
  font-size: 2.5rem;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  gap: 5px;
}

.results-stars span {
  display: inline-block;
  animation: starPop 0.4s ease backwards;
}

.results-stars span:nth-child(1) {
  animation-delay: 0.2s;
}

.results-stars span:nth-child(2) {
  animation-delay: 0.4s;
}

.results-stars span:nth-child(3) {
  animation-delay: 0.6s;
}

.results-stars span:nth-child(4) {
  animation-delay: 0.8s;
}

.results-stars span:nth-child(5) {
  animation-delay: 1.0s;
}

@keyframes starPop {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Answer Review */
.review-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 20px;
}

.review-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.review-list {
  display: none;
  text-align: left;
  margin-top: 15px;
}

.review-list.show {
  display: block;
}

.review-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 10px;
  border-left: 4px solid;
}

.review-item.correct {
  border-left-color: var(--success);
}

.review-item.wrong {
  border-left-color: var(--danger);
}

.review-question {
  font-weight: 700;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.review-answer {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.review-answer .your-answer {
  color: var(--danger);
}

.review-answer .right-answer {
  color: var(--success);
}

/* Action Buttons */
.results-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 25px;
}

.btn-action {
  border: none;
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-action:hover {
  transform: translateY(-3px);
}

.btn-retry {
  background: var(--gradient-green);
  color: #fff;
}

.btn-retry:hover {
  box-shadow: 0 10px 30px rgba(46, 204, 113, 0.3);
}

.btn-home {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-home:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ========== CONFETTI ========== */
.confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ========== EXAM CTA (Home Page) ========== */
.exam-cta {
  margin-top: 30px;
}

.exam-cta-inner {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.exam-cta-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-gold);
}

.exam-cta-badge {
  display: inline-block;
  background: var(--gradient-gold);
  color: #333;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.exam-cta-title {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.exam-cta-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.exam-cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.exam-cta-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  color: #fff;
}

.exam-cta-btn.english {
  background: var(--gradient-green);
}

.exam-cta-btn.vietnamese {
  background: var(--gradient-orange);
}

.exam-cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ========== EXAM SETUP ========== */
.exam-setup-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 20px;
}

.exam-setup-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
  text-align: center;
}

.exam-setup-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.exam-info-item {
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 15px;
  text-align: center;
}

.exam-info-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.exam-info-value {
  font-size: 1.3rem;
  font-weight: 800;
}

.exam-info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.exam-rules {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  margin-bottom: 25px;
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.exam-rules-title {
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
}

.exam-start-btn {
  display: block;
  width: 100%;
  background: var(--gradient-gold);
  border: none;
  border-radius: var(--radius-md);
  padding: 18px;
  color: #333;
  font-family: 'Nunito', sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 1px;
}

.exam-start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(247, 151, 30, 0.4);
}

/* ========== EXAM SCREEN ========== */
.exam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0;
}

.exam-timer-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-timer-icon {
  font-size: 1.3rem;
}

.exam-timer-text {
  font-size: 1.5rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--success);
  transition: color 0.3s;
}

.exam-timer-text.warning {
  color: var(--accent);
}

.exam-timer-text.danger {
  color: var(--danger);
  animation: pulse-text 1s infinite;
}

@keyframes pulse-text {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.exam-progress-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: 700;
  font-size: 0.9rem;
}

.exam-answered-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.exam-submit-btn {
  background: var(--gradient-gold);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  color: #333;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s;
}

.exam-submit-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(247, 151, 30, 0.4);
}

/* Timer Bar */
.exam-timer-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0 0 4px 4px;
  overflow: hidden;
  margin-bottom: 15px;
}

.exam-timer-bar-fill {
  height: 100%;
  background: var(--gradient-green);
  transition: width 1s linear, background 0.3s;
  width: 100%;
}

.exam-timer-bar-fill.warning {
  background: var(--gradient-gold);
}

.exam-timer-bar-fill.danger {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* Exam Body Layout */
.exam-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 15px;
  align-items: start;
}

/* Exam Question Area */
.exam-question-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 25px;
  animation: fadeSlideIn 0.3s ease;
}

.exam-question-card .question-topic {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.exam-question-card .question-text {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

/* Selected state for exam options (no correct/wrong feedback) */
.option-btn.selected {
  background: rgba(52, 152, 219, 0.2);
  border-color: var(--secondary);
}

.option-btn.selected .option-label {
  background: var(--secondary);
  color: #fff;
}

/* Navigation Buttons */
.exam-nav-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.exam-nav-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-light);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.exam-nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.exam-nav-btn.primary {
  background: var(--gradient-green);
  border: none;
  color: #fff;
}

.exam-nav-btn.primary:hover {
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.exam-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.exam-flag-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-light);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
}

.exam-flag-btn:hover {
  background: rgba(243, 156, 18, 0.2);
  border-color: var(--accent);
}

.exam-flag-btn.active {
  background: rgba(243, 156, 18, 0.25);
  border-color: var(--accent);
  color: var(--accent);
}

/* Sidebar */
.exam-sidebar {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 15px;
  position: sticky;
  top: 20px;
}

.exam-map-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.exam-question-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.exam-map-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exam-map-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.exam-map-btn.current {
  border-color: var(--accent);
  background: rgba(243, 156, 18, 0.2);
  box-shadow: 0 0 8px rgba(243, 156, 18, 0.3);
}

.exam-map-btn.answered {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.2);
}

.exam-map-btn.flagged {
  border-color: var(--accent);
  background: rgba(243, 156, 18, 0.15);
  position: relative;
}

.exam-map-btn.flagged::after {
  content: '🚩';
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.5rem;
}

/* Legend */
.exam-map-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 2px solid;
  flex-shrink: 0;
}

.legend-dot.unanswered {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.legend-dot.answered {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.2);
}

.legend-dot.current {
  border-color: var(--accent);
  background: rgba(243, 156, 18, 0.2);
}

.legend-dot.flagged {
  border-color: var(--accent);
  background: rgba(243, 156, 18, 0.15);
}

.exam-submit-btn-sidebar {
  display: block;
  width: 100%;
  background: var(--gradient-gold);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  color: #333;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s;
}

.exam-submit-btn-sidebar:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(247, 151, 30, 0.4);
}

/* ========== EXAM CONFIRM DIALOG ========== */
.exam-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.exam-confirm-dialog {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.exam-confirm-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.exam-confirm-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 15px;
}

.exam-confirm-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.exam-confirm-info .warning-text {
  color: var(--accent);
  font-weight: 700;
}

.exam-confirm-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.exam-confirm-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.exam-confirm-btn.cancel {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.exam-confirm-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.2);
}

.exam-confirm-btn.submit {
  background: var(--gradient-green);
  color: #fff;
}

.exam-confirm-btn.submit:hover {
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .logo-text {
    font-size: 1.8rem;
  }

  .subject-grid {
    grid-template-columns: 1fr;
  }

  .question-text {
    font-size: 1.1rem;
  }

  .quiz-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .results-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .results-actions {
    grid-template-columns: 1fr;
  }

  .tf-options {
    grid-template-columns: 1fr;
  }

  .fill-blank-container {
    flex-direction: column;
  }

  .exam-body {
    grid-template-columns: 1fr;
  }

  .exam-sidebar {
    order: -1;
    position: static;
  }

  .exam-question-map {
    grid-template-columns: repeat(10, 1fr);
  }

  .exam-setup-info {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .exam-confirm-buttons {
    grid-template-columns: 1fr;
  }

  .exam-cta-buttons {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 1.5rem;
  }

  .question-card {
    padding: 20px;
  }

  .results-score-circle {
    width: 130px;
    height: 130px;
  }

  .score-number {
    font-size: 2.2rem;
  }
}

/* ========== MISC ========== */
.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Selection */
::selection {
  background: rgba(46, 204, 113, 0.3);
}