/* main_bayes_visualizer.css — Bayes' Theorem & Natural Frequency Lab */

:root {
  --bv-primary: var(--primary, #2563eb);
  --bv-tp: #10b981; /* True Positive (Hit) */
  --bv-fp: #f59e0b; /* False Positive (False Alarm) */
  --bv-fn: #ef4444; /* False Negative (Miss) */
  --bv-tn: #cbd5e1; /* True Negative (Correct Rejection) */
}

/* Presets Shelf */
.presets-shelf {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.07) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}

.presets-shelf h4 {
  margin: 0 0 0.65rem 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #065f46;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preset-chips {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.preset-chip {
  padding: 0.45rem 0.95rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-chip:hover {
  border-color: var(--bv-primary);
  color: var(--bv-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.preset-chip.active {
  background: var(--bv-primary);
  color: #ffffff;
  border-color: var(--bv-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Big Posterior Spotlight */
.bayes-spotlight {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
  flex-wrap: wrap;
}

.spotlight-left h3 {
  margin: 0 0 0.35rem 0;
  font-size: 1.1rem;
  color: #94a3b8;
  font-weight: 500;
}

.spotlight-title-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.01em;
}

.spotlight-formula {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: #cbd5e1;
  font-family: monospace;
}

.spotlight-right {
  text-align: right;
}

.spotlight-percent {
  font-size: 3.25rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1;
}

.spotlight-percent-sub {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-top: 0.4rem;
}

/* Natural Frequency 1000-Dot Grid */
.dot-grid-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dot-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dot-grid-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.dot-grid-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  font-weight: 600;
}

.dot-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dot-legend-chip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot-grid-canvas {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  max-height: 280px;
  overflow-y: auto;
}

.dot-item {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transition: transform 0.15s;
}

.dot-item:hover {
  transform: scale(2);
  z-index: 10;
}

.dot-tp { background: var(--bv-tp); box-shadow: 0 0 3px rgba(16, 185, 129, 0.6); }
.dot-fp { background: var(--bv-fp); box-shadow: 0 0 3px rgba(245, 158, 11, 0.6); }
.dot-fn { background: var(--bv-fn); }
.dot-tn { background: #cbd5e1; }

/* 2x2 Contingency Matrix Table */
.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
  font-size: 0.9rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.matrix-table th, .matrix-table td {
  padding: 0.85rem 1rem;
  text-align: center;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.matrix-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
}

.matrix-table td.cell-tp { background: rgba(16, 185, 129, 0.12); color: #065f46; font-weight: 700; }
.matrix-table td.cell-fp { background: rgba(245, 158, 11, 0.12); color: #92400e; font-weight: 700; }
.matrix-table td.cell-fn { background: rgba(239, 68, 68, 0.1); color: #991b1b; font-weight: 700; }
.matrix-table td.cell-tn { background: #f8fafc; color: #475569; }

.matrix-table .marginal {
  background: #f8fafc;
  font-weight: 700;
  color: #1e293b;
}

/* Base Rate Fallacy Callout */
.fallacy-callout {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 0 10px 10px 0;
  padding: 1.25rem 1.5rem;
  margin-top: 1.75rem;
  font-size: 0.9rem;
  color: #92400e;
  line-height: 1.5;
}

.fallacy-callout strong {
  color: #78350f;
  font-size: 0.95rem;
}

/* Sliders Grid */
.bayes-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.bayes-control-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bayes-control-card label {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  justify-content: space-between;
}

.bayes-control-card .slider-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--bv-primary);
  font-family: monospace;
}

.bayes-control-card input[type="range"] {
  width: 100%;
}

.bayes-control-card p {
  margin: 0;
  font-size: 0.775rem;
  color: #64748b;
  line-height: 1.4;
}
