/* ========================================
   PREMIUM LOADING SCREEN - ROBUST & CLEAN
   ======================================== */

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0e27;
    /* Solid fallback */
    background: radial-gradient(circle at center, #141b3d 0%, #0a0e27 100%);
    z-index: 2147483647;
    /* Max z-index */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Container for all content to ensure centering */
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    /* Space between Logo, Title, Bar */
    position: relative;
    z-index: 2;
}

/* LOGO SECTION */
.loader-logo-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinning Ring - Absolutely positioned relative to container */
.loader-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: spin 2s linear infinite;
}

.loader-ring {
    width: 100%;
    height: 100%;
}

.loader-ring circle {
    fill: none;
    stroke: #ffd700;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 75;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Static Logo Image - Centered */
.loader-logo {
    width: 80px;
    height: 80px;
    background: #0a0e27;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.loader-logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* TYPOGRAPHY - Safe rendering with Animations */
.loader-title {
    text-align: center;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    /* Ensures entry animation looks clean */
}

.loader-title-main {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #ffd700;
    margin: 0;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 2px;

    /* Animation */
    opacity: 0;
    animation:
        textEnter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards,
        textGlow 3s ease-in-out 1.2s infinite;
}

.loader-title-sub {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
    color: #a0a8c1;
    margin-top: 5px;
    letter-spacing: 4px;
    text-transform: uppercase;

    /* Animation */
    opacity: 0;
    animation: textEnter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s forwards;
}

@keyframes textEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textGlow {

    0%,
    100% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0);
    }

    50% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    }
}

/* PROGRESS BAR */
.loader-bar-container {
    width: 200px;
    /* Fixed functional width */
}

.loader-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    background: #ffd700;
    width: 0%;
    animation: loadProgress 2s ease-in-out forwards;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

@keyframes loadProgress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

.loader-text {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

/* BACKGROUND ACCENTS - kept subtle */
.loader-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#ffd700 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.1;
    z-index: 1;
}