/* LoadingStyles.css - Loading indicators */

/* Loading container */
.UnB-Loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
    padding: 1em;
}

/* Spinner */
.UnB-Spinner {
    position: relative;
    inline-size: 2em;
    block-size: 2em;
    animation: spinner-rotate 1s linear infinite;
}

.UnB-Spinner-Inner {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-block-start-color: var(--unb-accent-color, #64b5f6);
    border-radius: 50%;
    animation: spinner-pulse 0.75s ease-in-out infinite;
}

.UnB-Spinner--sm {
    inline-size: 1.25em;
    block-size: 1.25em;
}

.UnB-Spinner--lg {
    inline-size: 3em;
    block-size: 3em;
}

@keyframes spinner-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spinner-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Dots loader */
.UnB-Dots {
    display: flex;
    align-items: center;
    gap: 0.25em;
}

.UnB-Dot {
    inline-size: 0.5em;
    block-size: 0.5em;
    border-radius: 50%;
    background-color: var(--unb-text-secondary, rgba(255, 255, 255, 0.7));
    animation: dots-bounce 1.4s ease-in-out infinite;
}

.UnB-Dot:nth-child(1) { animation-delay: 0s; }
.UnB-Dot:nth-child(2) { animation-delay: 0.16s; }
.UnB-Dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes dots-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading bar */
.UnB-Loading-Bar {
    inline-size: 100%;
    block-size: 0.25em;
    background-color: var(--unb-skeleton-bg, rgba(255, 255, 255, 0.08));
    border-radius: 0.125em;
    overflow: hidden;
}

.UnB-Loading-Bar-Inner {
    block-size: 100%;
    width: 30%;
    background-color: var(--unb-accent-color, #64b5f6);
    animation: loading-bar 1.5s ease-in-out infinite;
}

@keyframes loading-bar {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(200%); }
    100% { transform: translateX(-100%); }
}

/* Pulse loader */
.UnB-Pulse {
    inline-size: 1.5em;
    block-size: 1.5em;
    border-radius: 50%;
    background-color: var(--unb-accent-color, #64b5f6);
    animation: pulse-grow 1s ease-in-out infinite;
}

@keyframes pulse-grow {
    0%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Progress bar */
.UnB-Progress-Bar {
    inline-size: 100%;
    block-size: 0.25em;
    background-color: var(--unb-skeleton-bg, rgba(255, 255, 255, 0.08));
    border-radius: 0.125em;
    overflow: hidden;
}

.UnB-Progress-Fill {
    block-size: 100%;
    background-color: var(--unb-accent-color, #64b5f6);
    transition: width 0.2s ease-out;
}

.UnB-Progress-Bar--Top {
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 9999;
    border-radius: 0;
}

/* Loading overlay */
.UnB-Loading-Overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1em;
    background-color: var(--unb-overlay-bg, rgba(10, 10, 18, 0.9));
    backdrop-filter: blur(4px);
}

.UnB-Loading-Text {
    font-size: var(--unb-font-size-label, 0.875rem);
    color: var(--unb-text-secondary, rgba(255, 255, 255, 0.7));
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .UnB-Spinner,
    .UnB-Dot,
    .UnB-Loading-Bar-Inner,
    .UnB-Pulse {
        animation: none;
    }

    .UnB-Loading-Bar-Inner {
        width: 50%;
        transform: translateX(-50%);
    }
}
