/* -*- coding: utf-8 -*- */
/* TLGOS Analyst V5 — Estilos globales (Glass Aurora)
 * Tipografías: Space Grotesk (títulos) + Inter (texto).
 * Estilo oficial: Glass Aurora — fondo oscuro profundo + auroras animadas
 * + glass cards + paleta extendida (azul · cian · violeta · rosa).
 */

:root {
    /* === Tipografías === */
    --font-titulo: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-texto:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* === Fondos (tema oscuro profundo) === */
    --bg-deep:        #060914;    /* fondo base de la app */
    --bg-base:        #0B0F1F;    /* segunda capa */
    --bg-elev:        #111A2E;    /* superficies elevadas no-glass */
    --bg-input:       rgba(255, 255, 255, 0.04);
    --bg-input-hover: rgba(255, 255, 255, 0.07);

    /* === Glass === */
    --glass:          rgba(255, 255, 255, 0.045);
    --glass-strong:   rgba(255, 255, 255, 0.08);
    --glass-hover:    rgba(255, 255, 255, 0.07);
    --border:         rgba(255, 255, 255, 0.10);
    --border-strong:  rgba(255, 255, 255, 0.16);
    --border-soft:    rgba(255, 255, 255, 0.06);

    /* === Texto === */
    --text-strong:    #F1F5F9;
    --text-base:      #CBD5E1;
    --text-muted:     #94A3B8;
    --text-faded:     #64748B;

    /* === Paleta corporativa extendida (4 acentos autorizados) === */
    --c-blue:         #6366F1;    /* indigo principal */
    --c-blue-hover:   #4F46E5;
    --c-blue-soft:    rgba(99, 102, 241, 0.18);
    --c-cyan:         #22D3EE;    /* acento principal · validación OK · live */
    --c-cyan-hover:   #06B6D4;
    --c-cyan-soft:    rgba(34, 211, 238, 0.18);
    --c-violet:       #A78BFA;    /* acento secundario · categorías */
    --c-violet-soft:  rgba(167, 139, 250, 0.18);
    --c-pink:         #F472B6;    /* acento decoración premium */
    --c-pink-soft:    rgba(244, 114, 182, 0.18);

    /* alias retrocompatibles (no usar en código nuevo) */
    --primary:        var(--c-blue);
    --primary-hover:  var(--c-blue-hover);
    --primary-soft:   var(--c-blue-soft);
    --accent:         var(--c-cyan);
    --accent-soft:    var(--c-cyan-soft);

    /* === Errores funcionales (uso restringido) === */
    --danger:         #F87171;
    --danger-soft:    rgba(248, 113, 113, 0.10);

    /* === Gradientes habituales === */
    --grad-primary:   linear-gradient(135deg, var(--c-blue), var(--c-cyan));
    --grad-aurora:    linear-gradient(120deg, var(--c-blue), var(--c-cyan), var(--c-violet));
    --grad-brand:     linear-gradient(120deg, #fff, var(--c-cyan));

    /* === Radios, sombras, transiciones === */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --shadow-md:    0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg:    0 25px 60px rgba(0, 0, 0, 0.45);
    --shadow-glow:  0 8px 30px -8px rgba(99, 102, 241, 0.55);
    --shadow-cyan:  0 0 12px rgba(34, 211, 238, 0.55);

    --t-fast: 0.15s ease;
    --t-base: 0.25s cubic-bezier(.2, .7, .2, 1);
    --t-slow: 0.45s cubic-bezier(.2, .7, .2, 1);
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-texto);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-base);
    background: var(--bg-deep);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-titulo);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-strong);
}

a {
    color: var(--c-cyan);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--c-blue); }

