/* ──────────────────────────────────────────────────────────────────────────
   Tema compartido (oscuro por defecto + claro).
   Los colores viven como variables CSS para poder cambiar de tema con el
   atributo data-theme en <html>. Las variables -rgb guardan los canales
   (R G B) para que Tailwind pueda aplicar opacidad (ej. bg-primary/40) con el
   patrón rgb(var(--x-rgb) / <alpha-value>) en el tailwind.config de cada página.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  /* Oscuro (default, el de siempre) */
  --primary-rgb: 180 197 255;
  --primary-container-rgb: 37 99 235;
  --secondary-rgb: 173 198 255;
  --secondary-container-rgb: 5 102 217;
  --tertiary-rgb: 255 181 150;
  --surface-rgb: 5 20 36;
  --surface-container-rgb: 18 33 49;
  --surface-container-high-rgb: 26 47 66;
  --on-surface-rgb: 212 228 250;
  --on-surface-variant-rgb: 195 198 215;
  --outline-rgb: 141 144 160;
  --outline-variant-rgb: 67 70 85;
  --error-rgb: 255 180 171;

  --glass-bg: rgba(18, 33, 49, 0.7);
  --glass-border: rgba(67, 70, 85, 0.4);
  --glow: rgba(180, 197, 255, 0.15);
  --nav-hover: rgba(180, 197, 255, 0.08);
  --nav-active-bg: rgba(37, 99, 235, 0.25);
  --nav-active-fg: #b4c5ff;

  color-scheme: dark;
}

:root[data-theme="light"] {
  /* Claro */
  --primary-rgb: 27 71 180;
  --primary-container-rgb: 220 228 255;
  --secondary-rgb: 74 85 120;
  --secondary-container-rgb: 216 226 255;
  --tertiary-rgb: 138 78 46;
  --surface-rgb: 247 249 252;
  --surface-container-rgb: 238 241 248;
  --surface-container-high-rgb: 228 233 243;
  --on-surface-rgb: 26 28 34;
  --on-surface-variant-rgb: 68 71 79;
  --outline-rgb: 116 119 127;
  --outline-variant-rgb: 196 198 208;
  --error-rgb: 186 26 26;

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glow: rgba(27, 71, 180, 0.1);
  --nav-hover: rgba(27, 71, 180, 0.06);
  --nav-active-bg: rgba(27, 71, 180, 0.12);
  --nav-active-fg: #1b47b4;

  color-scheme: light;
}

body {
  background-color: rgb(var(--surface-rgb));
  color: rgb(var(--on-surface-rgb));
  font-family: "Inter", sans-serif;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}
.glow-primary { box-shadow: 0 0 20px var(--glow); }

.nav-item { transition: all 0.2s ease; }
.nav-item:hover { background: var(--nav-hover); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-fg); }

.mat-icon { font-family: "Material Symbols Outlined"; font-size: 20px; line-height: 1; user-select: none; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 1s linear infinite; }

@keyframes fade-in-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fade-in-up 0.5s ease forwards; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
}
