* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, #root {
  height: 100%;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #fef2f2 100%);
  color: #1e293b;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-height: 100vh;
}

.header {
  text-align: center;
  margin-bottom: 36px;
  padding-top: 16px;
}

.header-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 36px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.header h1 {
  font-size: 26px;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.header h2 {
  font-size: 16px;
  font-weight: 500;
  color: #94a3b8;
}

.alert-card {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border: 1px solid #fecaca;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.alert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #dc2626, #ef4444);
  border-radius: 4px 0 0 4px;
}

.alert-title {
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 6px;
  font-size: 15px;
  padding-left: 12px;
}

.alert-text {
  font-size: 13px;
  color: #7f1d1d;
  line-height: 1.5;
  padding-left: 12px;
}

.btn-primary {
  width: 100%;
  padding: 18px 24px;
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  margin-bottom: 28px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
  letter-spacing: -0.2px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.section-heading {
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.section-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
}

.section-btn:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
  border-color: #cbd5e1;
}

.section-btn.weak {
  border-color: #fecaca;
  background: rgba(254, 242, 242, 0.5);
}

.section-btn.weak:hover {
  background: rgba(254, 242, 242, 0.8);
  border-color: #fca5a5;
}

.section-name {
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
  line-height: 1.4;
}

.section-count {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 3px;
}

.section-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.focus-badge {
  font-size: 10px;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  padding: 3px 10px;
  border-radius: 99px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.score-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  border: 3px solid;
  background: #fff;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.back-btn {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 0;
  font-weight: 500;
  transition: color 0.2s;
}

.back-btn:hover {
  color: #2563eb;
}

.running-score {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
  background: rgba(255,255,255,0.8);
  padding: 4px 12px;
  border-radius: 99px;
}

.progress-bar-track {
  background: #e2e8f0;
  border-radius: 99px;
  height: 6px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-bar-fill {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  height: 6px;
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}

.question-counter {
  font-size: 13px;
  font-weight: 700;
  color: #94a3b8;
}

.section-tag {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.question-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 28px 24px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.question-text {
  font-size: 17px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.6;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.option-btn {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  color: #1e293b;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 14px;
  line-height: 1.5;
}

.option-btn:hover:not(.answered) {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.option-btn.selected {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e40af;
}

.option-btn.correct {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #166534;
  cursor: default;
}

.option-btn.incorrect {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
  cursor: default;
}

.option-btn.answered {
  cursor: default;
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #64748b;
  transition: all 0.2s;
}

.option-btn.selected .option-letter {
  background: #2563eb;
  color: #fff;
}

.option-btn.correct .option-letter {
  background: #22c55e;
  color: #fff;
}

.option-btn.incorrect .option-letter {
  background: #ef4444;
  color: #fff;
}

.explanation-card {
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.explanation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.explanation-card.correct {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
}

.explanation-card.correct::before {
  background: #22c55e;
}

.explanation-card.incorrect {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border: 1px solid #fecaca;
}

.explanation-card.incorrect::before {
  background: #ef4444;
}

.explanation-title {
  font-weight: 800;
  margin-bottom: 8px;
  font-size: 15px;
  padding-left: 12px;
}

.explanation-title.correct {
  color: #166534;
}

.explanation-title.incorrect {
  color: #991b1b;
}

.explanation-text {
  font-size: 14px;
  color: #475569;
  line-height: 1.7;
  padding-left: 12px;
}

.btn-submit {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-submit.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-submit.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
}

.btn-submit.disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.results-header {
  text-align: center;
  margin-bottom: 36px;
  padding-top: 16px;
}

.results-icon {
  font-size: 64px;
  margin-bottom: 12px;
}

.results-status {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.results-status.pass {
  color: #166534;
}

.results-status.fail {
  color: #dc2626;
}

.results-pct {
  font-size: 56px;
  font-weight: 900;
  color: #1e293b;
  letter-spacing: -2px;
  margin: 4px 0;
}

.results-detail {
  font-size: 16px;
  color: #94a3b8;
  font-weight: 500;
}

.breakdown-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.breakdown-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.breakdown-score {
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  background: #f1f5f9;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 8px;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.missed-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #fecaca;
  border-radius: 14px;
  padding: 20px;
  transition: all 0.2s;
}

.missed-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.missed-section {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.missed-question {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 10px;
  line-height: 1.5;
}

.missed-your-answer {
  font-size: 13px;
  color: #dc2626;
  margin-bottom: 4px;
  font-weight: 500;
}

.missed-correct-answer {
  font-size: 13px;
  color: #166534;
  margin-bottom: 10px;
  font-weight: 500;
}

.missed-explanation {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  flex: 1;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.8);
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #fff;
  border-color: #cbd5e1;
}

.btn-retake {
  flex: 1;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-retake:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
}

.perfect-score {
  color: #22c55e;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  padding: 24px;
  background: rgba(240, 253, 244, 0.8);
  border-radius: 14px;
  border: 1px solid #bbf7d0;
}

@media (max-width: 480px) {
  .app-container {
    padding: 16px 14px 40px;
  }

  .header h1 {
    font-size: 22px;
  }

  .question-card {
    padding: 20px 16px;
  }

  .question-text {
    font-size: 15px;
  }

  .option-btn {
    padding: 14px 14px;
    font-size: 14px;
  }

  .results-pct {
    font-size: 48px;
  }

  .section-name {
    font-size: 13px;
  }
}
