/*
    ============================================================================
    HOJA DE ESTILOS PRINCIPAL - AEGIS TECH
    ============================================================================
*/

/* --- 1. VARIABLES GLOBALES & COLORES --- */
:root {
    --bg: #03050a;
    --blue: #2a6df4;
    --green: #00ff88;
    --text: #e1e1e1;
    --mono: 'JetBrains Mono', monospace;
    --accent-line: rgba(42, 109, 244, 0.2);
}

/* --- 2. CONFIGURACIÓN BASE (BODY & FONDO) --- */
body {
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(42, 109, 244, 0.1) 0%, transparent 50%), var(--bg);
    color: var(--text);
    font-family: var(--mono);
    margin: 0;
    overflow-x: hidden;
}

#canvas-cyber {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
    /* Transición suave para cuando termine la carga: Opacidad inmediata, Z-index espera 1.5s */
    transition: opacity 1.5s ease-out, z-index 0s linear 1.5s;
}

/* --- 3. ESTRUCTURA (NAVBAR & FOOTER) --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1rem 2rem;
    background: rgba(3, 5, 10, 0.7);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--accent-line);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-status {
    text-align: right;
    font-size: 0.8rem;
    line-height: 1.4;
}

.nav-link {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    transition: 0.3s;
    padding: 5px 15px;
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--blue);
    border: 1px solid var(--blue);
    text-shadow: 0 0 15px var(--blue);
}

footer {
    padding: 4rem;
    text-align: center;
    border-top: 1px solid var(--accent-line);
    font-size: 0.7rem;
    opacity: 0.6;
    letter-spacing: 2px;
}

.status-online-blink {
    color: var(--green);
    animation: status-glow 1.5s infinite;
}

@keyframes status-glow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* --- 4. COMPONENTES: TARJETAS (CARDS) --- */
.card {
    background: linear-gradient(145deg, rgba(6, 10, 18, 0.4) 0%, rgba(12, 15, 25, 0.6) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 5px solid var(--blue);
    border-top: 2px solid rgba(42, 109, 244, 0.2);
    padding: 3rem;
    margin: 2rem auto;
    max-width: 800px;
    box-shadow: 0 0 50px rgba(42, 109, 244, 0.35), inset 0 0 20px rgba(42, 109, 244, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Animación de entrada: Slide Up */
    animation: slideUpCard 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.card:hover {
    box-shadow: 0 0 70px rgba(42, 109, 244, 0.6);
    transform: translateY(-5px) scale(1.01);
    /* Mantenemos el degradado pero subimos un poco la luz */
    background: linear-gradient(145deg, rgba(15, 20, 35, 0.6) 0%, rgba(20, 25, 45, 0.7) 100%);
    /* ... lo demás igual */
}

/* ANIMACIÓN DE ENTRADA (SLIDE UP) */
@keyframes slideUpCard {
    0% {
        opacity: 0;
        transform: translateY(60px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ESTADO DE CARGA: Ocultar tarjetas mientras existe el preloader (solo index) */
body.is-loading .card {
    opacity: 0;
    animation: none;
}

/* --- 4. TARJETA VIDEO --- */

.card-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 3px solid var(--accent-line);
    padding-bottom: .5rem;
    margin-bottom: 2rem;
    opacity: 0.7;
    font-size: 0.8rem;
}

.project-title {
    font-size: 2.2rem;
    color: #fff;
    margin: 1rem 0;
}

/* --- 5. COMPONENTES: BOTONES & ENLACES --- */
.links-container {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: .5rem 1.5rem;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    border: 1px solid var(--blue);
    border-radius: 4px;
    letter-spacing: 3px;
    background: rgba(42, 109, 244, 0.05);
    color: var(--blue);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: .5rem;
    backdrop-filter: blur(5px);
    overflow: hidden;
}

.btn:hover {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 0 25px var(--blue), 0 0 50px rgba(42, 109, 244, 0.4);
    transform: translateY(-2px);
    text-shadow: 0 0 8px #fff;
}

.btn-primary {
    border-color: var(--blue);
    box-shadow: 0 0 10px rgba(42, 109, 244, 0.2);
}

.btn-secondary {
    border-color: rgba(42, 109, 244, 0.5);
    opacity: 0.8;
}

.btn-secondary:hover {
    opacity: 1;
    border-color: var(--blue);
}

.btn-alert {
    border-color: #ff0000;
    color: #ff0000;
    animation: alertBreathingGlow 0.8s infinite alternate;
    /* Parpadeo rápido de alerta */
}

.btn-alert:hover {
    background: #ff0000;
    color: #fff;
    box-shadow: 0 0 30px #ff0000;
    animation: none;
}

@keyframes alertBreathingGlow {
    0% {
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.3), inset 0 0 5px rgba(255, 0, 0, 0.1);
        border-color: rgba(255, 0, 0, 0.6);
    }

    100% {
        box-shadow: 0 0 25px rgba(255, 0, 0, 0.9), inset 0 0 15px rgba(255, 0, 0, 0.4);
        border-color: #ff0000;
        text-shadow: 0 0 8px #ff0000;
    }
}

/* --- 6. COMPONENTES: VIDEO & MEDIA --- */
.video-frame {
    position: relative;
    top: auto;
    max-width: 900px;
    margin: 1.5rem auto;
    padding: .1rem;
    background: rgba(6, 10, 18, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--blue);
    border-radius: 8px;
    animation: breathingGlow 3s infinite alternate;
    transform: translateY(-5px) scale(1.01);
    transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo-video {
    width: 100%;
    max-width: 900px;
    margin: 0rem auto;
    display: block;
    position: relative;
    top: auto;
    border-radius: .2%;
    overflow: hidden;
}

.scanline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 2;
}

/* ================ SECCIÓN:EFECTO ESLOGAN) ================= */

.slogan-container {
    background-color: #000;
    /* Márgenes negativos para cubrir el padding del padre (.1rem) y tocar el borde */
    margin: 0 -0.1rem -0.1rem -0.1rem;
    padding: 0.5rem 0 1.5rem 0;
    /* Redondear solo abajo para coincidir con el marco (8px) */
    border-radius: 0 0 8px 8px;
    position: relative;
}

.video-slogan {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    /* Espaciado estilo hacker pro */
    color: #2a6df4;
    font-weight: 700;
    margin-top: .1rem;
    font-size: 1.7rem;
    /* Un brillo suave para que resalte en el fondo oscuro */
    text-shadow: 0 0 15px rgba(42, 109, 244, 0.5);
}

.slogan-line {
    width: 50px;
    height: 4px;
    background: #2a6df4;
    margin: 0.5rem auto;
    box-shadow: 0 0 10px #2a6df4;
}


@keyframes breathingGlow {
    0% {
        box-shadow: 0 0 20px rgba(42, 109, 244, 0.3), inset 0 0 10px rgba(42, 109, 244, 0.1);
        border-color: rgba(42, 109, 244, 0.6);
    }

    50% {
        box-shadow: 0 0 50px rgba(42, 109, 244, 0.8), inset 0 0 20px rgba(42, 109, 244, 0.3);
        border-color: var(--blue);
    }

    100% {
        box-shadow: 0 0 20px rgba(42, 109, 244, 0.3), inset 0 0 10px rgba(42, 109, 244, 0.1);
        border-color: rgba(42, 109, 244, 0.6);
    }
}

/* --- 7. COMPONENTES: UI ELEMENTS (BADGES, STATS, MAP) --- */
.grade-a-plus {
    font-size: 1.5rem;
    padding: 0.5rem 1.5rem;
    color: var(--green);
    background: rgba(0, 255, 65, 0.06);
    border: 1px solid var(--green);
    border-radius: 4px;
    text-shadow: 0 0 10px var(--green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 3px;
    margin-top: .5rem;
}

.visitor-stats {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px dashed var(--accent-line);
    font-size: 0.9rem;
}

.glow-text {
    color: var(--blue);
    text-shadow: 0 0 10px var(--blue);
    font-weight: bold;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.feature-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(225, 225, 225, 0.9);
}

.feature-icon {
    margin-right: 12px;
    font-size: 1.2rem;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--blue);
    filter: drop-shadow(0 0 5px var(--blue));
    display: inline-flex;
    animation: pulseIcon 2s infinite ease-in-out;
}

.feature-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.quote-text {
    border-left: 3px solid var(--blue);
    padding-left: 1rem;
    margin-top: 1.5rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(42, 109, 244, 0.05);
    padding: 0.8rem 1rem;
    border-radius: 0 4px 4px 0;
}

@keyframes pulseIcon {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        text-shadow: 0 0 10px var(--blue);
    }
}

.jvectormap-tip {
    background: rgba(3, 5, 10, 0.9) !important;
    border: 1px solid var(--blue) !important;
    color: var(--blue) !important;
    font-family: var(--mono) !important;
    font-size: 0.8rem !important;
    padding: 5px 10px !important;
    box-shadow: 0 0 10px rgba(42, 109, 244, 0.4) !important;
    border-radius: 2px !important;
}

/* --- 8. UTILIDADES & ANIMACIONES GLOBALES --- */
.blink {
    animation: b 1.5s infinite;
    color: var(--blue);
}

@keyframes b {
    50% {
        opacity: 0.3;
    }
}

/* --- 9. RESPONSIVE (MÓVILES) --- */
@media (max-width: 600px) {
    .card {
        padding: 2rem;
        margin: 1.5rem;
    }

    .project-title {
        font-size: 1.6rem;
    }
}

/* ============================================================================
   PRELOADER A PRUEBA DE FALLOS (V4 - Definitivo)
   ============================================================================ */

/* 1. Ocultar el contenido principal y la nav mientras carga */
body.is-loading nav,
body.is-loading main,
body.is-loading footer {
    visibility: hidden;
}

/* 2. El Overlay del Loader */
#loader-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    transition: opacity 0.8s ease, visibility 0.8s;
    opacity: 1;
    visibility: visible;
}

/* 3. Cuando la carga termina, ocultar el loader */
body:not(.is-loading) #loader-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 4. Texto del Loader */
.loader-text {
    font-family: var(--mono);
    font-size: 2rem;
    color: var(--green);
    text-shadow: 0 0 20px var(--green);
    letter-spacing: 5px;
}

/* 5. Parpadeo de éxito */
.blink-fast {
    animation: blinkSuccess 0.15s infinite;
}

@keyframes blinkSuccess {
    50% {
        opacity: 0.2;
    }
}

/* 6. Bloqueo de scroll */
body.is-loading {
    overflow: hidden;
}

/* --- 11. EFECTOS DEL MAPA (RADAR) --- */
.jvectormap-marker {
    /* Animamos el borde (stroke) del SVG para crear la onda expansiva */
    animation: radarWave 2s infinite ease-out;
}

@keyframes radarWave {
    0% {
        stroke-width: 0;
        stroke-opacity: 1;
    }
    100% {
        stroke-width: 30; /* La onda se expande */
        stroke-opacity: 0; /* Y se desvanece */
    }
}