/* ==========================================
   Switchboard Core — UserMenu Component CSS
   ==========================================
   v0.31.1: Flyout container + item styles moved to primitives.css
   (.sw-menu-flyout). This file keeps only the trigger button,
   avatar, and sidebar-specific direction overrides.
   ========================================== */

/* ── Wrapper ───────────────────────────────── */

.user-menu-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

/* ── Trigger Button ────────────────────────── */

.user-menu-wrap .user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius, 6px);
    background: none;
    border: none;
    color: var(--text, #eee);
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    transition: background 0.15s;
}

.user-menu-wrap .user-btn:hover {
    background: var(--bg-hover, rgba(255,255,255,0.06));
}

/* ── Avatar ────────────────────────────────── */

.user-menu-wrap .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-dim, rgba(179, 138, 78, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent, #b38a4e);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.user-menu-wrap .user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-menu-wrap .sb-label {
    font-size: 12px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Sidebar overrides ───────────────────── */
/* In sidebar context, flyout pops UP instead of down and uses upward shadow */

.sidebar .user-menu-wrap .sw-menu-flyout {
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
}

/* Sidebar collapsed: hide label, center avatar */
.sidebar.collapsed .user-menu-wrap .user-btn {
    justify-content: center;
    padding: 6px 0;
    gap: 0;
}

.sidebar.collapsed .user-menu-wrap .sb-label {
    display: none;
}

.sidebar.collapsed .user-menu-wrap .sw-menu-flyout {
    position: fixed;
    left: var(--sidebar-rail);
    bottom: 8px;
    top: auto;
    right: auto;
    width: 200px;
    margin-bottom: 0;
}

/* ── Responsive: Mobile ───────────────────── */

@media (max-width: 768px) {
    /* User menu button: ensure 44px touch target */
    .user-menu-wrap .user-btn {
        padding: 8px;
        min-height: 44px;
    }

    /* Flyout: open upward and constrain width */
    .user-menu-wrap .sw-menu-flyout {
        max-width: calc(100vw - 16px);
    }
}
