﻿/* Site-wide navigation feedback for the static SSR public site.
   Driven by wwwroot/js/nav-progress.js which hooks Blazor enhanced-navigation events. */

/* Thin top progress bar shown during any enhanced navigation (page loads, template search). */
#nav-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #594ae2, #8f7bff);
    box-shadow: 0 0 8px rgba(89, 74, 226, 0.6);
    z-index: 20000;
    opacity: 0;
    transition: width 0.2s ease-out, opacity 0.25s ease;
    pointer-events: none;
}

#nav-progress-bar.nav-progress-done {
    transition: width 0.15s ease-out, opacity 0.25s ease 0.15s;
}

/* Per-control busy state: the exact link/button the user activated gets a spinner so it is
   obvious that the click was registered even before the next page appears. */
@keyframes nav-spin {
    to { transform: rotate(360deg); }
}

.is-loading {
    position: relative;
    pointer-events: none;
}

/* Dim the label a little and reserve room on the right for the spinner. */
.is-loading {
    color: transparent !important;
}

.is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1em;
    height: 1em;
    margin: -0.5em 0 0 -0.5em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    /* currentColor is transparent above, so force a visible spinner colour. */
    color: #fff;
    animation: nav-spin 0.6s linear infinite;
    opacity: 0.9;
}

/* Links (e.g. "Gallery", "Browse free SVG templates", "Customise & Order") often have coloured
   text/backgrounds; give their spinner a colour that reads on both light and dark controls. */
a.is-loading::after {
    color: currentColor;
    border-color: #594ae2;
    border-right-color: transparent;
}
