/* Preloader Wrapper */
#globalPreloader {
    position: fixed;
    inset: 0;
    z-index: 10000000;
    /* Rich Gradient Background matching PJS Luxury Theme + User's Request */
    background: #000000;
    /* Use CSS Gradients to mimic the subtle mix function */
    background-image: linear-gradient(45deg, #3f3251 2%, #002025 100%);
    overflow: hidden;
    transition: opacity 0.8s ease-in-out;
}

/* Vertical Centering Helper */
.vertical-centered-box {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.content {
    position: relative;
    box-sizing: border-box;
    display: flex;
    /* Changed from inline-block for easier centering of inner contents */
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
}

/* Loader Circle */
.loader-circle {
    position: absolute;
    left: 0;
    top: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Rotating Line Mask */
.loader-line-mask {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    /* Half width */
    height: 120px;
    overflow: hidden;
    transform-origin: 60px 60px;
    -webkit-mask-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
    animation: rotate 1.2s infinite linear;
}

.loader-line {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* Particles Containers */
#particles-background,
#particles-foreground {
    position: absolute;
    left: -51%;
    top: -51%;
    width: 202%;
    height: 202%;
    transform: scale3d(0.5, 0.5, 1);
    pointer-events: none;
}

#particles-background {
    z-index: 1;
}

#particles-foreground {
    z-index: 2;
}

.vertical-centered-box .content {
    z-index: 10;
    /* Ensure content is above particles */
}

/* Castle Logo Inside Loader */
.preloader-logo {
    width: 60px;
    /* Adjust size to fit in circle */
    height: auto;
    position: relative;
    z-index: 11;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    animation: fade 2s infinite ease-in-out;
}

/* Animations */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

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

@keyframes fade {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}