/* Fullscreen App Loader */
#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #05070a;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
    /* Ensure initial state is visible and opaque to prevent flickering */
    opacity: 1;
    visibility: visible;
}

.loader-content {
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Glitch/Sci-Fi Logo Effect */
.loader-logo {
    font-family: 'Teko', sans-serif;
    font-size: 5rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 30px;
    background: linear-gradient(90deg, #ffffff, #00f0ff, #ffffff);
    /* Fallback color to prevent invisible text while gradient loads */
    color: #00f0ff;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: shine 3s linear infinite;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.loader-bar-container {
    width: 240px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.loader-bar {
    width: 50%;
    height: 100%;
    background: #00f0ff;
    position: absolute;
    left: -50%;
    animation: loading 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 15px #00f0ff, 0 0 30px #00f0ff;
    border-radius: 2px;
}

.loader-text {
    font-family: 'Exo 2', sans-serif;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 15px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    animation: pulseText 2s ease-in-out infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

@keyframes loading {
    0% {
        left: -50%;
        width: 30%;
    }

    50% {
        left: 25%;
        width: 50%;
    }

    100% {
        left: 100%;
        width: 30%;
    }
}

@keyframes pulseText {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

/* Hide State */
body.loaded #app-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}