:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(24, 32, 50, 0.85);
  --bg-input: rgba(13, 17, 28, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --success-glow: rgba(16, 185, 129, 0.25);
  --danger-glow: rgba(244, 63, 94, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding: 2rem 1rem;
  line-height: 1.5;
}

/* Background Ambient Glows */
.background-glows {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.22;
  transition: all 1s ease;
}

.orb-1 {
  top: -10%;
  left: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-indigo), transparent 70%);
}

.orb-2 {
  bottom: 10%;
  right: 10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
}

.orb-3 {
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-purple), transparent 70%);
  opacity: 0.15;
}

/* Container */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Header */
.app-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #a5b4fc;
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-indigo);
  box-shadow: 0 0 10px var(--accent-indigo);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.main-title {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 70%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  max-width: 760px;
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.subtitle strong {
  color: #e2e8f0;
}

/* Presets Bar */
.presets-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.presets-grid {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  flex: 1;
}

.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.preset-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

.preset-icon {
  font-size: 0.95rem;
}

/* Main Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.75rem;
}

@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Panel Design */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #f1f5f9;
}

.panel-title .icon {
  width: 20px;
  height: 20px;
  color: var(--accent-indigo);
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-tag.live-tag {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* Form Styles */
.prediction-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

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

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}

.val-display {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.input-range-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.slider-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-indigo);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
  border: 2px solid #fff;
  transition: transform 0.15s;
}

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

.number-input, .select-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 0.5rem 0.75rem;
  width: 90px;
  text-align: right;
  outline: none;
  transition: all 0.2s;
}

.number-input.full-width {
  width: 100%;
  text-align: center;
  font-size: 1rem;
}

.number-input.currency-input {
  width: 110px;
}

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

.select-input {
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  cursor: pointer;
}

.select-input option {
  background-color: #0f172a;
  color: #f8fafc;
}

/* Stepper Wrap */
.stepper-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.step-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-indigo);
}

/* Toggle Group */
.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.toggle-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.toggle-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-indigo);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* Submit Action Button */
.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, var(--accent-indigo), #4f46e5);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.5rem;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  margin-top: 0.5rem;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, #7073ff, #5850ec);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn .btn-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.submit-btn:hover .btn-icon {
  transform: translateX(4px);
}

/* Results Panel Styling */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Hero Decision Card */
.result-hero {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.result-hero.purchase-yes {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 35px var(--success-glow);
}

.result-hero.purchase-no {
  border-color: rgba(244, 63, 94, 0.35);
  box-shadow: 0 0 35px var(--danger-glow);
}

.result-header {
  text-align: center;
}

.result-question {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.purchase-decision-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.purchase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 2.2rem;
  border-radius: 9999px;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: all 0.3s ease;
}

.purchase-yes .purchase-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 2px solid #10b981;
}

.purchase-no .purchase-badge {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 2px solid #f43f5e;
}

.decision-icon {
  font-size: 1.7rem;
  line-height: 1;
}

/* Confidence Meter */
.confidence-container {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.confidence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.confidence-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.confidence-value {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
}

.confidence-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.confidence-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.purchase-yes .confidence-bar-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}

.purchase-no .confidence-bar-fill {
  background: linear-gradient(90deg, #f43f5e, #fb7185);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.8);
}

/* Analytics Cards */
.analytics-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.analytics-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-subtitle {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
}

.subtitle-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Model Voting Rows */
.model-votes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.model-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.model-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.model-name {
  font-weight: 600;
  color: var(--text-secondary);
}

.model-percent {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #f8fafc;
}

.meter-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.meter-bar-fill.ada { background: linear-gradient(90deg, #38bdf8, #0ea5e9); }
.meter-bar-fill.gbdt { background: linear-gradient(90deg, #818cf8, #6366f1); }
.meter-bar-fill.xgb { background: linear-gradient(90deg, #a78bfa, #8b5cf6); }
.meter-bar-fill.lgbm { background: linear-gradient(90deg, #34d399, #10b981); }
.meter-bar-fill.cat { background: linear-gradient(90deg, #f472b6, #ec4899); }

/* Contributions Grid */
.contributions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (max-width: 500px) {
  .contributions-grid {
    grid-template-columns: 1fr;
  }
}

.contrib-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.contrib-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.contrib-impact {
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.contrib-impact.pos {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.contrib-impact.neg {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

/* JSON Output Preview */
.json-card {
  padding: 1rem 1.25rem;
}

.code-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.json-viewer {
  background: rgba(8, 11, 19, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  overflow-x: auto;
  line-height: 1.45;
}

/* Footer */
.app-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 1rem;
}
