/* ==========================================================================
   CSA AI Value & ROI Studio - Microsoft Fluent 2 & Copilot Aesthetics
   ========================================================================== */

:root {
  --font-sans: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  
  /* Light Theme Palette */
  --bg-app: #f8fafc;
  --header-bg: #ffffff;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-border-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --input-bg: #f8fafc;
  --accent-primary: #0078d4;
  --accent-copilot: #6366f1;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
}

.dark {
  /* Dark Theme Palette (Enterprise Soothing Slate/Navy) */
  --bg-app: #090d16;
  --header-bg: #111726;
  --card-bg: #111726;
  --card-border: #1e293b;
  --card-border-subtle: #172033;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --input-bg: #0b0f19;
  --accent-primary: #38bdf8;
  --accent-copilot: #818cf8;
  --accent-success: #34d399;
  --accent-warning: #fbbf24;
  --accent-danger: #f87171;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

/* Fluent Glassmorphic Surface Cards */
.fluent-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.875rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.fluent-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

/* Copilot Hero Gradient Accent */
.copilot-gradient {
  background: linear-gradient(135deg, #0078d4 0%, #6366f1 50%, #8b5cf6 100%);
}
.copilot-text-gradient {
  background: linear-gradient(135deg, #0078d4 0%, #6366f1 60%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Traffic Light Indicators */
.traffic-pill-excellent {
  background-color: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.traffic-pill-good {
  background-color: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.traffic-pill-expensive {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Inputs & Form Elements */
.fluent-input {
  background-color: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.fluent-input:focus {
  outline: none;
  border-color: var(--accent-copilot);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Navigation Tab Active Pill */
.nav-tab-active {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--accent-copilot);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   TOKENOMICS 201 SUITE SPECIFIC VISUAL COMPONENTS
   ========================================================================== */

/* Task-to-Tier Gauge */
.gauge-track {
  position: relative;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(to right, #84cc16 0%, #84cc16 33%, #2563eb 33%, #2563eb 66%, #0f172a 66%, #0f172a 100%);
  margin: 24px 0 8px 0;
}
.dark .gauge-track {
  background: linear-gradient(to right, #84cc16 0%, #84cc16 33%, #38bdf8 33%, #38bdf8 66%, #ffffff 66%, #ffffff 100%);
}
.gauge-pointer {
  position: absolute;
  top: -14px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 14px solid #6366f1;
  transform: translateX(-50%);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Needle-in-a-Haystack (Lost in the Middle) */
.haystack-container {
  display: flex;
  gap: 2px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0;
  background: rgba(148, 163, 184, 0.15);
}
.haystack-seg {
  flex: 1;
  background: rgba(148, 163, 184, 0.25);
  transition: background-color 0.2s ease;
}
.haystack-seg.needle {
  background: #10b981;
  position: relative;
}
.haystack-seg.needle::after {
  content: "📍";
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
}

/* Accuracy Progress Bar */
.accuracy-meter-track {
  height: 32px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
  margin: 8px 0;
}
.accuracy-meter-fill {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 12px;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

/* Digital Odometer Glow (Lab 10 Agent Runaway Meter) */
.odometer-box {
  background: #060b13;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.odometer-digits {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 800;
  color: #4ade80;
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(74, 222, 128, 0.45);
}
.odometer-digits.capped {
  color: #facc15;
  text-shadow: 0 0 16px rgba(250, 204, 21, 0.45);
}

/* Agent Terminal Log Stream */
.agent-terminal-stream {
  background: #060b13;
  color: #86efac;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  height: 160px;
  overflow-y: auto;
  line-height: 1.6;
}
.step-plan { color: #38bdf8; }
.step-tool { color: #facc15; }
.step-reason { color: #f472b6; }
.step-compact { color: #a855f7; font-weight: bold; }

/* Code Snippet Box */
.code-panel {
  background: #060b13;
  color: #e2e8f0;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
}

/* Print Friendly Overrides */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  header, #csa-advisor-fab, #csa-advisor-drawer, .app-nav-btn {
    display: none !important;
  }
  .fluent-card {
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
  }
}
