/* ==========================================================================
   ReCyF Tool - History Module Styles
   ========================================================================== */

.history {
  max-width: 720px;
}

.history__header {
  margin-bottom: var(--space-xl);
}

.history__header h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-xs);
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.history__empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-2xl);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.history__empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.history__empty-title {
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
  margin-bottom: var(--space-sm);
}

.history__empty-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ── Timeline ────────────────────────────────────────────────────────────── */

.history__timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* ── Entry card ──────────────────────────────────────────────────────────── */

.history-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: box-shadow var(--transition-fast);
}

.history-card:hover {
  box-shadow: var(--shadow-md);
}

.history-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.history-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.history-card__version {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  font-family: var(--font-heading);
}

.history-card__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.history-card__stats {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.history-card__stat {
  font-size: var(--text-sm);
}

.history-card__stat-label {
  color: var(--color-text-muted);
  margin-right: var(--space-xs);
}

.history-card__locked-btn {
  opacity: 0.7;
}

/* ── Upsell banner ───────────────────────────────────────────────────────── */

.history__upsell {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  background: var(--color-primary-bg);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
}

.history__upsell-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.history__upsell-body {
  font-size: var(--text-sm);
}

.history__upsell-body strong {
  display: block;
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-xs);
}

.history__upsell-body p {
  color: var(--color-text-secondary);
  margin: 0;
}

/* ==========================================================================
   Snapshot Comparison Modal
   ========================================================================== */

/* ── Summary stats bar ──────────────────────────────────────────────────── */

.compare-summary {
  display: flex;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
  flex-wrap: wrap;
}

.compare-summary__stat {
  flex: 1 1 0;
  min-width: 80px;
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.compare-summary__count {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  font-family: var(--font-heading);
  line-height: 1.2;
}

.compare-summary__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.compare-summary__stat--success .compare-summary__count { color: var(--color-success); }
.compare-summary__stat--danger .compare-summary__count  { color: var(--color-danger); }
.compare-summary__stat--muted .compare-summary__count   { color: var(--color-text-muted); }
.compare-summary__stat--info .compare-summary__count    { color: var(--color-info, #3498db); }

/* ── Visual delta bar ───────────────────────────────────────────────────── */

.compare-delta-bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.compare-delta-bar__seg {
  transition: width 0.3s ease;
}

.compare-delta-bar__seg--success { background: var(--color-success); }
.compare-delta-bar__seg--danger  { background: var(--color-danger); }
.compare-delta-bar__seg--muted   { background: var(--color-border); }

/* ── Pillar sections ────────────────────────────────────────────────────── */

.compare-pillar {
  border-left: 4px solid var(--color-border);
  padding-left: var(--space-md);
  margin-bottom: var(--space-lg);
}

.compare-pillar__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.compare-pillar__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.compare-pillar__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-md);
}

.compare-pillar__delta {
  margin-left: auto;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  font-family: var(--font-heading);
}

/* ── Comparison table ───────────────────────────────────────────────────── */

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
}

.compare-table th {
  text-align: left;
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.compare-table td {
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
  vertical-align: middle;
}

.compare-table__id {
  font-family: var(--font-mono, monospace);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.compare-table__label {
  font-family: var(--font-body, sans-serif);
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-left: var(--space-xs);
}

/* ── Score badges ───────────────────────────────────────────────────────── */

.compare-badge {
  display: inline-block;
  min-width: 1.6em;
  text-align: center;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
}

.compare-badge--zero { background: var(--color-bg-alt); color: var(--color-text-muted); }
.compare-badge--low  { background: var(--color-bg-alt); background: color-mix(in srgb, var(--color-danger) 15%, var(--color-bg)); color: var(--color-danger); }
.compare-badge--mid  { background: var(--color-bg-alt); background: color-mix(in srgb, var(--color-warning, #f39c12) 15%, var(--color-bg)); color: var(--color-warning, #f39c12); }
.compare-badge--high { background: var(--color-bg-alt); background: color-mix(in srgb, var(--color-success) 15%, var(--color-bg)); color: var(--color-success); }

/* ── Arrows ─────────────────────────────────────────────────────────────── */

.compare-arrow--up {
  color: var(--color-success);
  font-weight: var(--weight-bold);
}

.compare-arrow--down {
  color: var(--color-danger);
  font-weight: var(--weight-bold);
}
