/* --- START OF LOADING OVERLAY STYLES --- */

/* The main overlay container */
#loading-overlay {
    position: fixed; /* Sit on top of everything */
    top: 0;
    left: 0;
    width: 100vw;  /* Full viewport width */
    height: 100vh; /* Full viewport height */
    background-color: #ffffff; /* Solid white background */
    z-index: 9999; /* Extremely high z-index to ensure it's on top */

    /* Center the content inside */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Set up for the fade-out transition */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* The class that will be added by JavaScript to hide the overlay */
#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden; /* Hide it from screen readers and interactions after fade */
}

/* A container for the text lines */
.loading-text-container {
    text-align: center;
    font-family: Arial, sans-serif;
    color: #333;
}

/* Individual lines of text */
.loading-text-item {
    font-size: 2.5rem; /* Large, readable font size */
    font-weight: 300;  /* A lighter font weight */
    opacity: 0; /* Start as invisible */

    /* Animation definition */
    animation: fadeIn 1s ease-in-out forwards; /* 'forwards' keeps it visible after animation */
}

/* Specific styling for the main title */
#loading-title {
    font-weight: 600; /* Bolder font for the title */
    color: #3388ff; /* Use the theme's primary blue color */
}

/* Animation Delays - This creates the cascade effect */
.loading-text-item:nth-child(1) { /* "Welcome" */
    animation-delay: 0.1s;
}

.loading-text-item:nth-child(2) { /* "to" */
    animation-delay: 0.6s; /* Delay of 0.5s after "Welcome" starts */
    font-size: 1.5rem; /* Smaller font size for "to" */
    margin: 10px 0;
}

.loading-text-item:nth-child(3) { /* "Indic Atlas" */
    animation-delay: 1.3s; /* Delay of 0.7s after "to" starts */
}


/* The keyframe animation for the text fading in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px); /* Optional: slight upward move */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- END OF LOADING OVERLAY STYLES --- */

/* --- START OF MODIFICATION: SPINNER AND STATUS TEXT --- */
.loading-spinner,
#loading-status {
    /* Hidden by default, will be faded in via JS */
    opacity: 0;
    transition: opacity 0.4s ease-in;
}

.loading-spinner.visible,
#loading-status.visible {
    /* This class will be added by JS to trigger the fade-in */
    opacity: 1;
}

.loading-spinner {
    margin: 30px auto 15px auto;
    border: 4px solid #f3f3f3; /* Light grey circle */
    border-top: 4px solid #3388ff; /* Blue for the spinning part */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

#loading-status {
    font-size: 1rem;
    color: #666;
    font-style: italic;
    height: 1.2em; /* Reserve space to prevent layout jump */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* --- END OF MODIFICATION --- */