/* ═══════════════════════════════════════════════════════════════════════
   User Menu v3 — clean, minimal dropdown
   ═══════════════════════════════════════════════════════════════════════ */

/* ===== Container ===== */
.user-menu-dropdown {
    position: relative;
}

/* ===== Avatar Button ===== */
.btn-user,
.nav-pill__avatar {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    outline: none;
    -webkit-tap-highlight-color: transparent;
    font-family: 'DM Sans', system-ui, sans-serif;
}

.btn-user:hover,
.nav-pill__avatar:hover {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-user:active,
.nav-pill__avatar:active {
    transform: scale(0.95);
}

.user-initial {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    user-select: none;
}


/* ===== Dropdown Panel ===== */
.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: -6px;
    width: 240px;
    background: #fff;
    border-radius: 12px;
    z-index: 1001;
    overflow: hidden;
    padding: 6px;

    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transform-origin: top right;
    transition:
        opacity 0.15s ease,
        visibility 0.15s ease,
        transform 0.15s ease;

    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.06),
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 12px 32px rgba(0, 0, 0, 0.05);
}

.user-menu::before { display: none; }

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* ===== User Header ===== */
.user-header {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: none;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 4px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.user-avatar-letter { line-height: 1; }

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'DM Sans', system-ui, sans-serif;
}

.user-email {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ===== Menu Sections ===== */
.user-menu-section {
    padding: 2px 0;
    border-bottom: 1px solid #f1f5f9;
}

.user-menu-section:last-child {
    border-bottom: none;
}

.user-menu-section-label {
    display: none;
}


/* ===== Menu Links ===== */
.user-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.user-links li { margin: 0; }

.user-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: background 0.1s ease, color 0.1s ease;
    border-radius: 7px;
    position: relative;
    font-family: 'DM Sans', system-ui, sans-serif;
}

.user-links li a:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.user-links li a:active {
    background: #e2e8f0;
}

.user-links li a i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    transition: color 0.1s ease;
    flex-shrink: 0;
}

.user-links li a:hover i {
    color: #475569;
}


/* Keyboard shortcut hint */
.menu-shortcut {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: #cbd5e1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 5px;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Mono', monospace;
}

/* Divider */
.user-links .divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}


/* ===== Logout ===== */
.logout-link,
.logout-link:visited {
    color: #64748b !important;
}

.logout-link:hover {
    color: #ef4444 !important;
    background: #fef2f2 !important;
}

.logout-link i {
    color: #94a3b8 !important;
}

.logout-link:hover i {
    color: #ef4444 !important;
}


/* ===== Overlay ===== */
.user-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.user-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* ===== Mobile — slide-in panel ===== */
@media (max-width: 768px) {
    .user-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto;
        width: 280px;
        max-width: 85vw;
        height: 100%;
        border-radius: 0;
        border: none;
        border-left: 1px solid #f1f5f9;
        background: #ffffff;
        padding: 8px;

        opacity: 1;
        visibility: visible;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);

        box-shadow:
            -4px 0 24px rgba(0, 0, 0, 0.08),
            -16px 0 48px rgba(0, 0, 0, 0.04);
    }

    .user-menu.active {
        transform: translateX(0);
    }

    .user-menu::before { display: none; }

    .user-header {
        padding: 14px 10px;
    }

    .user-menu-overlay {
        background: rgba(0, 0, 0, 0.12);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }
}


/* ===== Small phones ===== */
@media (max-width: 400px) {
    .btn-user,
    .nav-pill__avatar {
        width: 30px;
        height: 30px;
    }

    .user-initial {
        font-size: 12px;
    }
}
