:root {
    --bg-1: #030a16;
    --bg-2: #05142c;
    --glass-bg: rgba(6, 18, 38, 0.65);
    --glass-border: rgba(0, 240, 255, 0.15);
    --neon-cyan: #00f0ff;
    --neon-green: #39ff14;
    --neon-orange: #ff9f00;
    --neon-red: #ff3b30;
    --muted-cyan: rgba(0, 240, 255, 0.5);
    --muted-white: rgba(220, 235, 255, 0.85);
    --card-glow: 0 8px 32px rgba(0, 240, 255, 0.05);
    --font-hud: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', system-ui, sans-serif;
}

/* ==========================================
   ANIMACIONES FUTURISTAS (NUEVAS)
   ========================================== */

/* Escaneo Láser Vertical Constante (Fondo) */
@keyframes gridScan {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 0 100%, 0 0;
    }
}

/* Línea de escaneo láser flotante */
@keyframes laserLineScan {
    0% {
        top: -10%;
        opacity: 0;
    }

    5% {
        opacity: 0.5;
    }

    95% {
        opacity: 0.5;
    }

    100% {
        top: 110%;
        opacity: 0;
    }
}

/* Pulsación rítmica del corazón para las tarjetas */
@keyframes heartBeatGlow {

    0%,
    100% {
        box-shadow: var(--card-glow);
        border-color: var(--glass-border);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
        border-color: rgba(0, 240, 255, 0.4);
    }
}

/* Micro-glitch al pasar el mouse por los botones */
@keyframes glitchHover {
    0% {
        transform: translate(0);
        text-shadow: 0 0 5px var(--neon-cyan);
    }

    20% {
        transform: translate(-2px, 2px);
        text-shadow: 2px 0 var(--neon-red), -2px 0 var(--neon-cyan);
    }

    40% {
        transform: translate(2px, -2px);
        text-shadow: -2px 0 var(--neon-red), 2px 0 var(--neon-cyan);
    }

    60% {
        transform: translate(-1px, 1px);
    }

    80% {
        transform: translate(1px, -1px);
    }

    100% {
        transform: translate(0);
        text-shadow: 0 0 15px var(--neon-cyan);
    }
}

/* ==========================================
   ESTILOS ORIGINALES CONSTRUIDOS
   ========================================== */

/* Reset y Base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-1);
    background-image:
        radial-gradient(circle at 50% 20%, rgba(0, 240, 255, 0.08), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(57, 255, 20, 0.04), transparent 40%),
        linear-gradient(180deg, var(--bg-1), var(--bg-2));
    color: var(--muted-white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: 60px;
    position: relative;
    /* Agregado para la línea láser */
}

