﻿
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
    contain: layout paint style;
}

    /* Fade In - Initial State */
    .loader-wrapper.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Fade Out - Final State */
    .loader-wrapper.is-hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .loader-wrapper.loader-hidden {
        opacity: 0;
        visibility: hidden;
        transition-delay: 0.5s; /* Delay removal of pointer events */
        pointer-events: none;
    }

@media (prefers-reduced-motion: reduce) {
    .loader-wrapper {
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
}

.absolute {
    position: absolute;
}

.inline-block {
    display: inline-block;
}

.loader {
    display: flex;
    margin: 0.25em 0;
}


.ball-x-wrapper {
    position: absolute;
    z-index: 0;
    top: -40px;
    left: 32px;
    animation: sequence-x 5s infinite linear;
}
.ball-y-bounce {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #fe7743, #ec5228);
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    /* Faster bounce: 1s per complete up-down cycle */
    animation: jump-y 1s infinite;
}
@keyframes sequence-x {
    /* Each 20% block is 1 second (1/5th of the 5s duration) */
    0% {
        transform: translateX(0px);
    }
    /* At E */
    20% {
        transform: translateX(200px);
    }
    /* Jump to M */
    40% {
        transform: translateX(300px);
    }
    /* Jump to A1 */
    60% {
        transform: translateX(400px);
    }
    /* Jump to Z */
    80% {
        transform: translateX(600px);
    }
    /* Jump to D */
    100% {
        transform: translateX(700px);
    }
    /* Jump to E2 */
}
@keyframes jump-y {
    0%, 100% {
        transform: translateY(0) scaleY(0.8) scaleX(1.2); /* Impact at start/end of jump */
        animation-timing-function: ease-out;
    }

    50% {
        transform: translateY(-80px) scaleY(1) scaleX(1); /* Peak of the arc */
        animation-timing-function: ease-in;
    }
}


.w-2 {
    width: 0.5em;
}

.dash {
    animation: dashArray 2s ease-in-out infinite, dashOffset 2s linear infinite;
}

.spin {
    animation: spinDashArray 2s ease-in-out infinite, spin 8s ease-in-out infinite, dashOffset 2s linear infinite;
    transform-origin: center;
}

@keyframes dashArray {
    0% {
        stroke-dasharray: 0 1 359 0;
    }

    50% {
        stroke-dasharray: 0 359 1 0;
    }

    100% {
        stroke-dasharray: 359 1 0 0;
    }
}

@keyframes spinDashArray {
    0% {
        stroke-dasharray: 270 90;
    }

    50% {
        stroke-dasharray: 0 360;
    }

    100% {
        stroke-dasharray: 250 90;
    }
}

@keyframes dashOffset {
    0% {
        stroke-dashoffset: 385;
    }

    100% {
        stroke-dashoffset: 5;
    }
}

@keyframes spin {
    0% {
        rotate: 0deg;
    }

    12.5%, 25% {
        rotate: 270deg;
    }

    37.5%, 50% {
        rotate: 540deg;
    }

    62.5%, 75% {
        rotate: 810deg;
    }

    87.5%, 100% {
        rotate: 1080deg;
    }
}

/* Loading Status Styles */
.loading-status {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    text-align: center;
}

.loading-progress {
    width: 100%;
    height: 3px;
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.progress-track {
    position: absolute;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(254, 119, 67, 0.2) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

.progress-indicator {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #fe7743, #ec5228);
    border-radius: 3px;
    animation: progress-move 2s ease-in-out infinite;
}

.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    color: #555;
}

.message-text {
    font-weight: 500;
}

.loading-dots {
    width: 20px;
    text-align: left;
}

    .loading-dots::after {
        content: '';
        animation: loading-dots 1.5s infinite;
    }

.percentage {
    font-family: monospace;
    font-weight: bold;
    color: #ec5228;
    min-width: 30px;
    text-align: right;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes progress-move {
    0%, 100% {
        transform: translateX(-100%);
        width: 30%;
    }

    50% {
        transform: translateX(200%);
        width: 40%;
    }
}

@keyframes loading-dots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}
