/* Evaluation page — RAIM Delphi study explorer */

/*
 * The rest of the RAIM site (index.html, pillars-*.html) has no dark-mode
 * support at all — it's fixed-light Bootstrap 4. So this page stays fixed
 * light too, rather than half-switching on OS theme while everything
 * around it stays light.
 */
.viz-root {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11,11,11,0.10);

  --series-ai:      #2a78d6; /* blue */
  --series-artists: #eb6834; /* orange */
  --series-ethics:  #1baf7a; /* aqua */
  --series-law:     #4a3aa7; /* violet */

  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-serious:  #ec835a;
  --status-critical: #d03b3b;
}

#eval-hero {
  background: url('../assets/study.jpg') no-repeat center;
  background-size: cover;
  color: #fff;
  position: relative;
}
#eval-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.55);
}
#eval-hero .container {
  position: relative;
  z-index: 1;
}

/* ---- Stat tiles ---- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat-tile {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.stat-tile .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.stat-tile .stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.stat-tile .stat-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

/* ---- Pillar tab selector ---- */
.pillar-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}
.pillar-tab {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.3;
}
.pillar-tab:hover {
  border-color: #007bff;
  color: #007bff;
}
.pillar-tab.active {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
}

/* ---- Radar chart layout ---- */
.radar-panel {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .radar-panel { grid-template-columns: 1fr; }
}

.radar-chart-wrap {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
}
.radar-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.radar-axis-label {
  fill: var(--text-secondary);
  font-size: 11px;
}
.radar-axis-label.is-clickable,
.slope-row-label.is-clickable {
  cursor: pointer;
}
.radar-axis-label.is-clickable:hover,
.radar-axis-label.is-clickable:focus-visible,
.slope-row-label.is-clickable:hover,
.slope-row-label.is-clickable:focus-visible {
  fill: #007bff;
  text-decoration: underline;
  outline: none;
}
.radar-tick-label {
  fill: var(--text-muted);
  font-size: 9px;
}
.radar-grid {
  stroke: var(--gridline);
  fill: none;
}
.radar-spoke {
  stroke: var(--gridline);
}
.radar-neutral {
  stroke: var(--baseline);
  stroke-dasharray: 4 3;
  fill: none;
}

.radar-poly {
  fill-opacity: 0.10;
  stroke-width: 2px;
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}
.radar-poly.is-dimmed {
  opacity: 0.12;
}
.radar-vertex {
  stroke: var(--surface-1);
  stroke-width: 1.5px;
  cursor: pointer;
}
.radar-vertex.is-dimmed {
  opacity: 0.12;
}

/* ---- Legend (shared: radar + consensus) ---- */
.viz-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--surface-1);
  user-select: none;
}
.legend-item:hover {
  border-color: var(--border);
}
.legend-item.is-off {
  opacity: 0.4;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex: none;
  position: relative;
}
.legend-swatch .legend-shape {
  position: absolute;
  inset: 0;
}
.legend-name {
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
}
.legend-count {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-left: auto;
}
.legend-hint {
  color: var(--text-muted);
  font-size: 0.76rem;
  margin-top: 0.25rem;
}

/* ---- Tooltip ---- */
.viz-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  padding: 0.5rem 0.7rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.1s ease;
  max-width: 240px;
}
.viz-tooltip.is-visible { opacity: 1; }
.viz-tooltip .tt-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.viz-tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-secondary);
}

/* ---- Consensus section ---- */
.status-summary-bar {
  display: flex;
  width: 100%;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.status-summary-bar .seg {
  height: 100%;
  cursor: pointer;
  transition: filter 0.1s ease;
  position: relative;
}
.status-summary-bar .seg:hover { filter: brightness(1.08); }
.status-summary-bar .seg + .seg { border-left: 2px solid var(--surface-1); }

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.6rem;
  font-size: 0.82rem;
}
.status-legend .item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--text-secondary);
}
.status-legend .item.is-off { opacity: 0.4; }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.consensus-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1rem 0;
}
.consensus-controls select,
.consensus-controls input[type="search"] {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.slope-chart-wrap {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}
.slope-chart-wrap svg {
  display: block;
}
.slope-row-label {
  fill: var(--text-secondary);
  font-size: 11px;
}
.slope-line {
  stroke-width: 2px;
}
.slope-dot {
  stroke: var(--surface-1);
  stroke-width: 1.5px;
  cursor: pointer;
}
.slope-axis-label {
  fill: var(--text-muted);
  font-size: 10px;
}
.slope-grid {
  stroke: var(--gridline);
}

.feature-row {
  display: none;
}
.feature-row.is-visible {
  display: grid;
}

/* ---- Section chrome shared with main site ---- */
.eval-section h2 {
  margin-bottom: 0.4rem;
}
.eval-section .section-intro {
  color: #495057;
  max-width: 62em;
}
.method-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  border-left: 3px solid var(--border);
  padding-left: 0.75rem;
  margin-top: 1rem;
}

.table-view-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.table-view-toggle:hover {
  border-color: #007bff;
  color: #007bff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table th, .data-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--text-secondary);
}
.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.feature-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}
.feature-link:hover, .feature-link:focus-visible {
  color: #007bff;
  text-decoration: underline;
}
