/* =====================================================
   INRADR Design System — Status bar (custom template footer, M3)
   inradr-design layer · own inradr-* classes and --inradr-* tokens only.

   Plain HTML as in inradr-app (its inradr-features/inradr-footer.css, ClickUp 86c934q8h; owner decision 2026-10-01):
   left the session context (user | tenant), in the middle the live status, right the application (© year company |
   version | privacy policy | support | "Hilfe"). Items are separated by " | " in 60% white, links are underlined
   and light up in the light accent, "Hilfe" is a button that looks like the links. No icons.
   The footer stays a normal flex row of the shell with a token height (--inradr-height-footer), so it does NOT break
   the content height chain (inradr-shell.css). Message states fill the whole row (strong status tones keep the
   white text readable). Focus ring white on navy (OQ-02; inradr-app used the accent).
   ===================================================== */

.inradr-footer {
    flex: 0 0 var(--inradr-height-footer);
    height: var(--inradr-height-footer);
    display: flex;
    align-items: center;
    gap: var(--inradr-space-md);
    min-width: 0;
    padding: 0 var(--inradr-space-sm);
    background: var(--inradr-color-navy);
    color: var(--inradr-color-text-on-navy);
    border-top: 1px solid var(--inradr-color-divider-on-navy);
    z-index: var(--inradr-layer-footer);
    font-family: var(--inradr-font-body);
    font-size: var(--inradr-text-body-size);
    line-height: var(--inradr-text-body-line-height);
    white-space: nowrap;
    overflow: hidden;
}

/* --- groups: user | tenant, and © | version | privacy | support | help --- */
.inradr-statusbar__group {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;

    & > li {
        min-width: 0;
    }

    /* " | " between items; the empty alternative text keeps it silent for screen readers. */
    & > li + li::before {
        content: "|";
        content: "|" / "";
        margin: 0 calc(var(--inradr-space-xs) + var(--inradr-space-xxs) / 2);
        color: var(--inradr-color-separator-on-navy);
    }
}

.inradr-statusbar__group--user {
    flex: 0 1 auto;

    /* Only text here, so clipping cannot cut off a link's focus ring. */
    & > li {
        max-width: 320px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.inradr-statusbar__group--app {
    flex: 0 0 auto;
    margin-left: auto;
}

/* --- live status: busy spinner, message, progress --- */
.inradr-statusbar__status {
    display: flex;
    align-items: center;
    gap: var(--inradr-space-xs);
    flex: 1 1 auto;
    min-width: 0;
}

.inradr-statusbar__message {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Busy spinner: the small on-navy variant of .inradr-spinner, sharing its rotation (@keyframes inradr-spin,
   inradr-spinner.css). */
.inradr-footer-spinner {
    display: inline-block;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border: 2px solid color-mix(in srgb, var(--inradr-color-text-on-navy) 30%, transparent);
    border-top-color: var(--inradr-color-accent);
    border-radius: var(--inradr-radius-full);
    animation: inradr-spin 0.8s linear infinite;
}

/* --- links, "Hilfe", "Support" and the version that opens the release notes --- */
.inradr-footer a,
.inradr-footer .inradr-statusbar__help,
.inradr-footer .inradr-statusbar__support,
.inradr-footer .inradr-statusbar__version-button {
    color: var(--inradr-color-text-on-navy);
    text-decoration: underline;
    cursor: pointer;

    /* The light accent: the hover accent on navy stays below WCAG AA. */
    &:hover,
    &:focus-visible {
        color: var(--inradr-color-accent-light);
    }

    &:focus-visible {
        outline: 2px solid var(--inradr-color-text-on-navy);
        outline-offset: 2px;
        border-radius: var(--inradr-radius-xs);
    }
}

/* "Hilfe", "Support" and the version are buttons that look like the links: no browser look, the footer's font and colour. */
.inradr-footer .inradr-statusbar__help,
.inradr-footer .inradr-statusbar__support,
.inradr-footer .inradr-statusbar__version-button {
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
}

/* --- release notes: the body of the popup the version opens (OpenSpec add-release-notes). The popup is not inside
   the footer, so these rules are not scoped to it. One block per version, newest first: version, date and the
   "aktuell" badge, then the sections as compact lists. --- */
.inradr-release-notes {
    display: flex;
    flex-direction: column;
    gap: var(--inradr-space-md);
    color: var(--inradr-color-text-primary);
    font-size: var(--inradr-text-body-size);
    line-height: var(--inradr-text-body-line-height);
}

.inradr-release-notes__version {
    display: flex;
    flex-direction: column;
    gap: var(--inradr-space-xs);
}

.inradr-release-notes__heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--inradr-space-xs);
    margin: 0;
    font-size: var(--inradr-text-h3-size);
    font-weight: var(--inradr-text-body-strong-weight);
    line-height: var(--inradr-text-h3-line-height);
}

.inradr-release-notes__date {
    color: var(--inradr-color-text-secondary);
    font-size: var(--inradr-text-caption-size);
    font-weight: var(--inradr-text-caption-weight);
}

.inradr-release-notes__section {
    margin: 0;
    font-size: var(--inradr-text-list-header-size);
    font-weight: var(--inradr-text-list-header-weight);
    line-height: var(--inradr-text-caption-line-height);
}

.inradr-release-notes__entries {
    margin: 0;
    padding-left: var(--inradr-space-sm);
}

.inradr-release-notes__empty {
    margin: 0;
    color: var(--inradr-color-text-secondary);
}

/* --- message states: the whole row takes the state's strong fill --- */
.inradr-footer.inradr-footer--success { background: var(--inradr-color-status-ok-strong-bg); }
.inradr-footer.inradr-footer--warning { background: var(--inradr-color-status-warn-strong-bg); }
.inradr-footer.inradr-footer--error   { background: var(--inradr-color-status-danger-strong-bg); }

/* --- narrow windows, as in inradr-app --- */
@media (max-width: 991px) {
    .inradr-statusbar__copyright,
    .inradr-statusbar__version {
        display: none;
    }

    /* The first visible application item does not start with a separator. */
    .inradr-statusbar__group > .inradr-statusbar__copyright + li::before,
    .inradr-statusbar__group > .inradr-statusbar__version + li::before {
        content: none;
    }
}

@media (max-width: 768px) {
    .inradr-footer {
        gap: var(--inradr-space-2xs);
        padding: 0 var(--inradr-space-xs);
    }

    .inradr-statusbar__group--user > li {
        max-width: 140px;
    }

    .inradr-statusbar__group > li + li::before {
        margin: 0 calc(var(--inradr-space-xxs) + var(--inradr-space-xxs) / 2);
    }
}
