/*
 * components/header.css — single source for all .header rules
 *
 * Extracted in M4 from:
 *   main.v28.css   line 1559 (.header .wrapper),
 *                  lines 12321-12349 (.header .login-button family with !important)
 *   index.v13.css  lines 651-665 (.header .login-button — overlaps with main; !important wins)
 *
 * Multi-selector rule at main.v28:419 (.footer, .header, main {padding}) STAYS in main
 *   because it's not pure .header.
 *
 * Loaded AFTER main.v28.css and AFTER index.v13.css to preserve cascade.
 */

/* === Structure === */
.header .wrapper {
    height: 100%;
}

/* === Login button (main.v28 with !important wins over index.v13) === */
.header .login-button {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    padding: 10px 22px !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.header .login-button:hover {
    background: rgba(var(--color-accent-rgb, 184, 58, 58), 0.15) !important;
    border-color: rgba(var(--color-accent-rgb, 184, 58, 58), 0.4) !important;
}

.header .login-button * {
    cursor: pointer !important;
    pointer-events: none !important;
}

.header .login-button span {
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    letter-spacing: 0.5px !important;
    text-transform: capitalize;  /* from index.v13 — main didn't define */
}

.header .login-button svg {
    color: #fff !important;
}

/* === Mobile compact header — squish the balance block + avatar so the
       tenant logo on the left has room. On 360-414px viewports the legacy
       sizing was eating ~70% of the row, hiding the logo entirely. === */
@media (max-width: 600px) {
    /* Balance pill: no rounded "1.5rem" border, less padding, smaller font */
    .header__user-b {
        height: 36px !important;
        padding: 0 8px 0 4px !important;
        margin-right: 6px !important;
        border-radius: 12px !important;
        gap: 3px !important;
    }
    .header__user-b span,
    .header__user-b #balance,
    .header__user-b p {
        font-size: 12px !important;
        line-height: 1 !important;
    }

    /* Wallet "+ Wallet" button — keep icon, hide the word "Wallet" text */
    .header__user-balance-add {
        margin-left: 4px !important;
    }
    .header__user-balance-add a.tf-button {
        padding: 8px 10px !important;
        margin-left: 0 !important;
        gap: 0 !important;
        height: 36px !important;
        min-width: 36px !important;
    }
    .header__user-balance-add a.tf-button span {
        display: none !important;
    }
    .header__user-balance-add a.tf-button svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Avatar / profile block — username hidden. The dropdown chevron
       (rendered by `.theme--dark .header__user-profile:before`, 34×34 bg
       image at right: 6px) keeps its slot on the right. We push the avatar
       further left with a larger right-padding gap, and grow the avatar
       so it's the visual anchor of the block. */
    .header__user-profile {
        margin-left: 4px !important;
        padding-right: 42px !important;  /* gap before the :before chevron */
    }
    .header__user-profile .user-split {
        gap: 0 !important;
        padding: 3px !important;
        background: transparent !important;
        border: 0 !important;
    }
    .header__user-profile .user-split .user-avatar {
        width: 42px !important;
        height: 42px !important;
        border-radius: 12px !important;
        border: 2px solid rgba(var(--color-accent-rgb, 184, 58, 58), 0.45) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.30);
    }
    .header__user-profile .user-split > span {
        display: none !important;
    }

    /* Tighter overall gap so the logo can claim its space back */
    .header__user.d-flex.align-center.justify-space-between {
        gap: 4px !important;
    }
}

/* === Very small phones (≤360px): hide logo entirely so header doesn't overflow === */
@media (max-width: 360px) {
    .header__logo--full,
    .header__logo--icon {
        display: none !important;
    }
    .header__logo-link {
        display: none !important;
    }
}

/* === Small PC (1126–1600px): balance + profile buttons scale down to match compact nav links === */
@media only screen and (max-width: 1600px) and (min-width: 1126px) {
    .header__user-b {
        height: 40px !important;
        padding: 0 12px 0 5px !important;
    }
    .header__user-b span,
    .header__user-b #balance,
    .header__user-b p {
        font-size: 13px !important;
    }
    .header__user-balance-add a.tf-button {
        height: 40px !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
    .header__user-profile {
        height: 40px !important;
    }
    .header__user-profile .user-split .user-avatar {
        width: 30px !important;
        height: 30px !important;
    }
}
@media only screen and (max-width: 1344px) and (min-width: 1126px) {
    .header__user-b {
        height: 36px !important;
        padding: 0 10px 0 4px !important;
    }
    .header__user-b span,
    .header__user-b #balance,
    .header__user-b p {
        font-size: 12px !important;
    }
    .header__user-balance-add a.tf-button {
        height: 36px !important;
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
    .header__user-profile {
        height: 36px !important;
    }
    .header__user-profile .user-split .user-avatar {
        width: 26px !important;
        height: 26px !important;
    }
}

/* === Mobile bottom menus: solid background fallback for small phones where
       backdrop-filter (liq-effect) is unreliable on iOS Safari.
       On larger phones the effect renders fine; ≤420px gets a solid base. === */
@media (max-width: 420px) {
    .mobile-navbar {
        background: rgba(13, 18, 32, 0.97) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        backdrop-filter: blur(12px) !important;
    }
    .theme--dark .mobile-navbar {
        background: rgba(13, 18, 32, 0.97) !important;
    }
    /* The liq-effect wrapper inside — keep its own blur but also reinforce bg */
    .mobile-navbar .mobile-navbar__wrapper,
    .mobile-navbar .liq-effect {
        background: transparent !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    .mobile-navbar .mobile-navbar__wrapper::before,
    .mobile-navbar .liq-effect::before {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}
