﻿/* ── Instruction Following Eval ──────────────────────────────────────────── */

/* ── Hero spacing overrides ──────────────────────────────────────────────── */

.tool-hero {
  padding: 3.5rem 0 3rem;
}

.tool-hero h1 {
  margin-bottom: 16px;
}

.tool-hero .lead {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-2);
  max-width: 680px;
  margin-top: 0;
  margin-bottom: 0;
}

/* ── Section chrome ───────────────────────────────────────────────────────── */

.eval-explainer-section {
  padding: 48px 0 56px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.eval-results-section {
  padding: 60px 0;
}

.eval-run-section {
  padding: 60px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ── FAQ / content section extra breathing room ───────────────────────────── */

.eval-run-section + .content-section,
.content-section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.eval-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.eval-section-header h2 {
  margin: 4px 0 0;
  font-size: 1.6rem;
}

.eval-section-header p {
  max-width: 460px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  padding-top: 8px;
}

.eval-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* ── Explainer cards ──────────────────────────────────────────────────────── */

.eval-explainer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.eval-explainer-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
}

.eval-explainer-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 14px;
}

.eval-explainer-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.eval-explainer-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Difficulty diagram ─────────────────────────────────────────────────── */

.difficulty-diagram {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
}

.difficulty-levels-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.difficulty-level-card {
  border-radius: 10px;
  padding: 16px 14px;
  border: 1px solid var(--border);
}

.difficulty-level-card.easy    { background: #f0fdf4; border-color: #86efac; }
.difficulty-level-card.medium  { background: #fffbeb; border-color: #fcd34d; }
.difficulty-level-card.hard    { background: #fff7ed; border-color: #fdba74; }
.difficulty-level-card.extreme { background: #fef2f2; border-color: #fca5a5; }

.difficulty-level-name {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.difficulty-level-card.easy    .difficulty-level-name { color: #15803d; }
.difficulty-level-card.medium  .difficulty-level-name { color: #b45309; }
.difficulty-level-card.hard    .difficulty-level-name { color: #c2410c; }
.difficulty-level-card.extreme .difficulty-level-name { color: #b91c1c; }

.constraint-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0,0,0,0.06);
  color: var(--text-muted);
  margin: 2px 2px 2px 0;
}

.difficulty-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  text-align: center;
}

@media (max-width: 680px) {
  .difficulty-levels-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Two-column sample layout ─────────────────────────────────────────────── */

.eval-two-col {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 800px) {
  .eval-two-col {
    grid-template-columns: 1fr;
  }
}

.eval-run-picker {
  position: sticky;
  top: 80px;
}

.eval-run-results {
  min-height: 200px;
}

/* ── Two-column run layout ────────────────────────────────────────────────── */

.eval-run-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 860px) {
  .eval-run-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Heatmap grid ─────────────────────────────────────────────────────────── */

.heatmap-wrap {
  overflow-x: auto;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 160px repeat(var(--cols, 4), 1fr);
  gap: 3px;
  min-width: 400px;
}

.hm-header {
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
}

.hm-row-label {
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
}

.hm-cell {
  border-radius: 6px;
  padding: 10px 8px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  cursor: default;
  position: relative;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: opacity 0.15s;
}

.hm-cell.empty {
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 400;
  cursor: default;
}

.hm-cell.pass     { background: #15803d; }
.hm-cell.degraded { background: #b45309; }
.hm-cell.fail     { background: #b91c1c; }
.hm-cell.pending  { background: var(--border); color: var(--text-muted); font-weight: 400; }
.hm-cell.error-cell { background: #7c3aed; }

.hm-cell-rate {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.hm-cell-label {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.85;
}

.hm-cell[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

/* ── Sample picker ────────────────────────────────────────────────────────── */

.sample-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.sample-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
}

.sample-card:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.sample-card.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.sample-meta {
  flex: 1;
  min-width: 0;
}

.sample-run-id {
  font-size: 0.8rem;
  font-family: monospace;
  color: var(--text-muted);
}

.sample-models-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.model-chip {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ── Run panel — key input ────────────────────────────────────────────────── */

.key-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #065f46;
  margin-bottom: 20px;
}

.key-notice svg { flex-shrink: 0; }

.key-type-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.key-type-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.key-type-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Model selector ───────────────────────────────────────────────────────── */

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.model-option:hover {
  border-color: var(--accent);
}

.model-option.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.model-option input[type="radio"],
.model-option input[type="checkbox"] { display: none; }

.model-option-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.model-option-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Cost estimator ───────────────────────────────────────────────────────── */

.cost-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.cost-box-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cost-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 4px;
}

.cost-line.total {
  font-weight: 700;
  font-size: 1rem;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.cost-free {
  color: #15803d;
  font-weight: 700;
}

/* ── Run config sliders ───────────────────────────────────────────────────── */

.run-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.run-config-item label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.run-config-item .val-display {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  float: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

/* ── Difficulty checkboxes ────────────────────────────────────────────────── */

.difficulty-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diff-check {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.12s, background 0.12s;
}

.diff-check:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
}

.diff-check input { display: none; }

/* ── Live progress ────────────────────────────────────────────────────────── */

.eval-progress-bar-wrap {
  background: var(--border);
  border-radius: 6px;
  height: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.eval-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  width: 0%;
  transition: width 0.3s ease;
}

.eval-status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Results detail ───────────────────────────────────────────────────────── */

.trial-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.trial-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.trial-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.trial-badge.pass    { background: #dcfce7; color: #15803d; }
.trial-badge.partial { background: #fef3c7; color: #b45309; }
.trial-badge.fail    { background: #fee2e2; color: #b91c1c; }
.trial-badge.error   { background: #ede9fe; color: #6d28d9; }

.trial-response {
  flex: 1;
  color: var(--text);
  font-style: italic;
  word-break: break-word;
  white-space: pre-wrap;
}

.trial-latency {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ── Constraint result rows ───────────────────────────────────────────────── */

.constraint-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  padding: 3px 0;
}

.constraint-pass { color: #15803d; font-weight: 600; }
.constraint-fail { color: #b91c1c; font-weight: 600; }

.compliance-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.compliance-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

/* ── Download button ──────────────────────────────────────────────────────── */

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s;
}

.btn-download:hover { border-color: var(--accent); color: var(--accent); }

/* ── No-results state ─────────────────────────────────────────────────────── */

.eval-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Task mode switch (sample task / my task) ────────────────────────────── */

.doc-mode-switch {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 6px;
}

.doc-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.83rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.doc-mode-btn + .doc-mode-btn {
  border-left: 1px solid var(--border);
}

.doc-mode-btn:hover { background: rgba(0,0,0,0.04); color: var(--text); }

.doc-mode-btn.active {
  background: var(--accent, #4f46e5);
  color: #fff;
  font-weight: 600;
}

/* ── Stat tiles ──────────────────────────────────────────────────────────── */

.eval-stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.eval-stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  cursor: default;
}

.eval-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.eval-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eval-stat-tile[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 400;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  max-width: 260px;
  text-align: center;
  white-space: normal;
}
