/* Magic Site Loader Styles */
.site-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #FFFAF1;
    /* Ivory background matching the theme */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s;
    overflow: hidden;
}

.site-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-logo {
    width: 120px;
    height: auto;
    position: relative;
    z-index: 2;
    animation: loaderPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(233, 66, 5, 0.2));
}

/* Rotating Magic Circle */
.magic-circle {
    position: absolute;
    width: 180px;
    height: 180px;
    border: 2px solid transparent;
    border-top: 2px solid var(--orange, #E94205);
    border-radius: 50%;
    animation: rotateMagic 1.5s linear infinite;
    opacity: 0.6;
}

.magic-circle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--orange, #E94205);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--orange, #E94205);
}

/* Sparkles Animation */
.magic-sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #E94205;
    border-radius: 50%;
    opacity: 0;
    animation: sparkleAnim 1.5s linear infinite;
}

.sparkle:nth-child(1) {
    top: -20px;
    left: 50%;
    animation-delay: 0s;
}

.sparkle:nth-child(2) {
    top: 40px;
    right: -20px;
    animation-delay: 0.3s;
}

.sparkle:nth-child(3) {
    bottom: -20px;
    left: 50%;
    animation-delay: 0.6s;
}

.sparkle:nth-child(4) {
    top: 40px;
    left: -20px;
    animation-delay: 0.9s;
}

.sparkle:nth-child(5) {
    top: 10px;
    right: 10px;
    animation-delay: 1.2s;
}

/* Keyframes */
@keyframes loaderPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes rotateMagic {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes sparkleAnim {
    0% {
        transform: scale(0) translateY(0);
        opacity: 0;
    }

    50% {
        transform: scale(1) translateY(-10px);
        opacity: 1;
    }

    100% {
        transform: scale(0) translateY(-20px);
        opacity: 0;
    }
}

/* Smooth page transition exit */
body.loading {
    overflow: hidden;
}