/* ============================================
   G.R.I.P. Platform — Results Screen
   ============================================ */

/* ---- Results Header / Summary ---- */
.results-hero {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  margin-bottom: var(--space-8);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.results-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.results-hero__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.results-hero__score {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  text-shadow: var(--glow-cyan-lg);
  line-height: 1;
  animation: fadeIn 0.5s ease, scoreReveal 0.8s ease;
}

@keyframes scoreReveal {
  from {
    transform: scale(0.5);
    opacity: 0;
    filter: blur(10px);
  }
  to {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

.results-hero__descriptor {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
}

.results-hero__comparison {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.results-hero__comparison--up {
  color: var(--color-success);
}

.results-hero__comparison--down {
  color: var(--color-error);
}

.results-hero__comparison--same {
  color: var(--color-text-muted);
}

/* ---- NFI Breakdown ---- */
.nfi-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.nfi-breakdown__item {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  transition: var(--transition-all);
}

.nfi-breakdown__item:hover {
  border-color: var(--color-accent-muted);
  box-shadow: var(--glow-cyan-sm);
}

.nfi-breakdown__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.nfi-breakdown__value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  line-height: 1;
}

.nfi-breakdown__bar {
  margin-top: var(--space-3);
  height: 4px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.nfi-breakdown__bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  transition: width 0.6s ease;
}

.nfi-breakdown__detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* ---- Summary Stats Row ---- */
.results-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.results-summary__item {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

.results-summary__label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}

.results-summary__value {
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
}

/* ---- Per-Scenario Performance ---- */
.scenario-results {
  margin-bottom: var(--space-8);
}

.scenario-results__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-4);
}

.scenario-results__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.scenario-result-card {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: var(--space-4);
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  transition: var(--transition-all);
}

.scenario-result-card:hover {
  border-color: var(--color-accent-muted);
}

.scenario-result-card__number {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}

.scenario-result-card__info {
  min-width: 0;
}

.scenario-result-card__question {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scenario-result-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.scenario-result-card__tag {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.scenario-result-card__time {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.scenario-result-card__outcome {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.scenario-result-card__outcome--correct {
  background: var(--color-success-dim);
  color: var(--color-success);
}

.scenario-result-card__outcome--incorrect {
  background: var(--color-error-dim);
  color: var(--color-error);
}

.scenario-result-card__nfi {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  min-width: 48px;
  text-align: right;
}

/* ---- Trend Comparison Charts ---- */
.trend-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.trend-chart {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.trend-chart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.trend-chart__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.trend-chart__legend {
  display: flex;
  gap: var(--space-4);
}

.trend-chart__legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.trend-chart__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.trend-chart__canvas {
  width: 100%;
  height: 200px;
}

/* ---- Results Actions ---- */
.results-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .nfi-breakdown {
    grid-template-columns: 1fr;
  }

  .trend-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .results-hero__score {
    font-size: 3.5rem;
  }

  .results-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .scenario-result-card {
    grid-template-columns: 1fr auto;
    gap: var(--space-3);
  }

  .scenario-result-card__number {
    display: none;
  }

  .results-actions {
    flex-direction: column;
  }

  .results-actions .btn {
    width: 100%;
  }
}
