@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-app: #020617;        /* Ultra dark slate */
    --bg-card: #0f172a;       /* Dark slate card */
    --bg-input: #1e293b;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-label: #cbd5e1;
    
    --accent-primary: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-gold: #eab308;
    
    --border-subtle: #1e293b;
    --border-strong: #334155;

    --positive: #22c55e;
    --negative: #ef4444;

  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, monospace;
}

/* Light mode overrides (Removed, forcing dark terminal UI) */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

#root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

/* Header */
.quant-header {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: var(--accent-gold);
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controls-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

select {
  font-family: var(--font-sans);
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

select:focus {
  border-color: var(--accent-primary);
}

/* Layout */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  padding: 16px;
  gap: 16px;
}

/* Sidebar / Rules Panel */
.panel-rules {
  width: 340px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-input);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-label);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-content {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rule-card {
  border-left: 2px solid var(--accent-primary);
  padding-left: 12px;
}

.rule-card.gold { border-color: var(--accent-gold); }

.rule-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
}

.rule-math {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
  background-color: var(--bg-input);
  padding: 8px;
  border-radius: 4px;
  word-break: break-all;
  white-space: pre-wrap;
}
@media (prefers-color-scheme: light) {
  .rule-math {
    color: var(--accent-secondary);
  }
}

/* Main Matrix Viewer */
.panel-matrix {
  flex: 1;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tabs-row {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-input);
}

.tab-btn {
  padding: 12px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-card);
}

.tab-btn.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
  background-color: var(--bg-card);
}

.matrix-container {
  flex: 1;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: right;
}

.data-table th, .data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  position: sticky;
  top: 0;
  background-color: var(--bg-input);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-label);
  z-index: 10;
  border-bottom: 1px solid var(--border-strong);
}

.data-table th:first-child, .data-table td:first-child {
  text-align: left;
}

.data-table tbody tr:hover {
  background-color: var(--bg-input);
}

.sym-code {
  font-weight: 600;
  color: var(--text-main);
}

.val-base {
  color: var(--text-muted);
}

.val-stress {
  font-weight: 700;
  color: var(--text-main);
}

.vol-change {
  display: inline-block;
  padding: 4px 6px;
  background-color: rgba(202, 138, 4, 0.1);
  color: var(--accent-gold);
  border-radius: 4px;
  font-weight: 600;
}
