/* =====================================================================
   WINOPTIMA — Theme tokens  v2  |  Premium Dark Glassmorphism
   ===================================================================== */

:root {
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.28);
  --shadow:     0 8px 32px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.30);
  --shadow-lg:  0 24px 64px rgba(0,0,0,.65), 0 8px 24px rgba(0,0,0,.40);

  --ease:       cubic-bezier(.16,1,.3,1);
  --dur-fast:   120ms;
  --dur:        200ms;
  --dur-slow:   340ms;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI",
          system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Cascadia Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

/* ─────────────────────────────── DARK ─────────────────────────────── */
.theme-dark {
  /* Backgrounds — negro estático y superficies neutras */
  --bg-base:      #000000;
  --bg-mica:      #000000;
  --bg-surface:   rgba(16, 16, 17, 0.92);
  --bg-surface-2: rgba(22, 22, 24, 0.94);
  --bg-elevated:  #18181a;
  --bg-overlay:   rgba(0, 0, 0, 0.78);
  --bg-hover:     rgba(255,255,255,.05);
  --bg-inset:     rgba(0,0,0,.40);

  /* Borders */
  --border:        rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.16);
  --border-hover:  rgba(255,255,255,.24);
  --divider:       rgba(255,255,255,.06);
  --border-subtle: rgba(255,255,255,.05);

  /* Text */
  --text:       #f5f5f5;
  --text-muted: rgba(245,245,245,.74);
  --text-dim:   rgba(245,245,245,.52);

  /* Accent — monocromo (blanco) */
  --accent:        #f5f5f5;
  --accent-strong: #d4d4d8;
  --accent-soft:   rgba(255,255,255,.10);
  --accent-glow:   rgba(255,255,255,.10);

  /* Neon highlight */
  --neon:          #ffffff;
  --neon-soft:     rgba(255,255,255,.08);

  /* Semantic */
  --good:   #32d474;
  --warn:   #f5a623;
  --danger: #ff5252;
  --info:   #a1a1aa;

  /* Scrollbar */
  --scroll-thumb: rgba(255,255,255,.14);
  --scroll-track: transparent;

  color-scheme: dark;
}

/* ─────────────────────────────── LIGHT ─────────────────────────────── */
.theme-light {
  --bg-base:      #eef1f8;
  --bg-mica:
    radial-gradient(ellipse 80% 50% at 50% -8%, rgba(217,155,0,.07) 0%, transparent 62%),
    linear-gradient(160deg, #ffffff 0%, #eceff8 60%, #e3e8f4 100%);
  --bg-surface:   rgba(255,255,255,.80);
  --bg-surface-2: rgba(244,247,255,.88);
  --bg-elevated:  rgba(255,255,255,.95);
  --bg-overlay:   rgba(238,241,248,.82);
  --bg-hover:     rgba(0,0,0,.035);
  --bg-inset:     rgba(0,0,0,.055);

  --border:        rgba(0,10,35,.08);
  --border-strong: rgba(0,10,35,.15);
  --border-hover:  rgba(0,10,35,.22);
  --divider:       rgba(0,10,35,.05);
  --border-subtle: rgba(0,10,35,.04);

  --text:       #181e30;
  --text-muted: #4e5870;
  --text-dim:   #8a94a8;

  --accent:        #d99b00;
  --accent-strong: #b37c00;
  --accent-soft:   rgba(217,155,0,.10);
  --accent-glow:   rgba(217,155,0,.18);

  --neon:          #e6b800;
  --neon-soft:     rgba(230,184,0,.08);

  --good:   #18a349;
  --warn:   #c47d10;
  --danger: #c42020;
  --info:   #1d62c8;

  --scroll-thumb: rgba(0,0,0,.14);
  --scroll-track: transparent;

  color-scheme: light;
}

/* ─────────────────────────────── COMMON ─────────────────────────────── */
html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  overflow: hidden;
}

body {
  background: var(--bg-mica);
  background-attachment: fixed;
  position: relative;
}
.theme-dark body::before, .theme-dark body::after,
body.theme-dark::before, body.theme-dark::after { display: none; }
body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
}
body::before {
  width: 480px; height: 480px;
  top: -180px; right: -120px;
  background: radial-gradient(circle, rgba(245,245,245,.18), transparent 70%);
}
body::after {
  width: 520px; height: 520px;
  bottom: -200px; left: -160px;
  background: radial-gradient(circle, rgba(212,212,216,.14), transparent 70%);
}
.theme-light body::before { opacity: .25; background: radial-gradient(circle, rgba(217,155,0,.18), transparent 70%); }
.theme-light body::after  { opacity: .2;  background: radial-gradient(circle, rgba(139,92,246,.12), transparent 70%); }

/* Acrylic toggle */
.acrylic-on .acrylic {
  backdrop-filter: blur(16px) saturate(160%) brightness(1.02);
  -webkit-backdrop-filter: blur(16px) saturate(160%) brightness(1.02);
}
.acrylic-off .acrylic {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* Con "Acrílico" desactivado tampoco se aplica el desenfoque fijo del resto de la app */
.acrylic-off *, .acrylic-off *::before, .acrylic-off *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Modo rendimiento (equipo modesto): sin desenfoque ni animaciones aunque
   estén activados en Ajustes. Es lo más caro de pintar al cambiar de sección. */
.perf-lite *, .perf-lite *::before, .perf-lite *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: none !important;
  animation: none !important;
}

/* Modo Lite: fondo sólido y superficies opacas (el navegador no mezcla capas)
   y sin los dos halos desenfocados del fondo. Mismo acento de marca. */
.theme-dark.perf-lite {
  --bg-mica:      #000000;
  --bg-surface:   #101011;
  --bg-surface-2: #161618;
  --bg-elevated:  #1a1a1c;
  --bg-overlay:   rgba(0, 0, 0, 0.86);
}
.theme-light.perf-lite {
  --bg-mica:      #eef1f7;
  --bg-surface:   #ffffff;
  --bg-surface-2: #f5f7fb;
  --bg-elevated:  #ffffff;
}
body.perf-lite::before, body.perf-lite::after { display: none; }
body.perf-lite { background-attachment: scroll; }

/* Animation toggle */
.animations-off *, .animations-off *::before, .animations-off *::after {
  transition: none !important;
  animation: none !important;
}

/* Scrollbar — slim & elegant */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  transition: background .2s;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 50%, var(--scroll-thumb));
}
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-corner { background: transparent; }
