/* Bouncing circles loader — from Uiverse.io by mobinkakei */
.bounce-loader {
    --bl-ball: #1e293b;
    --bl-shadow: rgba(15, 23, 42, 0.45);
    --bl-text: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

body.dark-mode .bounce-loader,
html.dark .bounce-loader,
[data-theme="dark"] .bounce-loader {
    --bl-ball: #ffffff;
    --bl-shadow: rgba(0, 0, 0, 0.75);
    --bl-text: rgba(255, 255, 255, 0.65);
}

.bl-wrapper {
    width: 200px;
    height: 60px;
    position: relative;
    z-index: 1;
}

.bl-circle {
    width: 20px;
    height: 20px;
    position: absolute;
    border-radius: 50%;
    background-color: var(--bl-ball);
    left: 15%;
    transform-origin: 50%;
    animation: blCircle 0.5s alternate infinite ease;
}

@keyframes blCircle {
    0% {
        top: 60px;
        height: 5px;
        border-radius: 50px 50px 25px 25px;
        transform: scaleX(1.7);
    }

    40% {
        height: 20px;
        border-radius: 50%;
        transform: scaleX(1);
    }

    100% {
        top: 0%;
    }
}

.bl-circle:nth-child(2) {
    left: 45%;
    animation-delay: 0.2s;
}

.bl-circle:nth-child(3) {
    left: auto;
    right: 15%;
    animation-delay: 0.3s;
}

.bl-shadow {
    width: 20px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--bl-shadow);
    position: absolute;
    top: 62px;
    transform-origin: 50%;
    z-index: -1;
    left: 15%;
    filter: blur(1px);
    animation: blShadow 0.5s alternate infinite ease;
}

@keyframes blShadow {
    0% {
        transform: scaleX(1.5);
    }

    40% {
        transform: scaleX(1);
        opacity: 0.7;
    }

    100% {
        transform: scaleX(0.2);
        opacity: 0.4;
    }
}

.bl-shadow:nth-child(4) {
    left: 45%;
    animation-delay: 0.2s;
}

.bl-shadow:nth-child(5) {
    left: auto;
    right: 15%;
    animation-delay: 0.3s;
}

.bounce-loader__msg {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bl-text);
    text-align: center;
}

/* Full-page overlay loader */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(18, 18, 18, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.page-loader.active {
    display: flex;
}

.page-loader .bounce-loader {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 40px 48px;
    --bl-ball: #2563eb;
    --bl-shadow: rgba(15, 23, 42, 0.3);
    --bl-text: #475569;
}

body.dark-mode .page-loader .bounce-loader,
html.dark .page-loader .bounce-loader,
[data-theme="dark"] .page-loader .bounce-loader {
    background: #1e293b;
    --bl-ball: #ffffff;
    --bl-shadow: rgba(0, 0, 0, 0.6);
    --bl-text: #cbd5e1;
}
