/* evaluator.css — Trade Evaluator (the index page).
 *
 * Owns the three-column layout (you-send | you-receive | results),
 * the asset chips, the fairness bar, the pattern cards, and the
 * comparable-trade list. Shared chrome (header, identity chip,
 * onboarding overlay, modals, guest banner) lives in base.css.
 */

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 20px;
}

@media (max-width: 1100px) {
  main { grid-template-columns: 1fr; }
}

.panel.send    { border-top: 2px solid rgba(243, 156, 44,0.55); }
.panel.receive { border-top: 2px solid rgba(43, 196, 217,0.60); }
.panel.send    h2 { color: var(--accent); }
.panel.receive h2 { color: var(--accent-teal); }

.search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
}

.search-row input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-stack);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.search-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(243, 156, 44,0.15);
}

.pick-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.pick-shortcut {
  background: var(--bg-chip);
  color: var(--text-muted);
  border: 1px solid var(--stroke);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.pick-shortcut:hover {
  background: var(--stroke);
  color: var(--text);
}

.suggestions {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  background: var(--bg-input);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  z-index: 10;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.suggestion {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--stroke-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.suggestion:hover { background: var(--bg-chip); }

.suggestion .pos {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
}

.asset-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asset {
  background: var(--bg-input);
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.16s, transform 0.16s;
}

.asset:hover { border-color: var(--accent); border-left-color: var(--accent); transform: translateX(2px); }
.asset .name { font-weight: 600; }
.asset .meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.asset .value {
  color: var(--accent-gold);
  font-weight: 700;
  font-family: var(--font-mono);
}

.asset .remove {
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 8px;
  font-size: 18px;
  line-height: 1;
}

.asset .remove:hover { color: var(--accent-bad); }

.totals {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.totals .label {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.totals .value {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.results-panel {
  grid-column: 1 / -1;            /* full width, on the row below the inputs */
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: start;            /* cards hug their content, no stretched voids */
}
/* The verdict + copy bar read better spanning the full width than boxed in a
   half column. */
.results-panel > #copy-bar,
.results-panel > .primary { grid-column: 1 / -1; }

@media (max-width: 1100px) {
  .results-panel { grid-template-columns: 1fr; }
}

.results-section {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px;
}

.results-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fairness-bar {
  height: 30px;
  background: var(--bg-input);
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm);
  display: flex;
  overflow: hidden;
  margin: 10px 0;
  position: relative;
}

.fairness-bar .left {
  background: linear-gradient(90deg, var(--accent-action), var(--accent));
  height: 100%;
  transition: width 0.45s cubic-bezier(.21,.6,.35,1);
}

/* Receive side: a neutral cool slate. The verdict below carries good/bad —
   the bar only shows the split, so it must not borrow warning/value hues. */
.fairness-bar .right {
  background: linear-gradient(90deg, #3A3A3A, #4a4a58);
  height: 100%;
  transition: width 0.45s cubic-bezier(.21,.6,.35,1);
}

.fairness-bar .center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.verdict {
  text-align: center;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 11px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  border: 1px solid transparent;
}

.verdict.win  { background: rgba(74,222,128,0.10);  color: var(--accent-good); border-color: rgba(74,222,128,0.30); }
.verdict.loss { background: rgba(255,93,87,0.10);   color: var(--accent-bad);  border-color: rgba(255,93,87,0.30); }
.verdict.even { background: rgba(255,255,255,0.04); color: var(--text-2);      border-color: var(--stroke); }

.pattern {
  background: var(--bg-input);
  border-left: 3px solid var(--stroke);
  padding: 10px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.pattern.warning {
  border-left-color: var(--accent-bad);
  background: rgba(255, 93, 87, 0.1);
}

.pattern.info {
  border-left-color: var(--accent-warn);
  background: rgba(224, 169, 58, 0.1);
}

.pattern.good {
  border-left-color: var(--accent-good);
  background: rgba(74, 222, 128, 0.08);
}

.pattern .title { font-weight: 600; margin-bottom: 3px; font-size: 13px; }
.pattern .msg   { color: var(--text-2); font-size: 12px; line-height: 1.5; }
.pattern .lift  {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
  font-family: var(--font-mono);
}

.cp-section { font-size: 13px; }

.cp-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.cp-row .label { color: var(--text-muted); }
.cp-row .value { font-family: var(--font-mono); }

.cp-accept {
  padding: 8px;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
  margin-top: 10px;
}

.cp-accept.likely-accept { background: rgba(74,222,128,0.10); color: var(--accent-good); border:1px solid rgba(74,222,128,0.3); }
.cp-accept.borderline    { background: rgba(224,169,58,0.10); color: var(--accent-warn); border:1px solid rgba(224,169,58,0.3); }
.cp-accept.likely-reject { background: rgba(255,93,87,0.10); color: var(--accent-bad); border:1px solid rgba(255,93,87,0.3); }

.comparable {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--stroke-soft);
  font-size: 12px;
}

.comparable:last-child { border-bottom: none; }

.skill-note {
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 12px;
}

.skill-note.good    { background: rgba(74, 222, 128, 0.1); color: var(--accent-good); }
.skill-note.warning { background: rgba(255, 93, 87, 0.1); color: var(--accent-bad); }

.empty {
  color: var(--text-faint);
  font-style: italic;
  text-align: center;
  padding: 12px;
  font-size: 12px;
}

.loading { color: var(--text-faint); font-size: 12px; }

/* ===================================================================
 * Value-proposition hero (spans the grid, top of the evaluator)
 * =================================================================== */
.eval-hero {
  grid-column: 1 / -1;
  background:
    radial-gradient(900px 240px at 12% -40%, rgba(243, 156, 44,0.12), transparent 70%),
    var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.eval-hero-main { max-width: 640px; }
.eval-hero h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.eval-hero h2 em { color: var(--accent); font-style: italic; }
.eval-hero p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.eval-hero-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-pill {
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg-input);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-pill);
  padding: 7px 13px;
  white-space: nowrap;
}
.hero-pill b { color: var(--text); font-weight: 700; }

/* ===================================================================
 * Results hierarchy — primary verdict dominates; niche detail folds away
 * =================================================================== */
.results-section.primary {
  border-color: rgba(243, 156, 44,0.40);
  box-shadow: 0 0 0 1px rgba(243, 156, 44,0.08), 0 8px 26px rgba(0,0,0,0.45);
  background:
    radial-gradient(600px 160px at 50% -60%, rgba(243, 156, 44,0.10), transparent 70%),
    var(--bg-panel);
}
.results-section.primary .verdict {
  font-size: 24px;
  padding: 14px;
  margin-top: 12px;
}

/* Collapsible secondary sections */
details.collapsible { padding-bottom: 8px; }
details.collapsible > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 2px 0;
  transition: color .15s ease;
}
details.collapsible > summary:hover { color: var(--text); }
details.collapsible > summary::-webkit-details-marker { display: none; }
/* chevron */
details.collapsible > summary::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .18s ease;
  opacity: 0.8;
}
details.collapsible[open] > summary::before { transform: rotate(45deg); }
details.collapsible > summary > span { color: inherit; }
details.collapsible > *:not(summary) { margin-top: 12px; }
