/* Loading Screen to prevent FOUC (Flash of Unstyled Content) */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-text {
    margin-top: 20px;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 16px;
    color: #333;
    text-align: center;
}

.loading-logo {
    width: 100%;
    max-width: 320px;
    height: auto;
    margin-bottom: 30px;
    opacity: 0.8;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-company-name {
    font-family: 'Arial', sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: #007cba;
    text-align: center;
    white-space: nowrap;
}

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

/* Fade out animation when loading is complete */
.loading-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
    pointer-events: none;
}

/* Hide body content initially to prevent flash */
body.loading {
    overflow: hidden;
}

body.loading > *:not(.loading-overlay) {
    visibility: hidden;
}

/* Show content when loading is complete */
body.loaded > *:not(.loading-overlay) {
    visibility: visible;
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
    
    .loading-text {
        font-size: 14px;
    }
    
    .loading-logo {
        width: 100%;
        max-width: 280px;
        margin-bottom: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 10px;
    }
    
    .loading-company-name {
        font-size: 14px;
        white-space: normal;
        line-height: 1.2;
    }
}
