/* ==========================================================================
   Bayes-Estimation: Design System & Theming Tokens
   Glassmorphic dark/light design system with clinical precision aesthetics.
   ========================================================================== */

:root {
  /* Light Theme Tokens */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-subtle: rgba(2, 132, 199, 0.10);
  --primary-border: rgba(2, 132, 199, 0.25);

  --accent: #8b5cf6;
  --accent-subtle: rgba(139, 92, 246, 0.10);

  /* Calculation Dialogues: Light Green Theme */
  --calc-bg: #ecfdf5;
  --calc-bg-card: #f0fdf4;
  --calc-border: #a7f3d0;
  --calc-input-bg: #ffffff;
  --calc-header: #065f46;

  /* Estimation Statistics: Light Sky Blue Theme */
  --stats-bg: #f0f9ff;
  --stats-bg-card: #f0f9ff;
  --stats-border: #bae6fd;
  --stats-input-bg: #ffffff;
  --stats-header: #0369a1;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --equivalent: #06b6d4;
  --equivalent-bg: rgba(6, 182, 212, 0.12);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 4px 8px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-primary: #070b12;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-subtle: #131d33;
  --border-subtle: #1e293b;
  --border-strong: #334155;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-subtle: rgba(56, 189, 248, 0.12);
  --primary-border: rgba(56, 189, 248, 0.30);

  --accent: #a78bfa;
  --accent-subtle: rgba(167, 139, 250, 0.12);

  /* Calculation Dialogues: Deep Emerald Green Tint in Dark Mode */
  --calc-bg: #071e16;
  --calc-bg-card: #09281e;
  --calc-border: rgba(52, 211, 153, 0.28);
  --calc-input-bg: #0d3528;
  --calc-header: #6ee7b7;

  /* Estimation Statistics: Deep Sky Blue Tint in Dark Mode */
  --stats-bg: #081d30;
  --stats-bg-card: #0b253e;
  --stats-border: rgba(56, 189, 248, 0.28);
  --stats-input-bg: #0e3050;
  --stats-header: #7dd3fc;

  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.15);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.15);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.15);
  --equivalent: #22d3ee;
  --equivalent-bg: rgba(34, 211, 238, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px -1px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 14px 32px -4px rgba(0, 0, 0, 0.6), 0 6px 12px -2px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
