/* ==========================================
   PRELOADER STYLES
   Animated loader shown while media files are loading
   ========================================== */

/* Hide page content while loading */
body.loading .page-content {
    opacity: 0;
    visibility: hidden;
}

/* Preloader container */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* Hide preloader when loaded */
body.loaded #preloader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Show page content when loaded */
body.loaded .page-content {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-in 0.3s;
}

/* Loader container with reflection */
.preloader-box {
    position: relative;
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-box-reflect: below 0 linear-gradient(transparent, transparent, #0005);
}

/* Individual loader circles */
.preloader-box .loader {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    animation: animateLoading 2s linear infinite;
}

/* Offset animation for second and fourth loaders */
.preloader-box .loader:nth-child(2),
.preloader-box .loader:nth-child(4) {
    animation-delay: -1s;
    filter: hue-rotate(290deg);
}

/* Rotation animation */
@keyframes animateLoading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Gradient arc for first two loaders */
.preloader-box .loader:nth-child(1)::before,
.preloader-box .loader:nth-child(2)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(to top, transparent, rgba(0, 255, 249, 0.5));
    background-size: 100px 180px;
    background-repeat: no-repeat;
    border-top-left-radius: 100px;
    border-bottom-left-radius: 100px;
}

/* Glowing dots */
.preloader-box .loader i {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #00fff9;
    border-radius: 50%;
    box-shadow:
        0 0 10px #00fff9,
        0 0 20px #00fff9,
        0 0 30px #00fff9,
        0 0 40px #00fff9,
        0 0 50px #00fff9,
        0 0 60px #00fff9,
        0 0 70px #00fff9,
        0 0 80px #00fff9,
        0 0 90px #00fff9,
        0 0 100px #00fff9;
    z-index: 10;
}

/* Inner black circle */
.preloader-box .loader span {
    position: absolute;
    inset: 20px;
    background: #000;
    border-radius: 50%;
    z-index: 1;
}