/* NUEVO: Línea Láser de Escaneo Vertical */
body::after {
    content: "";
    position: fixed;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    box-shadow: 0 0 15px var(--neon-cyan), 0 0 30px var(--neon-cyan);
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    animation: laserLineScan 8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Grid tecnológico de fondo */
.hud-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(0, 240, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
    opacity: 0.8;
    pointer-events: none;
    /* ANIMACIÓN AÑADIDA AQUÍ */
    animation: gridScan 90s linear infinite;
}

/* Cuerpo humano y círculos HUD de fondo interactivos (SVG incrustado) */
.hud-bg-shapes {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 900px;
    height: 80%;
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Estilización de tarjetas cristal (Glassmorphism con glow fino) */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-radius: 14px;
    box-shadow: var(--card-glow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* ANIMACIÓN AÑADIDA AQUÍ */
    animation: heartBeatGlow 6s ease-in-out infinite;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.7;
}

/* Cabecera y Títulos */
.app-title {
    font-family: var(--font-hud);
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.subtitle-hud {
    font-family: var(--font-hud);
    font-size: 0.75rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.section-title {
    font-family: var(--font-hud);
    color: #ffffff;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Elementos de Formulario Estilo HUD */
.form-label-hud {
    font-family: var(--font-hud);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-select-hud,
.form-control-hud {
    background: rgba(3, 13, 30, 0.75);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: #ffffff !important;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-family: var(--font-hud);
    transition: all 0.25s ease;
}

.form-select-hud:focus,
.form-control-hud:focus {
    background: rgba(4, 20, 45, 0.9);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
    outline: none;
}

/* Deshabilitados y de solo lectura */
.form-control-hud[readonly] {
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan) !important;
    font-weight: 700;
}

/* Opciones de Selector transparentes */
.form-select-hud option {
    background: #061122;
    color: #ffffff;
}

/* Botones de acción futuristas */
.btn-neon-cyan {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-hud);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 18px;
    border-radius: 6px;
    transition: all 0.25s ease;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
}

.btn-neon-cyan:hover {
    background: var(--neon-cyan);
    color: #000000;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.4);
    transform: translateY(-1px);
    /* ANIMACIÓN AÑADIDA AQUÍ */
    animation: glitchHover 0.3s ease-in-out;
}

.btn-neon-cyan:active {
    transform: translateY(1px);
}

.btn-outline-hud {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: var(--font-hud);
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 9px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-outline-hud:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    /* ANIMACIÓN AÑADIDA AQUÍ */
    animation: glitchHover 0.3s ease-in-out;
}

.dropdown.position-fixed .dropdown-toggle {
    min-width: 140px;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    body {
        padding-top: 4.5rem;
    }

    .dropdown.position-fixed {
        top: 0.5rem !important;
        right: 0.5rem !important;
        margin: 0 !important;
    }

    .dropdown.position-fixed .dropdown-toggle {
        max-width: 140px;
        padding: 8px 12px;
    }

    .badge-status-hud {
        position: fixed;
        top: 0.5rem;
        left: 0.5rem;
        z-index: 10000;
        width: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }
}

.btn-danger-hud {
    background: rgba(255, 59, 48, 0.05);
    border: 1px solid rgba(255, 59, 48, 0.4);
    color: #ff9f99;
    font-family: var(--font-hud);
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 9px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-danger-hud:hover {
    background: var(--neon-red);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.35);
    /* ANIMACIÓN AÑADIDA AQUÍ */
    animation: glitchHover 0.3s ease-in-out;
}

/* Botón Sólido de Continuación (Cian Brillante) */
.btn-solid-cyan {
    background: var(--neon-cyan);
    border: none;
    color: #030a16;
    font-family: var(--font-hud);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.btn-solid-cyan:hover {
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.6);
    transform: scale(1.02);
    color: #000;
    /* ANIMACIÓN AÑADIDA AQUÍ */
    animation: glitchHover 0.3s ease-in-out;
}

/* Panel del Score (Puntuación Fases) */
.score-widget-title {
    font-family: var(--font-hud);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.score-huge-number {
    font-family: var(--font-hud);
    font-size: 5.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--neon-green);
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* El botón de riesgo gigante */
.risk-status-pill {
    background-color: rgba(57, 255, 20, 0.15);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    font-family: var(--font-hud);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
    display: block;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.1);
    transition: all 0.3s ease;
}

/* Variaciones de Estado de Riesgo */
.risk-low {
    background-color: rgba(57, 255, 20, 0.15) !important;
    border-color: var(--neon-green) !important;
    color: var(--neon-green) !important;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.2) !important;
}

.risk-medium {
    background-color: rgba(255, 159, 0, 0.15) !important;
    border-color: var(--neon-orange) !important;
    color: var(--neon-orange) !important;
    box-shadow: 0 0 15px rgba(255, 159, 0, 0.2) !important;
}

.risk-high {
    background-color: rgba(255, 59, 48, 0.15) !important;
    border-color: var(--neon-red) !important;
    color: var(--neon-red) !important;
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.2) !important;
}

/* Barra de Progreso HUD */
.progress-hud {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 240, 255, 0.1);
}

.progress-bar-hud {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

/* Líneas decorativas HUD y pequeños detalles adicionales */
.badge-status-hud {
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
    font-family: var(--font-hud);
    padding: 3px 8px;
}

/* Alertas de recomendaciones en el panel lateral */
#scoreDescription {
    background: rgba(0, 240, 255, 0.03);
    border-left: 4px solid var(--neon-green);
    padding: 12px;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.95);
    transition: all 0.3s ease;
}

/* Modales Cyber de confirmación modernos */
.cyber-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cyber-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.cyber-modal {
    max-width: 400px;
    width: 90%;
    background: rgba(5, 16, 35, 0.95);
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.25);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cyber-modal-overlay.active .cyber-modal {
    transform: scale(1);
}

/* Frecuencia de latidos del paciente / animaciones */
@keyframes pulse-cyan {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--neon-cyan);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--neon-cyan);
    animation: pulse-cyan 1.5s infinite;
}

/* Estilización de Inputs tipo "Relleno" */
.input-group-text-hud {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: var(--neon-cyan);
    font-family: var(--font-hud);
    font-size: 0.8rem;
}

/* Estilo para los divisores */
.hud-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.25), transparent);
    border: none;
    margin: 20px 0;
}

/* Alerta de validación para campos vacíos */
.form-control-hud.is-invalid,
.form-select-hud.is-invalid {
    border-color: var(--neon-red) !important;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.4) !important;
}

/* ==========================================
   TRANSICIONES DE PÁGINA (ESTILO POWERPOINT)
   ========================================== */

body {
    animation: slideInPage 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes slideInPage {
    0% {
        opacity: 0;
        transform: scale(0.97) translateY(15px);
    }

    100% {
        opacity: 1;
        transform: none;
    }
}

.fade-out-page {
    animation: fadeOutPage 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards !important;
}

@keyframes fadeOutPage {
    0% {
        opacity: 1;
        transform: none;
    }

    100% {
        opacity: 0;
        transform: scale(0.97) translateY(-15px);
    }
}

/* ==========================================
   MENÚ DE NAVEGACIÓN GLOBAL FLOTANTE
   ========================================== */
.dropdown-menu.glass-card {
    background: rgba(3, 10, 22, 0.95) !important;
    border: 1px solid var(--neon-cyan) !important;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.dropdown-item.hud-item {
    transition: all 0.2s ease;
    border-radius: 4px;
}

.dropdown-item.hud-item:hover {
    background: rgba(0, 240, 255, 0.1);
    color: var(--neon-cyan) !important;
    transform: translateX(5px);
}