@import "design_system.css";

.exam-section {
  margin-top: 4px;
}

.exam-section .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.exam-section .section-head h3 {
  margin: 0;
  font-size: 18px;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.subject-card {
  --accent: var(--brand-navy-700);
  --accent-soft: var(--brand-navy-subtle);
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, border-color .22s ease;
}

.subject-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: transparent;
}

.subject-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-soft);
  opacity: 0.6;
  z-index: 0;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.subj-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  box-shadow: 0 8px 18px -6px var(--accent);
  color: #fff;
  font-size: 24px;
}

.completion-pill {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 5px 10px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--blue-900);
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.card-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  position: relative;
  z-index: 1;
  line-height: 1.5;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 18px;
  position: relative;
  z-index: 1;
  gap: 12px;
}

.qcount {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
}

.practice-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.practice-btn:hover {
  filter: brightness(1.08);
  transform: translateX(2px);
}

.practice-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.quiz-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-question {
  display: flex;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-900, #122a5c);
}

.option-list { display: grid; gap: 12px; }

.option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  background: #fff;
}

.option-label:hover {
  border-color: rgba(43, 95, 226, 0.3);
  background: #fbfbff;
}

.answer-field { display: grid; gap: 8px; }
.answer-field span { color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.answer-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
}

.panel-intro {
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(18,42,92,0.08);
  background: rgba(255,255,255,0.9);
}
.panel-intro h2 { font-size: 20px; color: var(--blue-900, #122a5c); margin-bottom: 6px; }
.panel-intro p { color: var(--ink-soft); font-size: 14px; }
.mcq-panel { background: rgba(37,99,235,0.12); border-color: rgba(37,99,235,0.2); }

.exam-back {
  margin-top: 18px;
  border: 0;
  background: var(--blue-100);
  color: var(--blue-600);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.exam-muted,
.exam-error {
  color: var(--ink-soft);
}

.exam-error {
  color: #b42318;
}

.exam-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.exam-toolbar .exam-progress {
  margin-bottom: 0;
}

.exam-timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  padding: 7px 16px 7px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFFDF5 0%, #FEF3C7 100%);
  border: 1.5px solid var(--brand-gold);
  box-shadow: 0 4px 14px rgba(197, 155, 39, 0.2);
  color: var(--brand-navy-900);
}

.exam-timer-ring {
  width: 42px;
  height: 42px;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.exam-timer-track,
.exam-timer-arc {
  fill: none;
  stroke-width: 3.4;
}

.exam-timer-track {
  stroke: rgba(18, 42, 92, 0.12);
}

.exam-timer-arc {
  stroke: #122a5c;
  stroke-linecap: round;
  stroke-dasharray: 97.39;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s linear, stroke 0.25s ease;
}

.exam-timer-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.exam-timer-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.exam-timer-digits {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.exam-timer.is-warn {
  background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%);
  border-color: #fb8c00;
  box-shadow: 0 10px 22px rgba(251, 140, 0, 0.28);
  animation: exam-timer-pulse 1s ease-in-out infinite;
}

.exam-timer.is-warn .exam-timer-arc {
  stroke: #e65100;
}

.exam-timer.is-danger {
  background: linear-gradient(135deg, #ffebee 0%, #ef9a9a 100%);
  border-color: #e53935;
  color: #7f1d1d;
  box-shadow: 0 10px 22px rgba(229, 57, 53, 0.28);
  animation: exam-timer-pulse 0.55s ease-in-out infinite;
}

.exam-timer.is-danger .exam-timer-arc {
  stroke: #c62828;
}

@keyframes exam-timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

body.theme-dark .exam-timer {
  background: linear-gradient(135deg, #3d3420 0%, #5a4a1a 100%);
  border-color: #C59B27;
  color: #fff8e1;
}

body.theme-dark .exam-timer-track {
  stroke: rgba(255, 248, 225, 0.18);
}

body.theme-dark .exam-timer-arc {
  stroke: #C59B27;
}

body.theme-dark .exam-timer.is-warn {
  background: linear-gradient(135deg, #4a3010 0%, #7a4a12 100%);
  color: #ffe0b2;
}

body.theme-dark .exam-timer.is-danger {
  background: linear-gradient(135deg, #4a1c1c 0%, #7f1d1d 100%);
  color: #ffcdd2;
}

.review-subject {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef3ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.theme-dark .review-subject {
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

.exam-nav { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.exam-btn {
  appearance: none;
  -webkit-appearance: none;
  font-family: 'Poppins', 'Inter', sans-serif;
  border: 1.5px solid var(--border-color);
  background: var(--surface-card);
  color: var(--brand-navy-900);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  min-height: 48px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.exam-btn:hover:not(:disabled) {
  border-color: var(--brand-gold);
  background: var(--surface-subtle);
  transform: translateY(-1px);
}
.exam-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.exam-btn-primary {
  background: var(--brand-navy-gradient);
  color: #FFFFFF !important;
  border: 1px solid var(--brand-gold-border);
  margin-left: auto;
  box-shadow: 0 4px 12px rgba(11, 30, 54, 0.2);
}
.exam-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(197, 155, 39, 0.35);
  color: #FFFFFF !important;
}

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