/*
 * Event Monitor Preloader — Bouncing Balls
 * Black hero background + brand blue (#23aee3) balls
 */

/* ── Overlay ─────────────────────────────────────────────── */
#preloader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #000000 0%, #111827 60%, #1f2937 100%);
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    /* Puramente cosmético (tapa el flash de contenido sin estilos) — no debe
       bloquear clicks a elementos reales de la página (ej. selector de idioma
       en la esquina superior) mientras dura su animación de ~1.3s. */
    pointer-events: none;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* ── Balls wrapper ───────────────────────────────────────── */
.wrapper {
    display: grid;
    grid-template-columns: repeat(3, 22px);
    grid-template-rows: 50px 10px;
    column-gap: 14px;
    row-gap: 10px;
    align-items: end;
    justify-items: center;
}

/* ── Circles (balls) ─────────────────────────────────────── */
.circle,
.circle2 {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #23aee3;
    box-shadow:
        0 0 12px rgba(35, 174, 227, 0.8),
        0 0 32px rgba(35, 174, 227, 0.4),
        0 0 60px rgba(35, 174, 227, 0.15);
    animation: ball-bounce 0.6s ease-in-out alternate infinite;
}

/* Ball 1 */
.wrapper > .circle:nth-child(1) { animation-delay: 0s; }
/* Ball 2 (circle2) */
.circle2                         { animation-delay: 0.2s; }
/* Ball 3 */
.wrapper > .circle:nth-child(3) { animation-delay: 0.4s; }

/* ── Shadows ─────────────────────────────────────────────── */
.shadow {
    width: 18px;
    height: 5px;
    border-radius: 50%;
    background: rgba(35, 174, 227, 0.35);
    filter: blur(1px);
    animation: shadow-shrink 0.6s ease-in-out alternate infinite;
}

.shadow:nth-child(4) { animation-delay: 0s;   }
.shadow:nth-child(5) { animation-delay: 0.2s; }
.shadow:nth-child(6) { animation-delay: 0.4s; }

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes ball-bounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-40px);
        box-shadow:
            0 0 18px rgba(35, 174, 227, 1),
            0 0 48px rgba(35, 174, 227, 0.6),
            0 0 80px rgba(35, 174, 227, 0.25);
    }
}

@keyframes shadow-shrink {
    from {
        transform: scaleX(1);
        opacity: 0.35;
    }
    to {
        transform: scaleX(0.45);
        opacity: 0.1;
    }
}

/* ── Brand label ─────────────────────────────────────────── */
.preloader-label {
    font-family: 'Sarabun', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    animation: label-pulse 1.8s ease-in-out infinite;
}

@keyframes label-pulse {
    0%, 100% { opacity: 0.45; }
    50%       { opacity: 0.85; }
}
