/* UI Progress Component - Animated loading indicators */

.ui-progress {
    --progress-color: var(--color-brand-primary, #3b82f6);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

/* Size variants */
.ui-progress--small {
    --progress-size: 24px;
    font-size: 0.875rem;
}

.ui-progress--default {
    --progress-size: 48px;
    font-size: 1rem;
}

.ui-progress--large {
    --progress-size: 72px;
    font-size: 1.125rem;
}

/* Spinner variant */
.ui-progress__spinner {
    width: var(--progress-size);
    height: var(--progress-size);
    animation: ui-progress-rotate 1.4s linear infinite;
}

.ui-progress__spinner-svg {
    width: 100%;
    height: 100%;
}

.ui-progress__spinner-circle {
    stroke: var(--progress-color);
    stroke-linecap: round;
    animation: ui-progress-dash 1.4s ease-in-out infinite;
}

@keyframes ui-progress-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes ui-progress-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Ring variant */
.ui-progress__ring {
    width: var(--progress-size);
    height: var(--progress-size);
}

.ui-progress__ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ui-progress__ring-bg {
    stroke: color-mix(in srgb, var(--progress-color) 20%, transparent);
}

.ui-progress__ring-progress {
    stroke: var(--progress-color);
    stroke-linecap: round;
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    animation: ui-progress-ring 2s ease-in-out infinite;
}

@keyframes ui-progress-ring {
    0%, 100% {
        stroke-dashoffset: 126;
    }
    50% {
        stroke-dashoffset: 0;
    }
}

/* Bar variant */
.ui-progress__bar {
    width: 100%;
    min-width: 200px;
    height: 8px;
    background: color-mix(in srgb, var(--progress-color) 20%, transparent);
    border-radius: 999px;
    overflow: hidden;
}

.ui-progress__bar-fill {
    height: 100%;
    background: var(--progress-color);
    border-radius: 999px;
    transition: width 0.3s ease-out;
    animation: ui-progress-bar-shimmer 1.5s ease-in-out infinite;
}

@keyframes ui-progress-bar-shimmer {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--progress-color) 40%, transparent);
    }
    50% {
        box-shadow: 0 0 8px 2px color-mix(in srgb, var(--progress-color) 40%, transparent);
    }
    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--progress-color) 40%, transparent);
    }
}

/* Pulse variant */
.ui-progress__pulse {
    display: flex;
    align-items: center;
    gap: calc(var(--progress-size) / 6);
}

.ui-progress__pulse-dot {
    width: calc(var(--progress-size) / 4);
    height: calc(var(--progress-size) / 4);
    background: var(--progress-color);
    border-radius: 50%;
    animation: ui-progress-pulse 1.4s ease-in-out infinite;
}

.ui-progress__pulse-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ui-progress__pulse-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ui-progress-pulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Label */
.ui-progress__label {
    color: var(--color-text-muted);
    font-weight: 500;
    text-align: center;
}
