/* trade_timeline.css — "how each trade aged" feed.
 *
 * Composes two patterns that already live in the engine:
 *   - the side-by-side teams layout from league_view.css (.lv-trade*)
 *   - the SVG trajectory chart from suite.css (.bb-traj*)
 * extended to two series. Shared chrome lives in base.css; only
 * trade-timeline-specific bits are here.
 */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.tt-intro {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  margin-bottom: 16px;
}

/* ---------- the trade row (collapsed view) ---------- */
.tt-trade {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--bg-panel);
  overflow: hidden;
  transition: border-color .15s ease;
}
.tt-trade.open { border-color: var(--accent-soft); }

.tt-trade-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.tt-trade-head:hover { background: rgba(255,255,255,0.02); }

.tt-caret {
  flex-shrink: 0;
  width: 8px; height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform .18s ease;
}
.tt-trade.open .tt-caret { transform: rotate(45deg); }

.tt-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

/* the two sides, side by side */
.tt-teams {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.tt-team { flex: 1; min-width: 0; }
.tt-team-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.tt-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-got {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}
.tt-vs {
  align-self: center;
  color: var(--text-faint);
  font-size: 14px;
  flex-shrink: 0;
}

/* delta badge: green if this side gained value since the trade, red if lost */
.tt-delta {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.tt-delta.up   { color: var(--accent-good); background: rgba(74,222,128,0.12); }
.tt-delta.down { color: var(--accent-bad);  background: rgba(255,93,87,0.10); }
.tt-delta.flat { color: var(--text-muted);  background: rgba(255,255,255,0.05); }

/* ---------- expanded chart panel ---------- */
.tt-expand {
  border-top: 1px solid var(--stroke);
  padding: 16px;
  background: var(--bg-input);
}

.tt-chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 12px;
}
.tt-legend-item { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.tt-legend-swatch { width: 14px; height: 3px; border-radius: 2px; }

/* the chart itself — extends the suite.css trajectory pattern to two series */
.tt-chart { width: 100%; height: 260px; display: block; }
.tt-grid { stroke: var(--stroke-soft); stroke-width: 1; }
.tt-axis { fill: var(--text-faint); font-size: 10px; font-family: var(--font-mono); }
.tt-line { fill: none; stroke-width: 2.5; }
.tt-line.s0 { stroke: var(--accent); }        /* first side: signature blue */
.tt-line.s1 { stroke: var(--accent-gold); }   /* second side: gold */
.tt-dot { stroke: var(--bg-input); stroke-width: 2; }
.tt-dot.s0 { fill: var(--accent); }
.tt-dot.s1 { fill: var(--accent-gold); }

/* hover guideline + tooltip */
.tt-hover-line { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.tt-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-2);
  box-shadow: var(--shadow-modal);
  z-index: 50;
  white-space: nowrap;
}
.tt-tooltip .tt-tt-date { color: var(--text-faint); font-family: var(--font-mono); margin-bottom: 3px; }
.tt-tooltip .tt-tt-row { display: flex; justify-content: space-between; gap: 14px; }
.tt-tooltip .tt-tt-val { font-family: var(--font-mono); font-weight: 700; }

.tt-chart-wrap { position: relative; }

/* summary line under the chart */
.tt-verdict {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  background: rgba(0,0,0,0.18);
  color: var(--text-2);
}
.tt-verdict b { color: var(--text); }

/* league picker spacing on the page body for guests */
.tt-empty { color: var(--text-faint); font-style: italic; text-align: center; padding: 24px; font-size: 13px; }

@media (max-width: 640px) {
  main { padding: 14px; }
  .tt-trade-head { flex-wrap: wrap; }
  .tt-teams { flex-direction: column; }
  .tt-vs { transform: rotate(90deg); }
}
