/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: hsl(var(--background));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-container {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.loader-logo {
    margin-bottom: 2rem;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.loader-logo .logo-font {
    font-size: 4rem;
    font-weight: 700;
    color: hsl(var(--primary));
    font-family: "VIRUST", sans-serif;
    text-shadow: 0 0 30px hsla(var(--primary), 0.5);
    letter-spacing: 0.2rem;
}

/* Subtle ring behind the logo for emphasis */
.loader-logo::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at center, hsla(var(--primary), 0.12), transparent 40%);
    filter: blur(8px);
    z-index: -1;
    animation: ringPulse 2.6s ease-in-out infinite;
}

@keyframes ringPulse {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.9; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.9; }
}

.loader-bar {
    width: min(420px, 80%);
    height: 6px;
    background: hsl(var(--muted));
    border-radius: 999px;
    overflow: hidden;
    margin: 0 auto 1.25rem;
    position: relative;
}

.loader-progress {
    height: 100%;
    background: hsl(var(--primary));
    border-radius: 999px;
    width: 0%;
    transition: width 280ms linear;
    box-shadow: 0 0 24px hsla(var(--primary), 0.5);
}

.loader-text {
    color: hsl(var(--foreground));
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    font-family: InterVariable, Inter var, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    animation: fadeInOut 1.5s ease-in-out infinite;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

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

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

@keyframes loadProgress {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Fallback for browsers without CSS custom properties */
@supports not (color: hsl(var(--primary))) {
    .loading-screen {
        background: #0a0f1e;
    }

    .loader-logo .logo-font {
        color: #3b82f6;
    }

    .loader-bar {
        background: rgba(255, 255, 255, 0.1);
    }

    .loader-progress {
        background: #3b82f6;
    }

    .loader-text {
        color: rgba(255, 255, 255, 0.8);
    }
}