/*
 * Impersonation banner.
 *
 * Hand-written rather than Tailwind utilities: index.html does not link the Blazor
 * CSS-isolation bundle, so a scoped .razor.css file would not reliably reach the browser.
 * A plain stylesheet linked from index.html always does.
 *
 * The banner must never be invisible while an impersonation token is held: nothing here
 * depends on a theme class or a media query, and the bar is opaque in every theme.
 */

.vt-imp-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2147483000;
    box-sizing: border-box;
    height: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0 0.625rem;
    background: #7f1d1d;
    color: #ffffff;
    font-family: var(--font-sans, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif);
    font-size: 0.8125rem;
    line-height: 1.15;
    border-bottom: 2px solid #fca5a5;
}

.vt-imp-banner__icon {
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
}

.vt-imp-banner__tag {
    flex: 0 0 auto;
    background: #ffffff;
    color: #7f1d1d;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.vt-imp-banner__text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vt-imp-banner__exit {
    flex: 0 0 auto;
    background: #ffffff;
    color: #7f1d1d;
    font-size: 0.75rem;
    font-weight: 700;
    border: 0;
    border-radius: 0.25rem;
    padding: 0.3125rem 0.625rem;
    cursor: pointer;
}

.vt-imp-banner__exit:hover:not(:disabled) {
    background: #fee2e2;
}

.vt-imp-banner__exit:disabled {
    opacity: 0.6;
    cursor: default;
}

/*
 * Making room for the bar.
 *
 * MainLayout pins its own chrome with fixed/absolute positioning, so padding on a wrapper
 * would not move any of it. These rules re-anchor each piece by exactly the banner's height
 * (2.5rem), and only while MainLayout's root carries .vt-imp-shift. This file is linked after
 * app.min.css, so they win on both specificity and order.
 */

.vt-imp-shift > header,
.vt-imp-shift > aside {
    top: 2.5rem;
}

/* Mobile: the top bar is the first in-flow child, so a margin pushes the whole column down.
   It is display:none at lg, where the rules above take over. */
.vt-imp-shift > .vt-imp-mobilebar {
    margin-top: 2.5rem;
}

/* The full-bleed live-tracking main is absolute inset-0 at every breakpoint. */
.vt-imp-shift > .vt-imp-main-full {
    top: 2.5rem;
}

/* The ordinary main is in flow below the mobile bar until lg, where it becomes
   absolute under the 3.5rem header - which the banner pushes to 3.5rem + 2.5rem. */
@media (min-width: 1024px) {
    .vt-imp-shift > .vt-imp-main {
        top: 6rem;
    }
}
