/* ==========================================================================
   Shared User Profile Dropdown
   --------------------------------------------------------------------------
   Canonical dropdown markup/styles used on every public DEON page so the
   profile menu looks and behaves identically. Companion script:
   /js/shared-user-dropdown.js
   ========================================================================== */

.user-menu-container {
    position: relative;
    pointer-events: auto;
}

.user-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-btn:hover {
    transform: scale(1.05);
}

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

.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 280px;
    background: var(--bg-dropdown, #141C27);
    background-color: #141C27;
    border: 1px solid var(--dropdown-border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    padding: 16px 0;
    box-shadow: var(--dropdown-shadow, 0 8px 32px rgba(0, 0, 0, 0.4));
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) translateZ(0);
    transition: all 0.2s ease;
    z-index: 10001;
    will-change: transform, opacity;
    isolation: isolate;
    text-align: left;
}

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

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 20px 16px;
}

.dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3AAFD4 0%, #3AAFD4 100%);
    padding: 2px;
    flex-shrink: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

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

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    text-align: left;
    align-items: flex-start;
}

.dropdown-user-name {
    color: var(--text-primary, #F0F0F2);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.dropdown-user-email {
    color: var(--text-secondary, #A0A0A8);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light, rgba(255, 255, 255, 0.1));
    margin: 8px 0;
}

.dropdown-section {
    padding: 4px 0;
}

.dropdown-section-label {
    display: block;
    color: var(--text-section-label, #A0A0A8);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 8px 20px 4px;
    text-transform: uppercase;
    text-align: left;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 12px;
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-tertiary, #F0F0F2);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.dropdown-item:hover {
    background: var(--bg-hover-light, rgba(255, 255, 255, 0.06));
}

.dropdown-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: var(--text-secondary, #A0A0A8);
}

.dropdown-item:hover .dropdown-icon {
    stroke: var(--text-tertiary, #F0F0F2);
}

.dropdown-signout {
    color: #F87171;
}

.dropdown-signout .dropdown-icon {
    stroke: #F87171;
}

.dropdown-signout:hover {
    background: rgba(248, 113, 113, 0.08);
    color: #F87171;
}

/* Light mode overrides */
body.light-mode .user-dropdown {
    background: var(--bg-dropdown, #FFFFFF);
    background-color: #FFFFFF;
    border-color: var(--dropdown-border, #CDD2D8);
    box-shadow: var(--dropdown-shadow, 0 8px 20px rgba(0, 0, 0, 0.10));
}

body.light-mode .dropdown-user-name {
    color: var(--text-primary, #2C333D);
}

body.light-mode .dropdown-user-email {
    color: var(--text-secondary, #59616E);
}

body.light-mode .dropdown-section-label {
    color: var(--text-section-label, #7E8795);
}

body.light-mode .dropdown-item {
    color: var(--text-tertiary, #3D4550);
}

body.light-mode .dropdown-item:hover {
    background: var(--bg-hover-light, rgba(0, 0, 0, 0.04));
}

body.light-mode .dropdown-divider {
    background: var(--border-light, rgba(0, 0, 0, 0.08));
}

body.light-mode .dropdown-icon {
    stroke: var(--text-secondary, #59616E);
}
