/**
 * User Dropdown Menu
 *
 * Shared component for user account dropdown in both public
 * pages header and application header.
 *
 * @package NowBiz
 * @since 1.0.0
 */

/* ==========================================================================
   User Dropdown Menu
   ========================================================================== */

.nb-user-dropdown {
    position: relative;
}

.nb-user-dropdown__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--nowbiz-text, #1a1a1a);
    transition: all 0.3s ease;
}

.nb-user-dropdown__trigger:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
}

.nb-user-dropdown__name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nb-user-dropdown__arrow {
    transition: transform 0.3s ease;
}

.nb-user-dropdown.is-open .nb-user-dropdown__arrow {
    transform: rotate(180deg);
}

.nb-user-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.nb-user-dropdown.is-open .nb-user-dropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nb-user-dropdown__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 0.9375rem;
    color: var(--nowbiz-text, #1a1a1a);
    text-decoration: none;
    transition: background 0.2s ease;
}

.nb-user-dropdown__item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.nb-user-dropdown__icon {
    font-size: 1rem;
    line-height: 1;
}

.nb-user-dropdown__divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 8px 0;
}

.nb-user-dropdown__item--logout {
    color: #dc2626;
}

.nb-user-dropdown__item--logout:hover {
    background: #fef2f2;
}

/* Dark mode support for application pages */
[data-theme="dark"] .nb-user-dropdown__trigger {
    color: var(--nowbiz-text-dark, #f5f5f5);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .nb-user-dropdown__trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .nb-user-dropdown__menu {
    background: var(--nowbiz-surface-dark, #2a2a2a);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nb-user-dropdown__item {
    color: var(--nowbiz-text-dark, #f5f5f5);
}

[data-theme="dark"] .nb-user-dropdown__item:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .nb-user-dropdown__divider {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nb-user-dropdown__item--logout {
    color: #f87171;
}

[data-theme="dark"] .nb-user-dropdown__item--logout:hover {
    background: rgba(220, 38, 38, 0.15);
}
