/*
 * Base styles for the page loader overlay.
 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* The glass background is on the main element */
    background-color: rgba(248, 249, 250, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    /* This transition handles the FINAL fade-out of the entire loader */
    opacity: 1;
    transition: opacity 0.6s ease;
}

/*
 * Solid white background layer using a pseudo-element.
 */
.page-loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Solid white */
    z-index: 1;
    opacity: 1;
    /* This transition handles the fade-out of the white background */
    transition: opacity 0.8s ease-in-out;
}

/* Hiding state for the final fade-out */
.page-loader.is-hiding {
    opacity: 0;
    pointer-events: none;
}

/* State to reveal the glass effect by fading out the white background */
.page-loader.glass-revealed::before {
    opacity: 0;
}

/*
 * Container for the loader's content (icon and text).
 */
.page-loader .loader-content {
    position: relative;
    z-index: 2;
    text-align: center;
    /* Start transparent for the initial fade-in */
    opacity: 0;
    /* This transition handles the fade-in of the content */
    transition: opacity 0.5s ease;
}

/* State to make the icon and text visible */
.page-loader.content-visible .loader-content {
    opacity: 1;
}

/*
 * Base styles for the loader icon.
 */
.loader-icon {
    font-size: 3rem;
    color: var(--bs-primary);
    display: inline-block;
    /* This transition will animate any change to the 'transform' property */
    transition: transform 0.8s ease-in-out;
}
