/* Schemancer Demo — 3-Column Scenario Grid */

body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }

/* Scenario columns */
.scenario-col {
  border-right: 1px solid rgba(100, 116, 139, 0.2);
  display: flex;
  flex-direction: column;
}
.scenario-col:last-child { border-right: none; }

/* Header: viz cards left, text right */
.scenario-header {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.2);
  min-height: 160px;
  align-items: flex-start;
}
.scenario-hero-viz {
  flex-shrink: 0;
  width: 140px;
  background: #0f172a;
  border-radius: 6px;
  border: 1px solid #1e293b;
}
.scenario-info { flex: 1; min-width: 0; }
.scenario-icon { font-size: 1.25rem; margin-bottom: 0.375rem; }
.scenario-title { font-size: 1rem; font-weight: 700; color: #f1f5f9; }
.scenario-subtitle { font-size: 0.7rem; color: #64748b; margin-top: 0.125rem; }
.scenario-desc { font-size: 0.75rem; color: #94a3b8; margin-top: 0.5rem; line-height: 1.4; }

/* Stats row */
.stats-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.15);
  align-items: center;
  flex-wrap: wrap;
}
.stat-chip {
  font-size: 10px;
  font-family: monospace;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}
.stat-chip.ratio {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-weight: 600;
}

/* Result breakdown */
.breakdown {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.15);
  font-size: 0.75rem;
  line-height: 1.6;
  color: #94a3b8;
}
.bd-table { color: #e2e8f0; font-size: 0.8rem; margin-top: 0.375rem; }
.bd-table:first-child { margin-top: 0; }
.bd-badge { font-size: 0.65rem; font-weight: 600; color: #818cf8; }
.bd-row { padding-left: 0.75rem; display: flex; align-items: center; gap: 0.375rem; }
.bd-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.bd-col { font-family: monospace; color: #cbd5e1; font-size: 0.7rem; }

/* Section labels within column */
.section-label {
  padding: 0.375rem 1.25rem;
  font-size: 10px;
  font-family: monospace;
  color: #475569;
  background: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Manifest code (read-only Python) */
.manifest-code {
  margin: 0;
  padding: 10px 14px;
  background: #0f172a;
  font-size: 11px;
  line-height: 1.55;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  overflow-x: auto;
  color: #e2e8f0;
  max-height: 260px;
}
.py-comment { color: #475569; font-style: italic; }
.py-string { color: #a5d6ff; }
.py-keyword { color: #ff7b72; }

/* SQL output with line numbers */
.sql-code {
  margin: 0;
  padding: 6px 0;
  background: #0f172a;
  font-size: 11px;
  line-height: 1.5;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  counter-reset: line;
  overflow-x: auto;
  max-height: 300px;
}
.sql-code .sql-line {
  display: block;
  padding: 0 10px 0 40px;
  position: relative;
  border-left: 3px solid transparent;
}
.sql-code .sql-line::before {
  counter-increment: line;
  content: counter(line);
  position: absolute;
  left: 0;
  width: 30px;
  text-align: right;
  color: #475569;
  font-size: 10px;
  user-select: none;
}

/* Conflict color highlights */
.hl-key { color: #fbbf24; }
.hl-add { color: #60a5fa; }
.hl-array { color: #34d399; }
.hl-json { color: #a78bfa; }
.hl-replace { color: #f472b6; }
.hl-keyword { color: #7dd3fc; }
.hl-comment { color: #475569; font-style: italic; }

.sql-line.border-key { border-left-color: #fbbf24; }
.sql-line.border-add { border-left-color: #60a5fa; }
.sql-line.border-array { border-left-color: #34d399; }
.sql-line.border-json { border-left-color: #a78bfa; }
.sql-line.border-replace { border-left-color: #f472b6; }

/* D3 table cards */
.table-card { fill: #1e293b; stroke: #334155; stroke-width: 1; rx: 6; }
.table-card-header { fill: #334155; rx: 6; }
.table-name { fill: #38bdf8; font-size: 10px; font-weight: 600; }
.col-text { fill: #cbd5e1; font-size: 9px; font-family: monospace; }
.col-type { fill: #64748b; font-size: 9px; font-family: monospace; }

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.table-group { animation: cardAppear 0.3s ease-out both; }
.table-group:nth-child(2) { animation-delay: 0.05s; }
.table-group:nth-child(3) { animation-delay: 0.1s; }
.table-group:nth-child(4) { animation-delay: 0.15s; }
.table-group:nth-child(5) { animation-delay: 0.2s; }

/* Stream output */
.stream-item { display: inline-block; margin-right: 12px; }
.stream-ok { color: #34d399; }
.stream-err { color: #f87171; }
.stream-time { color: #64748b; }

#stream-progress {
  font-size: 11px; font-family: monospace;
  color: #94a3b8; min-width: 100px;
}
#progress-bar {
  height: 2px; background: #1e293b;
  border-radius: 1px; overflow: hidden;
}
#progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  transition: width 0.2s ease;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }
