/* ═══ CCNA Exam Simulator — History Modal Styles ════════════════════════ */
/* ═══════════════════════════════════════════ HISTORY MODAL ═════════════ */
.history-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 16px;
}
.history-modal-overlay[hidden] { display: none; }

.history-modal {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  width: 100%; max-width: 780px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.history-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.history-modal-header h2 { font-size: 1.1rem; color: var(--cyan); }
.history-close {
  background: none; border: none; color: var(--text-dim);
  font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 2px 6px;
  border-radius: var(--radius); transition: color .15s;
}
.history-close:hover { color: var(--text); }

.history-body { overflow-y: auto; padding: 20px 24px; flex: 1; }

/* ─── Summary stats row ──────────────────────────────────────────────── */
.history-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.history-stat {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; text-align: center;
}
.history-stat .stat-val {
  font-size: 1.5rem; font-weight: 700; color: var(--cyan); display: block;
}
.history-stat .stat-lbl { font-size: 0.75rem; color: var(--text-dim); }

/* ─── Trend sparkline ────────────────────────────────────────────────── */
.history-trend { margin-bottom: 22px; }
.history-trend h3 { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 10px; }
.sparkline {
  display: flex; align-items: flex-end; gap: 4px;
  height: 56px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px;
}
.spark-bar {
  flex: 1; border-radius: 3px 3px 0 0; min-width: 8px;
  transition: opacity .2s; cursor: default; position: relative;
}
.spark-bar:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px; font-size: 0.7rem;
  color: var(--text); white-space: nowrap; pointer-events: none;
}

/* ─── Sessions table ─────────────────────────────────────────────────── */
.history-table {
  width: 100%; border-collapse: collapse; font-size: 0.83rem;
}
.history-table th {
  text-align: left; padding: 8px 10px; color: var(--text-dim);
  border-bottom: 1px solid var(--border); font-weight: 600;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em;
}
.history-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: var(--bg2); }
.score-cell { font-weight: 700; }
.score-pass { color: var(--green); }
.score-fail { color: var(--red); }

/* ─── Domain mini-bars in history ────────────────────────────────────── */
.mini-domain-bars { display: flex; gap: 2px; align-items: flex-end; height: 18px; }
.mini-bar { width: 8px; border-radius: 2px 2px 0 0; }

/* ─── History footer ─────────────────────────────────────────────────── */
.history-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0;
}

/* ─── History button ─────────────────────────────────────────────────── */
.btn-history {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius);
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 0.85rem; cursor: pointer;
  transition: all .15s;
}
.btn-history:hover { border-color: var(--cyan); color: var(--cyan); }

/* ─── Empty state ────────────────────────────────────────────────────── */
.history-empty {
  text-align: center; padding: 40px; color: var(--text-dim);
  font-size: 0.9rem;
}

/* ─── Domain avg row ─────────────────────────────────────────────────── */
.domain-avg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 22px;
}
.domain-avg-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.domain-avg-score {
  font-weight: 700; font-size: 0.9rem;
}

/* ═══════════════════════════════════════════ START SCREEN HISTORY BTN ══ */
.start-header-actions {
  display: flex; align-items: center; gap: 10px;
}

/* ─── Adaptive info badge on start ──────────────────────────────────── */
.adaptive-info {
  font-size: 0.75rem; color: var(--cyan-dim);
  margin-top: 4px; display: flex; align-items: center; gap: 4px;
}

/* ─── Difficulty filter label ────────────────────────────────────────── */
.filter-label {
  font-size: 0.82rem; color: var(--text-dim); font-weight: 600; white-space: nowrap;
}

/* ─── Sparkline bar colors ───────────────────────────────────────────── */
.spark-bar.pass { background: var(--green); }
.spark-bar.fail { background: var(--red); opacity: .75; }

/* ─── Stat label alias (history modal) ──────────────────────────────── */
.history-stat .stat-label {
  font-size: 0.75rem; color: var(--text-dim); display: block; margin-top: 3px;
}

/* ─── Trend colors ───────────────────────────────────────────────────── */
.trend-up   { color: var(--green) !important; }
.trend-down { color: var(--red)   !important; }

/* ═══════════════════════════════════════════ FLASHCARD SCREEN ══════════ */
