/* ========================================================================
   Header Menubar
   Use INSIDE a page's colored .xxx-page-header block to render a secondary
   row of action buttons (with optional hover-dropdowns) under the title.

   Markup example:
     <div class="xxx-page-header">
         <div class="container-fluid px-4">
             ... title + date row ...
             <div class="header-menubar">
                 <button class="menubar-btn" @onclick="...">
                     <i class="bi bi-plus-circle me-1"></i> Add Item
                 </button>
                 <div class="menubar-item">
                     <button class="menubar-btn">...</button>
                     <div class="menubar-dropdown">
                         <button class="dropdown-item">
                             <i class="bi bi-..."></i> Option
                             <span class="dropdown-hint">sub-label</span>
                         </button>
                     </div>
                 </div>
             </div>
         </div>
     </div>
   ======================================================================== */

.header-menubar {
    display: flex;
    gap: 0;
    margin-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 0.3rem;
    flex-wrap: wrap;
}

/* Bottom padding on all page-headers lives in headers.css (tight 0.5rem to hug the menubar).
   When a page-header has NO menubar, bump the bottom padding so the subtitle has breathing
   room instead of hugging the banner edge. */
.page-header:not(:has(.header-menubar)),
.events-header:not(:has(.header-menubar)),
.admin-header:not(:has(.header-menubar)),
.credit-header:not(:has(.header-menubar)),
.inquiry-header:not(:has(.header-menubar)),
.inventory-header:not(:has(.header-menubar)),
.event-tracker-page-header:not(:has(.header-menubar)),
.manage-clients-page-header:not(:has(.header-menubar)),
.daily-cash-header:not(:has(.header-menubar)),
.tax-header:not(:has(.header-menubar)),
.reports-header:not(:has(.header-menubar)),
.league-schedules-page-header:not(:has(.header-menubar)),
.league-dates-page-header:not(:has(.header-menubar)),
.clover-header:not(:has(.header-menubar)) {
    padding-bottom: 1.1rem;
}

.menubar-item {
    position: relative;
}

.menubar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm, 0.375rem);
    transition: all 0.15s ease;
    letter-spacing: 0.01em;
}

.menubar-btn:hover,
.menubar-btn:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.menubar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.menubar-btn:disabled:hover {
    background: transparent;
}

.menubar-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.35rem;
    z-index: 1000;
    animation: menuDropIn 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menuDropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.menubar-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: #333;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: var(--radius-sm, 0.375rem);
    transition: all 0.12s ease;
    text-align: left;
}

.menubar-dropdown .dropdown-item:hover:not(:disabled) {
    background: rgba(var(--brand-primary-rgb, 13, 110, 253), 0.08);
    color: var(--brand-primary, #0d6efd);
}

.menubar-dropdown .dropdown-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.menubar-dropdown .dropdown-item i {
    width: 1.2rem;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
}

.menubar-dropdown .dropdown-hint {
    margin-left: auto;
    font-size: 0.68rem;
    color: #999;
    padding-left: 1rem;
}

.menubar-dropdown .dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0.25rem 0.5rem;
}

/* Dark mode */
[data-theme="dark"] .menubar-dropdown {
    background: #2a2a2e;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .menubar-dropdown .dropdown-item {
    color: #e0e0e0;
}

[data-theme="dark"] .menubar-dropdown .dropdown-item:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

[data-theme="dark"] .menubar-dropdown .dropdown-hint {
    color: #777;
}

[data-theme="dark"] .menubar-dropdown .dropdown-divider {
    background: rgba(255, 255, 255, 0.08);
}

/* Mobile */
@media (max-width: 640px) {
    .header-menubar {
        margin-top: 0.4rem;
        padding-top: 0.35rem;
    }

    .menubar-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .menubar-dropdown {
        min-width: 200px;
    }
}