button { font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

.hidden { display: none !important; }

/* === Aurora background ===
 * Compartido por todas las páginas. Se monta con _bg_aurora.html (3 blobs).
 * Mantiene un grid fino encima para textura.
 */
.aurora {
    position: fixed; inset: 0; z-index: 0;
    overflow: hidden; pointer-events: none;
}
.aurora::before,
.aurora::after,
.aurora > .blob {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    animation: aurora-float 22s ease-in-out infinite;
    will-change: transform;
}
.aurora::before {
    width: 620px; height: 620px;
    top: -140px; left: -120px;
    background: radial-gradient(circle, var(--c-blue), transparent 70%);
}
.aurora::after {
    width: 700px; height: 700px;
    bottom: -180px; right: -160px;
    background: radial-gradient(circle, var(--c-cyan), transparent 70%);
    animation-delay: -8s;
}
.aurora > .blob {
    width: 520px; height: 520px;
    top: 30%; left: 45%;
    background: radial-gradient(circle, var(--c-violet), transparent 70%);
    animation-delay: -14s;
    opacity: 0.35;
}
@keyframes aurora-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(60px, -40px) scale(1.08); }
    66%      { transform: translate(-40px, 50px) scale(0.94); }
}

/* Variante atenuada para zonas de trabajo (paneles).
 * Mismos blobs pero mucho más difusos y bajos en opacidad para no
 * competir con el contenido. La sensación de "fondo vivo" se mantiene
 * pero sin distraer la lectura. */
.aurora--soft { opacity: 0.55; }
.aurora--soft::before,
.aurora--soft::after,
.aurora--soft > .blob {
    filter: blur(130px);
    animation-duration: 32s;
}
.aurora--soft::before { opacity: 0.30; }
.aurora--soft::after  { opacity: 0.30; }
.aurora--soft > .blob { opacity: 0.18; }

/* Grid sutil encima del fondo. Aplicar la clase `.aurora-grid` al body o a un contenedor. */
.aurora-grid::before {
    content: '';
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse at center, black, transparent 80%);
            mask-image: radial-gradient(ellipse at center, black, transparent 80%);
}

/* Canvas global de red neuronal interactiva — se monta con _bg_network.html
 * y se anima con network-bg.js. Se coloca ENCIMA de la aurora pero DEBAJO
 * de cualquier card o contenido (z-index 1). */
.bg-network {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 1;
    pointer-events: none;
}

/* prefers-reduced-motion: detener animaciones de aurora */
@media (prefers-reduced-motion: reduce) {
    .aurora::before, .aurora::after, .aurora > .blob { animation: none; }
}

/* === Utilidades glass === */
.glass {
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
}
.glass-strong {
    background: var(--glass-strong);
    border: 1px solid var(--border-strong);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--radius-lg);
}

/* === Botones globales === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-texto);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: 0;
    text-decoration: none;
    transition: transform var(--t-fast), box-shadow var(--t-base), background var(--t-fast);
    line-height: 1;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 36px -8px rgba(99, 102, 241, 0.7); }

.btn-ghost {
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: var(--glass-hover); border-color: var(--border-strong); }

.btn-danger {
    background: var(--danger-soft);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.18); }

/* === Live pulse (indicador "en directo") === */
.live-pulse {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--c-cyan);
    letter-spacing: 0.04em;
    font-weight: 500;
}
.live-pulse::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--c-cyan);
    box-shadow: var(--shadow-cyan);
    animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

/* === Chips / badges === */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--text-base);
    background: var(--glass);
}
.chip.active { background: var(--glass-strong); border-color: var(--border-strong); color: #fff; }
.chip.cyan   { color: var(--c-cyan);   border-color: var(--c-cyan-soft);   background: var(--c-cyan-soft); }
.chip.blue   { color: #C7D2FE;          border-color: var(--c-blue-soft);   background: var(--c-blue-soft); }
.chip.violet { color: #DDD6FE;          border-color: var(--c-violet-soft); background: var(--c-violet-soft); }
.chip.pink   { color: #FBCFE8;          border-color: var(--c-pink-soft);   background: var(--c-pink-soft); }

/* === Texto con gradiente (brand-name) === */
.brand-name {
    background: var(--grad-aurora);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    font-family: var(--font-titulo);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* === Scrollbar moderna === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
