:root {
  --bg-color: #080c14;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-solid: #0f172a;
  --bg-input: #0b1120;
  --border-color: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(56, 189, 248, 0.6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary-color: #38bdf8;
  --primary-hover: #0284c7;
  --primary-glow: rgba(56, 189, 248, 0.3);
  --accent-color: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.25);
  --warning-color: #f59e0b;
  --purple-color: #a855f7;
  --danger-color: #ef4444;
  --radius: 16px;
  --radius-sm: 8px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Light Theme Variables Overrides */
html.light-theme {
  --bg-color: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.88);
  --bg-card-solid: #ffffff;
  --bg-input: #f1f5f9;
  --border-color: rgba(15, 23, 42, 0.12);
  --border-focus: rgba(2, 132, 199, 0.6);
  --text-main: #0f172a;
  --text-muted: #475569;
  --primary-color: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.2);
  --accent-color: #059669;
  --accent-glow: rgba(5, 150, 105, 0.2);
}

html.light-theme .navbar {
  background: rgba(248, 250, 252, 0.92);
}

html.light-theme .theme-toggle-btn {
  background: rgba(15, 23, 42, 0.06);
  border-color: var(--border-color);
  color: var(--text-main);
}

html.light-theme .glow-1 {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
}

html.light-theme .glow-2 {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
}

/* Playground & Terminal Window Mockup */
.terminal-card {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: 1.5rem;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-color);
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.terminal-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-color);
}

.preset-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.preset-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.preset-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #040914;
  font-weight: 600;
  box-shadow: 0 0 12px var(--primary-glow);
}

.cli-options-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.option-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.option-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-glow);
}

.toggle-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Terminal & Extraction Output */
.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  min-height: 320px;
  max-height: 550px;
  overflow-y: auto;
  color: #e2e8f0;
}

.extraction-card-preview {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
}

.extraction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.extraction-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #38bdf8;
}

.category-tag {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #c084fc;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.extraction-summary {
  font-family: var(--font-sans);
  color: #cbd5e1;
  font-size: 0.92rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.entities-section, .metrics-section {
  margin-top: 14px;
}

.section-label-sm {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.entity-badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.entity-pill.org { border-color: rgba(56, 189, 248, 0.4); color: #38bdf8; }
.entity-pill.person { border-color: rgba(16, 185, 129, 0.4); color: #34d399; }
.entity-pill.location { border-color: rgba(245, 158, 11, 0.4); color: #fbbf24; }
.entity-pill.product { border-color: rgba(168, 85, 247, 0.4); color: #c084fc; }

.financial-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 0.82rem;
}

.financial-table th, .financial-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.financial-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.sentiment-meter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.sentiment-positive { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.sentiment-neutral { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.sentiment-negative { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }

.prompt-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border-color);
}

.prompt-symbol {
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}

.prompt-input-wrapper {
  flex: 1;
}

.prompt-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  outline: none;
}

.btn-run-cli {
  background: var(--primary-color);
  color: #040914;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-run-cli:hover {
  background: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 0 14px var(--primary-glow);
}

/* Metrics Display Cards Grid */
.finops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 1.5rem;
}

.finops-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.finops-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.finops-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.finops-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-color);
}

/* Specs Table Card */
.specs-table-card {
  padding: 0;
  overflow-x: auto;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.specs-table th, .specs-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
}

.specs-table th {
  background: rgba(15, 23, 42, 0.6);
  color: var(--primary-color);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
}

.specs-table td code {
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
