/* Prevent conflicts */
#loaderOverlay * {
    box-sizing: border-box !important;
}

/* Background */
#loaderOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

#loaderOverlay.active {
    display: flex;
}

/* Loader Box */
#loaderOverlay .loader-modal {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}

/* -------- ORIGINAL 3 DOT LOADER -------- */
.three-body {
    --uib-size: 70px;
    --uib-speed: 0.8s;
    --uib-color: #DC2626;
    position: relative;
    display: inline-block;
    height: var(--uib-size);
    width: var(--uib-size);
    animation: spin calc(var(--uib-speed) * 2.5) infinite linear;
    margin-bottom: 32px;
}

.three-body__dot {
    position: absolute;
    height: 100%;
    width: 30%;
}

.three-body__dot:after {
    content: "";
    position: absolute;
    height: 0%;
    width: 100%;
    padding-bottom: 100%;
    background-color: var(--uib-color);
    border-radius: 50%;
}

/* LEFT DOT */
.three-body__dot:nth-child(1) {
    bottom: 5%;
    left: 0;
    transform: rotate(60deg);
    transform-origin: 50% 85%;
}
.three-body__dot:nth-child(1)::after {
    bottom: 0;
    left: 0;
    animation: wobble1 var(--uib-speed) infinite ease-in-out;
    animation-delay: calc(var(--uib-speed) * -0.3);
}

/* RIGHT DOT */
.three-body__dot:nth-child(2) {
    bottom: 5%;
    right: 0;
    transform: rotate(-60deg);
    transform-origin: 50% 85%;
}
.three-body__dot:nth-child(2)::after {
    bottom: 0;
    left: 0;
    animation: wobble1 var(--uib-speed) infinite ease-in-out;
    animation-delay: calc(var(--uib-speed) * -0.15);
}

/* BOTTOM DOT */
.three-body__dot:nth-child(3) {
    bottom: -5%;
    left: 0;
    transform: translateX(116.666%);
}
.three-body__dot:nth-child(3)::after {
    top: 0;
    left: 0;
    animation: wobble2 var(--uib-speed) infinite ease-in-out;
}

/* Animations for loader */
@keyframes spin {
    0% { transform: rotate(0); }
    100% { transform: rotate(360deg); }
}

@keyframes wobble1 {
    0%,100% { transform: translateY(0%) scale(1); opacity: 1; }
    50% { transform: translateY(-66%) scale(0.65); opacity: 0.8; }
}

@keyframes wobble2 {
    0%,100% { transform: translateY(0%) scale(1); opacity: 1; }
    50% { transform: translateY(66%) scale(0.65); opacity: 0.8; }
}

/* ------- TEXT ------- */
.modal-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
}

.modal-content p {
    font-size: 16px;
    color: #718096;
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Dots after text */
.loading-dots span {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #DC2626;
    border-radius: 50%;
    margin: 0 2px;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%,60%,100% { transform: scale(1); }
    30% { transform: scale(1.4); opacity: 0.6; }
}

/* ------- Progress Bar ------- */
.progress-container {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 24px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #DC2626, #f87171);
    animation: progress 3s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Slide animation */
@keyframes slideUp {
    0% { transform: translateY(30px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
