/* ============================================================================
   HEADERS — public app & admin top bar
   ============================================================================ */

/* ── Public app header (SESCOM-styled) ─────────────────────────────────── */
/* Translucent white background, dark links, green-on-hover. The active /
   hover indicator is a pseudo-element underline so the row never shifts —
   no padding swap, no border-jump, no opacity flicker.

   Vertical rhythm: 0.85rem padding default, 0.65rem when sescom.js adds the
   `.scrolled` class (more than 16px scrolled). Logo follows the same
   shrink-on-scroll pattern. Mobile cuts the logo to 36px as well. */
.app-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(150%) blur(10px);
    -webkit-backdrop-filter: saturate(150%) blur(10px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: none;
    padding: 0.85rem 0;
    transition: padding 0.22s ease, box-shadow 0.22s ease;
}

.app-header.scrolled {
    padding: 0.65rem 0;
    box-shadow: var(--shadow-sm);
}

/* Brand logo — larger than the default 36px set in base.css for a more
   prominent public-site presence; shrinks on scroll and on small screens. */
.app-header .navbar-brand .app-logo-img {
    max-height: 42px;
    width: auto;
    transition: max-height 0.22s ease;
}

.app-header.scrolled .navbar-brand .app-logo-img {
    max-height: 36px;
}

@media (max-width: 575.98px) {
    .app-header { padding: 0.6rem 0; }
    .app-header .navbar-brand .app-logo-img { max-height: 34px; }
}

.app-header .nav-link {
    color: var(--text-dark) !important;
    font-weight: var(--font-weight-medium);
    padding: 0.5rem 0.9rem !important;
    /* Only color transitions — no transform / opacity / padding tweens. */
    transition: color 0.18s ease;
    position: relative;
}

.app-header .nav-link:hover {
    color: var(--primary-color) !important;
    /* No transform, no opacity change — pure color swap on hover */
}

.app-header .nav-link.public-active,
.app-header .nav-link.active {
    color: var(--primary-color) !important;
    font-weight: var(--font-weight-semibold);
}

/* Underline indicator for the active link — pseudo-element so it doesn't
   reflow surrounding nav items the way a border-bottom would. */
.app-header .nav-link.public-active::after,
.app-header .nav-link.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.app-header .guest-buttons { gap: 0.5rem; }

.app-header .nav-dropdown {
    color: var(--text-dark) !important;
    padding: 0.45rem 0.75rem;
}

/* Dropdown menus on the public navbar — flat panel, branded hover/active
   states, no jump (parent label flips colour the same way standalone
   nav-links do). */
.app-header .nav-item.dropdown .dropdown-toggle::after {
    border-top-color: currentColor;
    margin-left: 0.4rem;
    vertical-align: 0.18em;
}
.app-header .dropdown-menu {
    border-radius: var(--border-radius-md, 10px);
    padding: 0.5rem;
    margin-top: 0.4rem;
    min-width: 12rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--border-light, #f1f5f9);
}
.app-header .dropdown-item {
    padding: 0.55rem 0.85rem;
    border-radius: var(--border-radius-sm, 6px);
    font-weight: 500;
    color: var(--text-dark);
    transition: background 0.16s ease, color 0.16s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.app-header .dropdown-item:hover,
.app-header .dropdown-item:focus {
    background: var(--primary-soft);
    color: var(--primary-color);
}
.app-header .dropdown-item.active,
.app-header .dropdown-item:active {
    background: var(--primary-color);
    color: #fff;
}

/* ── Admin top header ──────────────────────────────────────────────────── */
.admin-header {
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-xs);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    min-height: var(--header-height);
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.admin-header .navbar-toggler {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.35rem 0.55rem;
    background: var(--surface-1);
    color: var(--text-default);
}
.admin-header .navbar-toggler:hover {
    background: var(--surface-2);
    color: var(--text-strong);
}

.admin-header .nav-link {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--border-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    transition: var(--transition-fast);
    color: var(--text-default);
}

.admin-header .nav-link:hover {
    background: var(--surface-2);
    color: var(--primary-color);
}

.admin-header .nav-link.active {
    background: var(--primary-soft);
    color: var(--primary-color) !important;
    font-weight: var(--font-weight-semibold);
}

/* Search slot in the admin header */
.admin-header__search {
    flex: 1;
    max-width: 380px;
    position: relative;
}

.admin-header__search .form-control {
    padding-left: 2.25rem;
    background: var(--surface-2);
    border-color: transparent;
    border-radius: var(--border-radius-pill);
    height: 36px;
}
.admin-header__search .form-control:focus {
    background: var(--surface-1);
    border-color: var(--border-focus);
}
.admin-header__search .bi-search {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Mobile */
@media (max-width: 768px) {
    .admin-header { padding: 0 var(--spacing-md); }
    .admin-header__search { max-width: none; }
}
