/* ── Sandbox-specific styles ──────────────────────────────────── */

.back-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  transition: background 0.15s;
}
.back-link:hover { background: rgba(255,255,255,0.1); }

.sandbox-main { max-width: 1400px; margin: 0 auto; padding: 1.5rem; }

.sandbox-layout {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 960px) { .sandbox-layout { grid-template-columns: 1fr; } }

/* ── Controls panel ───────────────────────────────────────────── */
.controls-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.controls-header h2 { font-size: 1rem; font-weight: 700; color: var(--navy); }
.controls-hint { font-size: 0.75rem; color: var(--gray); margin-bottom: 1rem; }

#reset-btn {
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--gray);
  transition: border-color 0.15s, color 0.15s;
}
#reset-btn:hover { border-color: var(--blue); color: var(--blue); }

.control-group {
  margin-bottom: 1.25rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.9rem;
}
.group-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

/* Individual slider control */
.slider-control { margin-bottom: 0.9rem; }
.slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.slider-label { font-size: 0.78rem; color: #334155; font-weight: 500; }
.slider-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  min-width: 52px;
  text-align: right;
}
input[type="range"] {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  appearance: none;
  background: #e2e8f0;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover { background: var(--navy); transform: scale(1.2); }
input[type="range"].changed { background: linear-gradient(to right, var(--accent) 0%, #e2e8f0 0%); }

/* ── Results panel ────────────────────────────────────────────── */
.results-panel { display: flex; flex-direction: column; gap: 1.25rem; }

/* Prediction display */
.result-panel {}
.prob-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}
.prob-side { text-align: center; min-width: 70px; }
.prob-label { font-size: 0.7rem; font-weight: 700; color: var(--gray); text-transform: uppercase; letter-spacing: 1px; }
.prob-number { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.home-side .prob-number { color: var(--green); }
.away-side .prob-number { color: #3b82f6; }

.prob-track-wrap { flex: 1; text-align: center; }
.prob-track {
  height: 16px;
  background: #dbeafe;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.prob-fill {
  height: 100%;
  background: var(--green);
  border-radius: 8px;
  transition: width 0.4s ease;
}
.pred-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
}

/* Importance chart */
.importance-chart { margin-top: 0.5rem; }
.imp-row {
  display: grid;
  grid-template-columns: 180px 1fr 42px;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.imp-name {
  font-size: 0.72rem;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.imp-bar-bg {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}
.imp-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
  transition: width 0.3s;
}
.imp-bar-fill.highlighted { background: var(--accent); }
.imp-pct {
  font-size: 0.7rem;
  color: var(--gray);
  text-align: right;
  font-weight: 600;
}

/* Reasoning */
.reasoning-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.25rem; }
.reasoning-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
}
.reasoning-row.positive { background: #f0fdf4; }
.reasoning-row.negative { background: #fef2f2; }
.reasoning-row.neutral  { background: #f8fafc; }
.reasoning-feat  { color: #334155; font-weight: 500; }
.reasoning-delta { font-weight: 700; min-width: 55px; text-align: right; }
.reasoning-row.positive .reasoning-delta { color: var(--green); }
.reasoning-row.negative .reasoning-delta { color: var(--red); }
.reasoning-row.neutral  .reasoning-delta { color: var(--gray); }

/* Log panel */
.log-entries {
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.log-entry {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.log-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  user-select: none;
}
.log-entry-header:hover { background: #f1f5f9; }
.log-ts    { color: var(--gray); font-size: 0.68rem; }
.log-prob  { font-weight: 700; color: var(--navy); }
.log-src   { font-size: 0.68rem; color: #7c3aed; font-weight: 600; }
.log-toggle { color: var(--gray); font-size: 0.7rem; }
.log-entry-body {
  padding: 0.6rem 0.75rem;
  background: #fff;
  display: none;
}
.log-entry-body.open { display: block; }
.log-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem 1rem;
  margin-bottom: 0.5rem;
}
.log-feat-row { display: flex; justify-content: space-between; }
.log-feat-name  { color: #64748b; }
.log-feat-value { color: var(--navy); font-weight: 600; }
.log-reasoning-head { font-weight: 700; color: var(--navy); margin: 0.4rem 0 0.2rem; font-family: inherit; font-size: 0.72rem; }
.log-contrib { color: #334155; }

.refresh-btn {
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--gray);
  transition: all 0.15s;
}
.refresh-btn:hover { border-color: var(--blue); color: var(--blue); }
