/* ──────────────────────────────────────────────
   DrillSharp App UI — matches landing page tokens
   ────────────────────────────────────────────── */

/* ── Nav ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-btn {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--fg-muted);
  transition: color 0.15s, border-color 0.15s;
}
.nav-btn:hover { color: var(--fg); }

.nav-btn-primary {
  background: var(--accent-glow);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent);
}
.nav-btn-primary:hover {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-bright);
}

/* ── Layout ── */
.app-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px;
}

.view { min-height: calc(100vh - 64px); }
.hidden { display: none !important; }

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
}

.page-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
}

/* ── Buttons ── */
.btn-accent {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #0a0e17;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-accent:hover { background: var(--accent-bright); transform: translateY(-1px); }
.btn-accent:active { transform: translateY(0); }

.btn-outline {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.15s;
}
.btn-ghost:hover { color: var(--fg); }

/* ── Dashboard Stats ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: rgba(245,158,11,0.2); }

.stat-card-accent {
  background: var(--accent-glow);
  border-color: rgba(245,158,11,0.3);
}

.stat-card-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-bright);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Dashboard Grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--fg);
}

/* Session Row */
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.session-row:last-child { border-bottom: none; }

.session-title {
  font-size: 0.9rem;
  color: var(--fg);
  font-weight: 500;
  flex: 1;
  margin-right: 12px;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-badge {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
}
.score-badge.high { background: rgba(34,197,94,0.15); color: #4ade80; }
.score-badge.mid  { background: rgba(245,158,11,0.15); color: var(--accent); }
.score-badge.low  { background: rgba(239,68,68,0.15);  color: #f87171; }

.session-time {
  font-size: 0.78rem;
  color: var(--fg-dim);
}

/* Schedule Row */
.schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.schedule-row:last-child { border-bottom: none; }

.schedule-title {
  font-size: 0.9rem;
  color: var(--fg);
  font-weight: 500;
  flex: 1;
}

.due-chip {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.due-chip.due-now { background: rgba(245,158,11,0.15); color: var(--accent); }
.due-chip.due-soon { background: rgba(100,116,139,0.15); color: var(--fg-muted); }

/* ── Due Alert ── */
.due-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-glow);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 28px;
  font-size: 0.95rem;
  color: var(--accent-bright);
  font-weight: 500;
}

.due-alert-icon { font-size: 1.2rem; }

/* ── Drills Grid ── */
.drills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.drill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative;
}
.drill-card:hover {
  border-color: rgba(245,158,11,0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.drill-card.is-due {
  border-color: rgba(245,158,11,0.25);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245,158,11,0.03) 100%);
}

.drill-card-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.drill-card-badge.due-now { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(245,158,11,0.2); }
.drill-card-badge.not-due { background: rgba(100,116,139,0.1); color: var(--fg-dim); border: 1px solid var(--border); }
.drill-card-badge.new { background: rgba(99,102,241,0.1); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }

.drill-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
  line-height: 1.3;
}

.drill-card-meta {
  font-size: 0.82rem;
  color: var(--fg-dim);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.drill-card-score {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-bright);
}

/* ── Active Drill ── */
.drill-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  min-height: calc(100vh - 64px);
}

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

.drill-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.drill-category {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.drill-progress-label {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.drill-timer {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-muted);
  min-width: 48px;
  text-align: right;
}

.drill-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.drill-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.drill-scenario-box {
  background: var(--bg-highlight);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 32px;
}

.scenario-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 12px;
}

.drill-scenario-box p {
  font-size: 1rem;
  color: var(--fg);
  line-height: 1.75;
}

.drill-question-box { margin-bottom: 24px; }

.drill-question-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 24px;
  line-height: 1.4;
}

.drill-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drill-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
}
.drill-option:hover:not(:disabled) {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.04);
}
.drill-option:disabled { cursor: default; }

.drill-option.selected-correct {
  border-color: #4ade80;
  background: rgba(34,197,94,0.08);
}
.drill-option.selected-wrong {
  border-color: #f87171;
  background: rgba(239,68,68,0.08);
}
.drill-option.reveal-correct {
  border-color: rgba(74,222,128,0.4);
  background: rgba(34,197,94,0.04);
}

.option-letter {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--fg-dim);
  min-width: 20px;
  padding-top: 2px;
}
.drill-option.selected-correct .option-letter,
.drill-option.reveal-correct .option-letter { color: #4ade80; }
.drill-option.selected-wrong .option-letter { color: #f87171; }

.option-text {
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.5;
}

/* Feedback */
.drill-feedback {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feedback-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.feedback-text {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.7;
}

/* ── Results ── */
.results-container {
  max-width: 700px;
}

.results-header {
  text-align: center;
  margin-bottom: 48px;
}

.results-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent);
  border: 1px solid rgba(245,158,11,0.3);
  padding: 5px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
  background: var(--accent-glow);
}

.results-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 32px;
}

.results-score-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--score-pct, 0%), var(--bg-highlight) 0%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}

.score-ring-inner {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring-num {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-bright);
  line-height: 1;
}

.score-ring-label {
  font-size: 0.72rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.results-meta-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 48px;
}

.result-meta-item {
  text-align: center;
}

.result-meta-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}

.result-meta-label {
  font-size: 0.78rem;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.results-answers {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.result-answer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.result-answer-card.correct { border-left: 3px solid #4ade80; }
.result-answer-card.wrong { border-left: 3px solid #f87171; }

.result-answer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.result-answer-q {
  font-weight: 500;
  color: var(--fg);
  font-size: 0.9rem;
  flex: 1;
}

.result-answer-icon { font-size: 1.1rem; }

.result-answer-explanation {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

.result-answer-speed {
  font-size: 0.78rem;
  color: var(--fg-dim);
  margin-top: 6px;
}

.results-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ── Empty / Loading States ── */
.empty-state, .loading-state {
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.9rem;
  padding: 32px 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-nav { padding: 0 16px; }
  .app-container { padding: 32px 16px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .drills-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .results-meta-row { gap: 24px; }
  .drill-container { padding: 16px 16px 40px; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px 14px; }
  .stat-card-num { font-size: 1.5rem; }
  .results-actions { flex-direction: column; }
}
