/*
 * Spec 087 PR A — top-of-viewport progress bar.
 *
 * Hidden by default; the cs-progress.js controller adds .cs-progress-bar--visible
 * after a 200ms grace and removes it after a 250ms minimum-show window.
 *
 * Light + dark themes use the same accent token as the rest of the app
 * (--accent-fill-rest, set by FluentDesignTheme). Falls back to a neutral
 * brand-blue if Fluent tokens haven't been pinned yet (rare race on first
 * paint).
 *
 * prefers-reduced-motion: the animated gradient becomes a solid bar and the
 * fade-in/out becomes an instant snap. Still visible (the user still benefits
 * from the "yes, I heard you" signal); just not moving.
 */

#cs-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 120ms ease-out, visibility 0s linear 120ms;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--accent-fill-rest, #0078d4) 30%,
        var(--accent-fill-rest, #0078d4) 70%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: cs-progress-shimmer 1.4s linear infinite;
    will-change: opacity, background-position;
}

#cs-progress-bar.cs-progress-bar--visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 120ms ease-out, visibility 0s linear 0s;
}

@keyframes cs-progress-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
    #cs-progress-bar {
        background: var(--accent-fill-rest, #0078d4);
        animation: none;
        transition: opacity 0s, visibility 0s;
    }
}
