/* Global Loader Styles */
#loader-esquina {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 20002;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container vibrates now, so everything inside moves together */
#loader-esquina .logo-stack {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: vibrate 0.2s infinite;
    padding: 20px;
}

#loader-esquina .branding-logo {
    height: 160px;
    width: auto;
    position: relative;
    z-index: 20;
}

/* Refined, Smaller vertical light cone */
.light-cone {
    position: absolute;
    /* Aligned precisely with the white lamp head at the very tip of the arm (furthest right) */
    top: 66px;
    right: 2px;

    width: 90px;
    /* Slightly wider beam */
    height: 140px;
    /* Slightly longer beam */

    /* Conical beam using radial gradient */
    background: radial-gradient(circle at top center, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 80%);

    /* Sharper Triangle Cone */
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);

    transform-origin: 50% 0%;
    /* Oriented vertically */
    transform: rotate(0deg);

    filter: blur(8px);
    z-index: 10;
    pointer-events: none;
    animation: flicker-light 5s infinite;
}

@keyframes flicker-light {

    0%,
    15%,
    17%,
    19%,
    21%,
    50%,
    52%,
    100% {
        opacity: 0.95;
    }

    16%,
    20%,
    51% {
        opacity: 0.3;
    }

    18% {
        opacity: 0.6;
    }
}

@keyframes vibrate {
    0% {
        transform: translate(0);
    }

    25% {
        transform: translate(0.4px, 0.4px);
    }

    50% {
        transform: translate(-0.4px, -0.4px);
    }

    75% {
        transform: translate(0.4px, -0.4px);
    }

    100% {
        transform: translate(0);
    }
}

/* =========================================
   CYBERPUNK GLITCH LOADER (GEN 3.1 - SUBTLE)
   ========================================= */

.cyber-glitch-container {
    position: relative;
    display: inline-block;
    /* Wrapping the logo */
}

/* Glitch Layers (Create the RBG Split) */
.cyber-glitch-container::before,
.cyber-glitch-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/hub/la_esquina_logo_oficial.png') no-repeat center center;
    background-size: contain;
    opacity: 0;
    /* Hidden by default */
    mix-blend-mode: screen;
    pointer-events: none;
}

/* Red Shift Layer - Subtle Trigger */
.cyber-glitch-container::before {
    z-index: -1;
    animation: subtle-glitch-1 4s infinite linear alternate-reverse;
}

/* Cyan Shift Layer - Subtle Trigger */
.cyber-glitch-container::after {
    z-index: -2;
    animation: subtle-glitch-2 4s infinite linear alternate-reverse;
}

/* Very Subtle Glitch Animations (Shakes + RGB Split) */
@keyframes subtle-glitch-1 {
    0% {
        opacity: 0;
        transform: translate(0);
    }

    96% {
        opacity: 0;
        transform: translate(0);
    }

    97% {
        opacity: 0.5;
        transform: translate(-2px, 0);
        filter: drop-shadow(-2px 0 0 #ff003c);
    }

    98% {
        opacity: 0.5;
        transform: translate(-2px, 0);
    }

    99% {
        opacity: 0;
        transform: translate(0);
    }

    100% {
        opacity: 0;
        transform: translate(0);
    }
}

@keyframes subtle-glitch-2 {
    0% {
        opacity: 0;
        transform: translate(0);
    }

    60% {
        opacity: 0;
        transform: translate(0);
    }

    61% {
        opacity: 0.5;
        transform: translate(2px, 0);
        filter: drop-shadow(2px 0 0 #00f0ff);
    }

    62% {
        opacity: 0.5;
        transform: translate(2px, 0);
    }

    63% {
        opacity: 0;
        transform: translate(0);
    }

    100% {
        opacity: 0;
        transform: translate(0);
    }
}