:root {
  /* Dark Mode (Default) */
  --bg-color: #0F172A; /* Slate 900 */
  --surface-color: rgba(30, 41, 59, 0.7); /* Slate 800 */
  --surface-border: rgba(99, 102, 241, 0.2);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  
  --primary: #6366F1; /* Indigo 500 */
  --primary-hover: #4F46E5;
  --secondary: #8B5CF6; /* Violet 500 */
  --accent: #22D3EE; /* Cyan 400 */
  
  --input-bg: rgba(15, 23, 42, 0.8);
  --input-border: rgba(99, 102, 241, 0.3);
  --hover-bg: rgba(99, 102, 241, 0.1);
  
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.light-mode {
  --bg-color: #F1F5F9; /* Slate 100 */
  --surface-color: rgba(255, 255, 255, 0.85);
  --surface-border: rgba(99, 102, 241, 0.2);
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-border: rgba(99, 102, 241, 0.25);
  --hover-bg: rgba(99, 102, 241, 0.08);
  
  --shadow: 0 8px 25px rgba(99, 102, 241, 0.08);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color var(--transition), color var(--transition);
}

.hidden { display: none !important; }
.mt-md { margin-top: 1rem; }
.mt-xl { margin-top: 2rem; }
.text-right { text-align: right; }
.full-width { width: 100%; }

/* Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
  gap: 1.5rem;
}

.main-content {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  flex: 1;
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* Glass Panels */
.glass-panel {
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.last-updated {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--hover-bg);
  color: var(--primary);
}

/* Sidebar Controls */
.controls-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.control-card {
  padding: 1.5rem;
}

.control-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-with-select {
  display: flex;
  gap: 0.5rem;
}

.text-input, .select-input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.text-input {
  flex: 1;
  width: 100%;
}

.select-input {
  cursor: pointer;
}

.text-input:focus, .select-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Sliders */
.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--input-bg);
  border-radius: 3px;
  outline: none;
  opacity: 0.8;
  transition: opacity 0.2s;
  border: 1px solid var(--input-border);
}

.slider-input:hover {
  opacity: 1;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 5px rgba(99, 102, 241, 0.6);
  transition: transform 0.1s;
}

.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Pill Toggle */
.pill-toggle {
  display: inline-flex;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 999px;
  padding: 0.25rem;
  width: 100%;
}

.pill-toggle input[type="radio"] {
  display: none;
}

.pill-toggle label {
  flex: 1;
  text-align: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0; /* Override generic label */
}

.pill-toggle input[type="radio"]:checked + label {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Main Display Area */
.results-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0; /* Prevent flex overflow */
}

.chart-container {
  padding: 1.5rem;
  height: 350px;
  position: relative;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.summary-card {
  padding: 1.25rem;
  border-radius: 10px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(8px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.summary-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.1);
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--primary);
}

.summary-card h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.summary-card .provider {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.summary-card .cost {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.summary-card .details {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* Data Table */
.table-container {
  padding: 1rem;
  overflow-x: auto;
}

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

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

.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.data-table tr:hover td {
  background: var(--hover-bg);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

.badge.anthropic { background: rgba(239, 68, 68, 0.15); color: #EF4444; }
.badge.openai { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.badge.google { background: rgba(59, 130, 246, 0.15); color: #3B82F6; }
.badge.meta { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }
.badge.mistral { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }

.price-highlight {
  font-family: 'JetBrains Mono', monospace, sans-serif;
  font-weight: 600;
  color: var(--text-primary);
}
