/* Loader Container */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #FFF5E6;
    /* Match var(--cream) */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    /* Ensure it stays on top of everything */
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* Hide class to fade out */
#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Loader Content Wrapper */
.loader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Mascot Image */
.loader-mascot {
    width: 120px;
    /* Base size */
    height: auto;
    margin-bottom: 20px;
    animation: loader-float 2s ease-in-out infinite;
    display: block;
}

/* Spinner Circle */
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 0, 45, 0.2);
    /* Light red */
    border-top: 4px solid #FF002D;
    /* Primary Red */
    border-radius: 50%;
    animation: loader-spin 1s linear infinite;
}

/* Animations */
@keyframes loader-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes loader-spin {
    0% {
        transform: rotate(0deg);
    }

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .loader-mascot {
        width: 100px;
    }

    .loader-spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
}

@media (max-width: 480px) {
    .loader-mascot {
        width: 80px;
    }
}