* { font-family: 'Inter', sans-serif; }

body {
  background: #0a0e1a;
  overflow-x: hidden;
}

.bg-ink { background: #0a0e1a; }

.gradient-text {
  background: linear-gradient(135deg, #06d6a0, #00b4d8, #7b61ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-hover:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.glow-cyan { box-shadow: 0 0 40px rgba(0, 180, 216, 0.15), 0 0 80px rgba(0, 180, 216, 0.05); }
.glow-purple { box-shadow: 0 0 40px rgba(123, 97, 255, 0.15), 0 0 80px rgba(123, 97, 255, 0.05); }
.glow-green { box-shadow: 0 0 40px rgba(6, 214, 160, 0.15), 0 0 80px rgba(6, 214, 160, 0.05); }
.glow-blue { box-shadow: 0 0 40px rgba(59, 130, 246, 0.15), 0 0 80px rgba(59, 130, 246, 0.05); }
.glow-sky { box-shadow: 0 0 40px rgba(14, 165, 233, 0.15), 0 0 80px rgba(14, 165, 233, 0.05); }
.glow-amber { box-shadow: 0 0 40px rgba(245, 158, 11, 0.15), 0 0 80px rgba(245, 158, 11, 0.05); }
.glow-orange { box-shadow: 0 0 40px rgba(249, 115, 22, 0.15), 0 0 80px rgba(249, 115, 22, 0.05); }
.glow-teal { box-shadow: 0 0 40px rgba(20, 184, 166, 0.15), 0 0 80px rgba(20, 184, 166, 0.05); }
.glow-fuchsia { box-shadow: 0 0 40px rgba(217, 70, 239, 0.15), 0 0 80px rgba(217, 70, 239, 0.05); }
.glow-rose { box-shadow: 0 0 40px rgba(244, 63, 94, 0.15), 0 0 80px rgba(244, 63, 94, 0.05); }
.glow-indigo { box-shadow: 0 0 40px rgba(99, 102, 241, 0.15), 0 0 80px rgba(99, 102, 241, 0.05); }
.glow-violet { box-shadow: 0 0 40px rgba(139, 92, 246, 0.15), 0 0 80px rgba(139, 92, 246, 0.05); }
.glow-lime { box-shadow: 0 0 40px rgba(132, 204, 22, 0.15), 0 0 80px rgba(132, 204, 22, 0.05); }

.card-shine { position: relative; overflow: hidden; }
.card-shine::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
}
.card-shine:hover::before { opacity: 1; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.nav-blur {
  backdrop-filter: blur(30px);
  background: rgba(10, 14, 26, 0.8);
}

.btn-primary {
  background: linear-gradient(135deg, #06d6a0, #00b4d8);
  transition: all 0.3s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(6, 214, 160, 0.3); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.3s ease;
}
.btn-secondary:hover { border-color: rgba(6, 214, 160, 0.5); background: rgba(6, 214, 160, 0.05); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0e1a; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 8, 15, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.hidden { display: none; }

.modal-panel {
  width: 100%;
  max-width: 34rem;
  border-radius: 1.5rem;
  padding: 2rem;
}

.settings-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 0.6rem 0.9rem;
  color: #fff;
  font-size: 0.9rem;
}
.settings-input:focus { outline: none; border-color: rgba(6, 214, 160, 0.5); }

.count-preset-btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  transition: all 0.15s ease;
}
.count-preset-btn:hover { border-color: rgba(6, 214, 160, 0.4); color: #06d6a0; }
.count-preset-btn.active { background: rgba(6, 214, 160, 0.15); border-color: rgba(6, 214, 160, 0.5); color: #06d6a0; }

.domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.domain-row label { display:flex; align-items:center; gap:0.6rem; font-size:0.85rem; color:#e2e8f0; cursor:pointer; flex:1; }
.domain-row input[type="checkbox"] { accent-color: #06d6a0; width: 1rem; height: 1rem; }
.domain-row .domain-weight { font-size: 0.7rem; color: #64748b; white-space: nowrap; }

.timer-mode-btn {
  font-size: 0.8rem;
  padding: 0.6rem 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  transition: all 0.15s ease;
}
.timer-mode-btn:hover { border-color: rgba(0, 180, 216, 0.4); }
.timer-mode-btn.active { background: rgba(0, 180, 216, 0.15); border-color: rgba(0, 180, 216, 0.5); color: #00b4d8; }

.difficulty-mode-btn {
  font-size: 0.8rem;
  padding: 0.6rem 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  transition: all 0.15s ease;
}
.difficulty-mode-btn:hover { border-color: rgba(6, 214, 160, 0.4); }
.difficulty-mode-btn.active { background: rgba(6, 214, 160, 0.15); border-color: rgba(6, 214, 160, 0.5); color: #06d6a0; }

.level-filter-btn {
  font-size: 0.8rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.level-filter-btn:hover { border-color: rgba(0, 180, 216, 0.4); }
.level-filter-btn.active { background: rgba(0, 180, 216, 0.15); border-color: rgba(0, 180, 216, 0.5); color: #00b4d8; }

.accent-slider { accent-color: #06d6a0; }

/* ---------- Exam view ---------- */
.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.9rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: #e2e8f0;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}
.option-btn:hover { border-color: rgba(0, 180, 216, 0.4); background: rgba(0, 180, 216, 0.05); }
.option-btn.selected { border-color: rgba(6, 214, 160, 0.6); background: rgba(6, 214, 160, 0.1); }
.option-btn .option-letter {
  flex-shrink: 0;
  width: 1.75rem; height: 1.75rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; color: #94a3b8;
}
.option-btn.selected .option-letter { background: rgba(6, 214, 160, 0.25); color: #06d6a0; }

/* review-mode coloring (used in results view questions) */
.option-btn.correct-answer { border-color: rgba(6, 214, 160, 0.6); background: rgba(6, 214, 160, 0.1); }
.option-btn.correct-answer .option-letter { background: rgba(6, 214, 160, 0.25); color: #06d6a0; }
.option-btn.wrong-answer { border-color: rgba(244, 63, 94, 0.6); background: rgba(244, 63, 94, 0.08); }
.option-btn.wrong-answer .option-letter { background: rgba(244, 63, 94, 0.25); color: #fb7185; }

.flag-btn {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; color: #64748b;
  padding: 0.4rem 0.7rem; border-radius: 0.6rem;
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.15s ease;
}
.flag-btn:hover { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.flag-btn.active { color: #fbbf24; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.4); }

.qnav-btn {
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.6rem;
  font-size: 0.75rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #94a3b8;
  transition: all 0.15s ease;
}
.qnav-btn:hover { border-color: rgba(0, 180, 216, 0.4); }
.qnav-btn.answered { background: rgba(6, 214, 160, 0.12); border-color: rgba(6, 214, 160, 0.35); color: #06d6a0; }
.qnav-btn.flagged { box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.6); color: #fbbf24; }
.qnav-btn.current { border-color: #06d6a0; box-shadow: 0 0 0 2px rgba(6, 214, 160, 0.35); color: #fff; }

/* ---------- Results view ---------- */
.stat-bar-track { width: 100%; height: 0.375rem; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #06d6a0, #00b4d8); transition: width 0.8s ease; }

.review-filter-btn {
  font-size: 0.75rem;
  padding: 0.4rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
}
.review-filter-btn.active { background: rgba(6, 214, 160, 0.15); border-color: rgba(6, 214, 160, 0.5); color: #06d6a0; }

.review-card { border-radius: 1rem; }
.review-card .option-btn { cursor: default; }
.review-card .option-btn:hover { transform: none; }

.timer-warning { color: #fbbf24 !important; }
.timer-critical { color: #fb7185 !important; animation: pulse-fast 1s ease-in-out infinite; }
@keyframes pulse-fast { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---------- PBQ interactive question types ---------- */
.pbq-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.3rem 0.7rem; border-radius: 999px;
  background: rgba(139, 92, 246, 0.12); color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.multiselect-btn.selected .option-letter.option-checkbox { background: rgba(6, 214, 160, 0.25); color: #06d6a0; }

.ordering-row, .matching-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.ordering-row .option-letter { flex-shrink: 0; }
.ordering-controls { display: flex; gap: 0.35rem; flex-shrink: 0; }
.order-btn {
  width: 2rem; height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}
.order-btn:hover:not(:disabled) { border-color: rgba(0, 180, 216, 0.4); color: #00b4d8; }
.order-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.matching-row { justify-content: space-between; flex-wrap: wrap; }
.matching-left { flex: 1 1 45%; font-size: 0.95rem; color: #e2e8f0; }
.matching-select { flex: 1 1 45%; max-width: 60%; }

.review-order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.review-order-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem; border-radius: 0.7rem;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02);
  font-size: 0.9rem; color: #e2e8f0;
}
.review-order-item.correct-answer { border-color: rgba(6, 214, 160, 0.6); background: rgba(6, 214, 160, 0.1); }
.review-order-item.wrong-answer { border-color: rgba(244, 63, 94, 0.6); background: rgba(244, 63, 94, 0.08); }

.review-match-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.review-match-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.06); color: #e2e8f0; vertical-align: top; }
.review-match-table tr:last-child td { border-bottom: none; }
.review-match-table .match-correct { color: #06d6a0; }
.review-match-table .match-wrong { color: #fb7185; }
