/* EPMS Loader Styles */
:root {
    --initial-loader-bg: #fff;
}

#loading-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff; /* Default background color */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.loading-logo {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--initial-loader-color, #041e65);  /* Use theme color for text */
}

.loading-logo img {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);  /* Light background for image */
    padding: 12px;
}

.loading-logo .logo-text {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem auto;
    border-radius: 50%;
    background: var(--initial-loader-color, #041e65);  /* Use theme color as background */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;  /* White text on theme color background */
    border: 2px solid var(--initial-loader-color, #041e65);  /* Theme color border */
    position: relative;
    overflow: visible;
}

.loading-logo h1 {
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 300;
    animation: pulse 2s infinite;
}

.loading-logo p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
}

/* Loading Effects */
.loading {
    position: relative;
    width: 80px;
    height: 80px;
}

.effects {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    mix-blend-mode: multiply;
}

.effect-1 {
    width: 80px;
    height: 80px;
    border-top-color: var(--initial-loader-color, #041e65); /* Same theme accent color */
    border-top-width: 3px;
    animation: rotate 1.5s linear infinite;
}

.effect-2 {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    border-right-color: var(--initial-loader-color, #041e65); /* Same theme accent color */
    border-right-width: 3px;
    animation: rotate 1.5s linear infinite reverse;
}

.effect-3 {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    border-bottom-color: var(--initial-loader-color, #041e65); /* Same theme accent color */
    border-bottom-width: 3px;
    animation: rotate 1.5s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-logo h1 {
        font-size: 2rem;
    }
    
    .loading-logo p {
        font-size: 1rem;
    }
    
    .loading-logo img {
        width: 48px;
        height: 48px;
    }
    
    .loading {
        width: 60px;
        height: 60px;
    }
    
    .effect-1 {
        width: 60px;
        height: 60px;
    }
    
    .effect-2 {
        width: 45px;
        height: 45px;
        top: 7.5px;
        left: 7.5px;
    }
    
    .effect-3 {
        width: 30px;
        height: 30px;
        top: 15px;
        left: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --initial-loader-bg: #1a1a2e;
        --initial-loader-color: #16213e;
    }
}

@keyframes fadeOutLoader {
    0% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}
