/*
 * Ladeanzeige für den In-Place-Content-Wechsel (UpdatePortalContent in core.js).
 *
 * - #portal-progress: schmale Fortschrittsleiste am oberen Fensterrand (wie bei
 *   YouTube/GitHub). Wird per JS erzeugt, mit .is-active sichtbar und läuft bis
 *   ca. 80 %; beim Abschluss auf 100 % und ausgeblendet.
 * - #content.is-loading: alter Inhalt wird leicht abgedunkelt und gesperrt, bis
 *   das neue Fragment eingesetzt ist (Verzögerung, damit schnelle Antworten nicht
 *   flackern). Optisch angelehnt an .gridjs-loading-bar der Tabellen.
 */
#portal-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--bs-primary, #405189);
    box-shadow: 0 0 8px var(--bs-primary, #405189);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: width .3s ease, opacity .3s ease .2s;
}

#portal-progress.is-active {
    opacity: 1;
    width: 80%;
    /* langsamer Anstieg, solange die Antwort ausbleibt */
    transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .1s ease;
}

#portal-progress.is-done {
    opacity: 0;
    width: 100%;
    transition: width .2s ease, opacity .3s ease .2s;
}

#content {
    position: relative;
    transition: opacity .2s ease .15s;
}

#content.is-loading {
    opacity: .5;
    pointer-events: none;
    user-select: none;
}

#content.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(90deg, hsla(0, 0%, 80%, 0), hsla(0, 0%, 80%, .2) 20%, hsla(0, 0%, 80%, .5) 60%, hsla(0, 0%, 80%, 0));
    transform: translateX(-100%);
    animation: portal-shimmer 2s infinite;
    pointer-events: none;
}

@keyframes portal-shimmer {
    100% {
        transform: translateX(100%);
    }
}
