/* ============================================================
   style.css — общие стили поверх Tailwind (переменные, кастомные
   компоненты, которые неудобно делать чистыми utility-классами)
   ============================================================ */

:root {
  --brand-primary: #4f46e5;
  --brand-primary-dark: #4338ca;
  --brand-accent: #f59e0b;
  --brand-success: #16a34a;
  --brand-danger: #dc2626;
  --brand-bg: #f5f6fb;
}

body {
  background-color: var(--brand-bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---------------- Карточки тем на главной ---------------- */
.topic-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(79, 70, 229, 0.25);
}

.progress-ring-bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 4;
}
.progress-ring-fg {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

/* ---------------- Теория ---------------- */
.theory-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-primary-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.theory-content h3:first-child { margin-top: 0; }
.theory-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}
.theory-content p { margin-bottom: 0.75rem; line-height: 1.6; }
.theory-content b { color: #1f2937; }
.theory-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.theory-table th, .theory-table td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.theory-table th {
  background: #eef2ff;
  color: var(--brand-primary-dark);
}

/* ---------------- Навигация по вопросам ---------------- */
.qnav-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #fff;
  color: #6b7280;
  border-color: #e5e7eb;
}
.qnav-btn:hover { border-color: var(--brand-primary); }
.qnav-btn.status-current {
  border-color: var(--brand-primary);
  background: #eef2ff;
  color: var(--brand-primary-dark);
}
.qnav-btn.status-answered-correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
}
.qnav-btn.status-answered-wrong {
  background: #fee2e2;
  border-color: #dc2626;
  color: #b91c1c;
}
.qnav-btn.status-skipped {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
.qnav-btn.status-unvisited {
  background: #fff;
  border-color: #e5e7eb;
  color: #9ca3af;
}

/* ---------------- Варианты ответа ---------------- */
.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.9rem 1.1rem;
  border-radius: 0.75rem;
  border: 2px solid #e5e7eb;
  background: #fff;
  transition: all 0.15s ease;
  cursor: pointer;
  font-size: 1rem;
}
.option-btn:hover:not(.locked) { border-color: var(--brand-primary); background: #f5f7ff; }
.option-btn.selected { border-color: var(--brand-primary); background: #eef2ff; }
.option-btn.correct-answer { border-color: var(--brand-success); background: #dcfce7; }
.option-btn.wrong-answer { border-color: var(--brand-danger); background: #fee2e2; }
.option-btn.locked { cursor: default; }

/* ---------------- Таймер ---------------- */
.timer-badge {
  font-variant-numeric: tabular-nums;
}
.timer-badge.warning { color: var(--brand-danger); animation: pulse-timer 1s infinite; }
@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---------------- Общее ---------------- */
.tab-btn.active {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.level-card.selected {
  border-color: var(--brand-primary);
  background: #eef2ff;
}
.mode-card.selected {
  border-color: var(--brand-primary);
  background: #eef2ff;
}

.fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.srs-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}
