/* Custom Global Preloader */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--background, #f9fafb);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    visibility: visible;
}

#global-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

#global-loader .loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Modern Spinner using Double Bounce */
.modern-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin-bottom: 20px;
}

.modern-spinner .double-bounce1, 
.modern-spinner .double-bounce2 {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary, #4caf50);
    opacity: 0.6;
    position: absolute;
    top: 0;
    left: 0;
    animation: sk-bounce 2.0s infinite ease-in-out;
}

.modern-spinner .double-bounce2 {
    animation-delay: -1.0s;
    background-color: var(--secondary, #0175C2);
}

@keyframes sk-bounce {
    0%, 100% { 
        transform: scale(0.0);
        -webkit-transform: scale(0.0);
    } 50% { 
        transform: scale(1.0);
        -webkit-transform: scale(1.0);
    }
}

#global-loader .loader-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: var(--body, #1e293b);
    margin-bottom: 8px;
    text-transform: uppercase;
}

#global-loader .loader-subtext {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--muted, #64748b);
    letter-spacing: 0.5px;
}

body.loading {
    overflow: hidden !important;
}

/* Disable the default template body spinner */
body.spinner:after {
    display: none !important;
}

/* Hide unstyled elements before JS initializes */
html:not([data-show='true']) #nav {
    display: none !important;
}