/**
 * User Dropdown Component Styles
 * Glass Lucent Apple-Style Design
 * Matches brand coral/amber color scheme with iOS animations
 */

/* ============================================
   DROPDOWN CONTAINER
   ============================================ */

#user-menu {
    position: relative;
    display: block;
    overflow: visible;
    z-index: 50;
}

/* Ensure user-menu is visible when not hidden */
#user-menu:not(.hidden) {
    display: block !important;
}

/* ============================================
   DROPDOWN MENU - BASE STATE (Glass Lucent)
   ============================================ */

.user-dropdown {
    /* Positioning */
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    
    /* Sizing */
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    
    /* Glass Lucent Apple Style */
    background: rgba(42, 37, 36, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.1),
                0 0 0 0.5px rgba(0, 0, 0, 0.05);
    
    /* Hidden by default */
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(-8px);
    transform-origin: top right;
    pointer-events: none;
    
    /* Layout */
    overflow: hidden;
    z-index: 60;
    
    /* Ensure dropdown is always above other content */
    position: absolute !important;
    
    /* iOS-style animation */
    transition: opacity 0.3s cubic-bezier(0.33, 1, 0.68, 1),
                visibility 0.3s cubic-bezier(0.33, 1, 0.68, 1),
                transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
}

/* ============================================
   DROPDOWN MENU - ACTIVE STATE
   ============================================ */

.user-dropdown[data-state="open"],
.user-dropdown.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) translateY(0) !important;
    pointer-events: all !important;
}

/* Ensure dropdown is hidden when closed */
.user-dropdown[data-state="closed"] {
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(-8px);
    pointer-events: none;
}

/* ============================================
   USER HEADER SECTION
   ============================================ */

.user-dropdown__header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-dropdown__avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    object-fit: cover !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
}

.user-dropdown__avatar-fallback {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    background: linear-gradient(135deg, #ff6b4a 0%, #ffb347 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
}

.user-dropdown__info {
    flex: 1 !important;
    min-width: 0 !important;
    display: block !important;
}

.user-dropdown__name {
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    color: #faf8f7 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em;
    display: block !important;
    width: 100% !important;
}

.user-dropdown__email {
    font-size: 0.8125rem !important;
    color: #a8a3a0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
    display: block !important;
    width: 100% !important;
}

/* ============================================
   DROPDOWN CONTENT - MENU ITEMS
   ============================================ */

.user-dropdown__content {
    padding: 0.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
}

.user-dropdown__item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    color: #a8a3a0;
    text-decoration: none !important;
    border: none !important;
    background: none;
    cursor: pointer;
    font-size: 0.9375rem !important;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.33, 1, 0.68, 1);
    width: 100% !important;
    text-align: left !important;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.user-dropdown__item:hover {
    color: #faf8f7;
    background: rgba(255, 107, 74, 0.1);
    transform: translateX(2px);
}

.user-dropdown__item:active {
    transform: translateX(2px) scale(0.98);
    background: rgba(255, 107, 74, 0.15);
}

.user-dropdown__item i {
    width: 1.25rem !important;
    text-align: center !important;
    flex-shrink: 0 !important;
    font-size: 1rem !important;
    display: inline-block !important;
}

.user-dropdown__item span {
    flex: 1 !important;
    display: inline-block !important;
}

.user-dropdown__divider {
    height: 1px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    margin: 0.5rem 0 !important;
    border: none !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.user-dropdown .hidden {
    display: none !important;
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .user-dropdown {
        transition: opacity 0.1s ease,
                    visibility 0.1s ease;
    }
    
    .user-dropdown__item {
        transition: color 0.1s ease,
                    background-color 0.1s ease;
    }
    
    .user-dropdown__item:hover {
        transform: none;
    }
}
