/* ============================================================
   App header (brand bar)
   Global overrides for the shared Sva.Interface AppHeader / LoginDisplay
   components. Kept global (not scoped) because the header styles
   child components (LoginDisplay, RadzenIcon) that scoped CSS
   can't reach without ::deep. Base layout lives in
   _content/Sva.Interface/css/shared.css; this file applies the brand look.
   ============================================================ */

/* Override shared.css header: solid navy brand bar */
.header-container {
    background: var(--color-primary) !important;
    color: var(--color-text-on-primary) !important;
    padding: 0 16px !important;
    height: 48px !important;
    min-height: 48px !important;
}

.header-container img {
    padding: 0 !important;
    height: 48px !important;
    width: auto !important;
    display: block;
}

.header-container .app-logo img {
    filter: brightness(0) invert(1);
    height: 28px !important;
}

/* Brand logo in header-left: full wordmark on desktop, mark only on phones.
   Whole logo links to the home page (see AppHeader.razor). */
.header-container .app-logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-container .app-logo .app-logo--mark {
    display: none;
}

@media (max-width: 640px) {
    .header-container .app-logo .app-logo--full {
        display: none;
    }

    .header-container .app-logo .app-logo--mark {
        display: block;
    }

    /* On a subpage the back arrow (now grouped with the title) is the "where am
       I / how to leave" affordance, so the logo is redundant — hide it on phones
       and give the title that room. Top-level pages keep the mark. */
    .header-container--subpage .app-logo {
        display: none;
    }
}

.header-container .header-text,
.header-container .rz-text-secondary-color {
    color: var(--color-text-on-primary) !important;
}

/* Ensure the Radzen separator uses a light border on the brand header */
.header-container .rz-separator {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* ============================================================
   Header three-zone layout: logo + greeting | title | actions
   ============================================================ */
.header-container .header-left,
.header-container .header-right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.header-container .header-right {
    justify-content: flex-end;
    gap: 1.25rem;
}

.header-container .header-center {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
}

.header-greeting {
    color: var(--color-text-on-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
    white-space: nowrap;
}

.header-title {
    color: var(--color-text-on-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bare white action icons (notification bell, video shortcut) */
.header-container .header-action {
    color: var(--color-text-on-primary);
    cursor: pointer;
    font-size: 1.5rem;
}

/* In-header back arrow is mobile-only; on desktop the browser's own back
   button handles it, so we keep the top bar clean (revealed in the mobile
   @media block below). */
.header-container .header-back {
    display: none;
}

.header-container .header-action:hover {
    opacity: 0.8;
}

/* Disabled placeholder icon (e.g. notifications until the modal exists) */
.header-container .header-action--disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* Login display sits in the right zone: white text/icons, bare logout button */
.header-container .login-display {
    color: var(--color-text-on-primary);
    gap: 0.5rem;
}

.header-container .login-display .user-name {
    color: var(--color-text-on-primary);
    margin-right: 0.25rem;
}

.header-container .login-display .rz-button {
    background: transparent !important;
    color: var(--color-text-on-primary) !important;
    box-shadow: none !important;
}

/* ============================================================
   Mobile header layout (Material-style title bar)
   NOTE: this block must come AFTER the base three-zone rules
   above. A @media query adds no specificity, so if these
   overrides were declared earlier the later base rules
   (flex: 1 1 0 / justify-content: center) would win and the
   title would fall back to a centered third and truncate.
   ============================================================ */
@media (max-width: 640px) {
    /* Back arrow at the far left, title left-aligned immediately after it,
       actions tight on the right. Side zones shrink to their content so the
       title can grow into the whole middle instead of being capped at a third. */
    .header-container .header-left,
    .header-container .header-right {
        flex: 0 0 auto;
    }

    .header-container .header-right {
        gap: 0.75rem;
    }

    .header-container .header-center {
        flex: 1 1 auto;
        justify-content: flex-start;
        padding-left: 0.5rem;
    }

    /* Slightly smaller title on phones so longer titles fit the narrower bar
       before the ellipsis ever kicks in. */
    .header-title {
        font-size: var(--font-size-base);
    }

    /* Show the in-header back arrow on phones (no browser chrome to rely on). */
    .header-container .header-back {
        display: inline-flex;
        align-items: center;
    }
}
