/* --- Loading Screen Styles --- */
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-dark); /* Dark background for the loader */
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.75s ease;
}

#welcome-text {
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    font-size: 1.5em;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
}

.loader-container {
    width: 80%;
    max-width: 400px;
    height: 25px; /* Made the bar slightly taller */
    background-color: var(--card-dark);
    border-radius: 12px;
    overflow: hidden;
    position: relative; /* Crucial for positioning the text inside */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 200%;
    border-radius: 12px;
    transition: width 0.4s ease-out;
    animation: gradient-animation 3s ease infinite; /* Animated gradient */
    position: absolute; /* Positioned behind the text */
    top: 0;
    left: 0;
}

#progress-text {
    position: relative; /* Positioned on top of the progress bar */
    z-index: 1;
    font-size: 0.9em;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); /* Shadow for readability */
    /* The pulsing animation is removed as it can be distracting inside the bar */
}

/* Fade out animation for the wrapper */
#loader-wrapper.fade-out {
    opacity: 0;
}

/* --- Keyframe Animations --- */

/* For the welcome text fade-in */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* For the progress bar gradient */
@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* For the pulsing progress text (not used by default now) */
@keyframes pulse-text {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}
