/* ======================================================= */
/* === NEW ADVANCED PRELOADER STYLES ===================== */
/* ======================================================= */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #05080d;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
    transition-delay: 0.5s;
    overflow: hidden;
}

#preloader.preloader--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-container {
    text-align: center;
    position: relative;
    width: 350px;
}

/* Glitch effect for the text */
.glitch {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 2.5rem;
    color: var(--neo-blue, #00ffff);
    position: relative;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #05080d;
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--neo-red, #ff073a);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--neo-green, #39ff14), 2px 2px var(--neo-red, #ff073a);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

/* Logo reveal */
.logo-container {
    opacity: 0;
    animation: fadeInLogo 1s ease-out 2s forwards;
    margin: 1.5rem 0;
}

.preloader-logo {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 0 15px var(--neo-blue));
    animation: pulseLogo 2s infinite ease-in-out;
}

/* Loading Bar */
.loading-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color, #1a2942);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 2rem;
    opacity: 0;
    animation: fadeIn 0.5s linear 1s forwards;
}

.loading-bar .bar {
    width: 0;
    height: 100%;
    background: var(--neo-blue, #00ffff);
    box-shadow: 0 0 10px var(--neo-blue, #00ffff);
    animation: load 4s ease-in-out 1.2s forwards;
}

/* Status Text */
.status-text {
    font-family: 'Roboto', monospace;
    color: var(--text-secondary, #889);
    margin-top: 1rem;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1s linear 1.5s forwards;
}

/* KEYFRAME ANIMATIONS */
@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(3% 0 95% 0);
    }

    20% {
        clip-path: inset(78% 0 2% 0);
    }

    40% {
        clip-path: inset(45% 0 54% 0);
    }

    60% {
        clip-path: inset(25% 0 1% 0);
    }

    80% {
        clip-path: inset(80% 0 5% 0);
    }

    100% {
        clip-path: inset(52% 0 45% 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(89% 0 5% 0);
    }

    20% {
        clip-path: inset(10% 0 80% 0);
    }

    40% {
        clip-path: inset(60% 0 30% 0);
    }

    60% {
        clip-path: inset(95% 0 1% 0);
    }

    80% {
        clip-path: inset(20% 0 70% 0);
    }

    100% {
        clip-path: inset(0 0 92% 0);
    }
}

@keyframes glitch-skew {
    0% {
        transform: skewX(0deg);
    }

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

@keyframes fadeInLogo {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulseLogo {

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

    50% {
        transform: scale(1.05);
    }
}

@keyframes load {
    to {
        width: 100%;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}