/* Import modern premium typography */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Tokens - Glassmorphic Theme */
  --bg-dark: #0b0f19;
  --bg-dark-card: rgba(17, 24, 39, 0.7);
  --border-light: rgba(255, 255, 255, 0.08);
  
  --primary: #6366f1; /* Vibrant Indigo */
  --primary-glow: rgba(99, 102, 241, 0.15);
  --secondary: #a855f7; /* Royal Purple */
  
  /* Indicators */
  --color-success: #10b981; /* Emerald */
  --color-warning: #f59e0b; /* Amber */
  --color-danger: #ef4444; /* Crimson */
  --color-info: #0ea5e9; /* Light Blue */
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Light Theme Variables overrides */
.light-mode {
  --bg-dark: #f8fafc;
  --bg-dark-card: rgba(255, 255, 255, 0.85);
  --border-light: rgba(15, 23, 42, 0.08);
  
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.08);
  --secondary: #9333ea;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: var(--transition-smooth);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Core Dashboard Layout Grid */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-dark-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-title);
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-title h1 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-title p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Glass Tabs & Buttons */
.tab-group {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  background: var(--border-light);
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

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

/* Side Panel Layout */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--bg-dark-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: var(--transition-smooth);
}

.card:hover {
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.05);
}

.card-title {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Preset Picker Options */
.preset-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  margin-bottom: 10px;
  transition: var(--transition-smooth);
}

.preset-option:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.preset-option.active {
  border-color: var(--primary);
  background: var(--primary-glow);
  box-shadow: inset 0 0 8px var(--primary-glow);
}

.preset-name {
  font-weight: 600;
  font-size: 14px;
}

.preset-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Consent Management Lists */
.consent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.consent-item:last-child {
  border-bottom: none;
}

.consent-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.consent-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
}

.consent-name {
  font-size: 13px;
  font-weight: 500;
}

/* Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-success);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* Main Dashboard Panel */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Financial Health Card Layout */
.financial-health-card-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .financial-health-card-container {
    grid-template-columns: 1fr;
  }
}

/* Futuristic Physical-looking Credit Health Card */
.health-card {
  height: 220px;
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}

/* Premium Card glowing effect */
.health-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 60%);
  pointer-events: none;
  animation: rotateGlow 15s linear infinite;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 1;
}

.chip {
  width: 38px;
  height: 28px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 4px;
  position: relative;
}

.chip::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 6px;
  width: 26px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.score-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.6);
}

.score-value {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-middle {
  z-index: 1;
}

.msme-tag {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.msme-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 1;
}

.card-number {
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
}

.tier-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Radar Chart Card Container */
.health-overview-chart {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Key Metrics Grid */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.metric-pill {
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-pill-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.metric-pill-val {
  font-size: 20px;
  font-family: var(--font-title);
  font-weight: 700;
}

.metric-pill-desc {
  font-size: 10px;
  color: var(--text-muted);
}

/* Insight Cards and Risks lists */
.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.insight-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-item {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.insight-item::before {
  content: "•";
  font-weight: bold;
  font-size: 16px;
  margin-top: -3px;
}

.insight-item.positive {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}
.light-mode .insight-item.positive {
  color: #065f46;
}

.insight-item.negative {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.light-mode .insight-item.negative {
  color: #991b1b;
}

.insight-item.recommendation {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}
.light-mode .insight-item.recommendation {
  color: #3730a3;
}

/* Interactive Simulator Forms */
.simulator-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .simulator-form {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-control-range {
  width: 100%;
  accent-color: var(--primary);
  height: 6px;
  border-radius: 4px;
  cursor: pointer;
}

.range-val-lbl {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: bold;
  align-self: flex-end;
  margin-top: -4px;
}

.form-control-select, .form-control-text {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition-smooth);
}

.form-control-select:focus, .form-control-text:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ULI/OCEN Pipeline Visualizer */
.ocen-pipeline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin: 32px 0 16px 0;
  padding: 0 16px;
}

@media (max-width: 768px) {
  .ocen-pipeline {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
  }
  .ocen-pipeline::after {
    display: none;
  }
}

.ocen-pipeline::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 48px;
  right: 48px;
  height: 2px;
  background: var(--border-light);
  z-index: 0;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
  width: 100px;
  text-align: center;
  cursor: pointer;
}

.step-node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-title);
  font-size: 14px;
  transition: var(--transition-smooth);
  color: var(--text-muted);
}

.pipeline-step.active .step-node {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 16px var(--primary-glow);
}

.pipeline-step.completed .step-node {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pipeline-step.active .step-label {
  color: var(--text-primary);
}

.pipeline-step.completed .step-label {
  color: var(--color-success);
}

.ocen-console {
  background: #050811;
  border-radius: 8px;
  padding: 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: var(--color-success);
  min-height: 120px;
  border: 1px solid var(--border-light);
  overflow-y: auto;
  max-height: 200px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ocen-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: var(--border-light);
}

/* Trend Charts Row */
.chart-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .chart-card-row {
    grid-template-columns: 1fr;
  }
}

.chart-wrapper {
  position: relative;
  height: 240px;
  width: 100%;
}

/* Hidden view helper */
.hidden {
  display: none !important;
}

/* Animations helper */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.pulse-animation {
  animation: pulse 2s infinite ease-in-out;
}
