/* ========================================
   AI Impact Dashboard — Custom Styles
   ======================================== */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ---- Animations ---- */

/* Fade in from bottom on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > .reveal {
  transition-delay: calc(var(--i, 0) * 100ms);
}

/* LED pulse */
.led-pulse {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---- Indicator Cards ---- */

.indicator-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.indicator-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Status dot colors */
.status-green { background-color: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
.status-yellow { background-color: #eab308; box-shadow: 0 0 8px rgba(234, 179, 8, 0.5); }
.status-red { background-color: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.status-yellow-red {
  background: linear-gradient(135deg, #eab308 40%, #ef4444 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* ---- Scenario Cards ---- */

.scenario-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.scenario-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.scenario-card.color-green  { border-color: rgba(34, 197, 94, 0.3); }
.scenario-card.color-yellow { border-color: rgba(234, 179, 8, 0.3); }
.scenario-card.color-red    { border-color: rgba(239, 68, 68, 0.3); }

.scenario-card.color-green:hover  { border-color: rgba(34, 197, 94, 0.6); }
.scenario-card.color-yellow:hover { border-color: rgba(234, 179, 8, 0.6); }
.scenario-card.color-red:hover    { border-color: rgba(239, 68, 68, 0.6); }

/* Progress bar fills */
.progress-fill-green  { background-color: #22c55e; }
.progress-fill-yellow { background-color: #eab308; }
.progress-fill-red    { background-color: #ef4444; }

/* ---- Trend Arrows ---- */

.trend-up       { color: #ef4444; }
.trend-up-right { color: #f97316; }
.trend-right    { color: #eab308; }
.trend-down-right { color: #84cc16; }
.trend-down     { color: #22c55e; }

/* ---- Timeline ---- */

.timeline-item {
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-dot {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* ---- Nav active link ---- */

.nav-link.active,
.mobile-nav-link.active {
  color: #f8fafc;
}

/* ---- Source Cards ---- */

.source-link {
  transition: color 0.15s ease;
}
.source-link:hover {
  color: #3b82f6;
}

/* ---- Threshold badges ---- */

.threshold-badge {
  font-size: 0.7rem;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}
.threshold-badge-green  { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.threshold-badge-yellow { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.threshold-badge-red    { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ---- Chart Containers ---- */

.chart-container canvas {
  max-width: 100%;
}

.indicator-charts .chart-container {
  background: rgba(15, 23, 42, 0.5);
}

/* ---- Live Chart Loading ---- */

.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #64748b;
  font-size: 0.8rem;
  padding: 1.5rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #1e293b;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Hide spinner once chart is rendered */
.chart-container.loaded .chart-loading {
  display: none;
}

/* Live data indicator dot */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ---- Tabular nums for counters ---- */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}
