/**
 * User Avatar & Dropdown Styles
 * Bottom-left positioned avatar with dropdown menu
 */

/* Avatar Container */
.user-avatar-container {
    position: fixed;
    bottom: 105px; /* Moved up from 75px to avoid legal text overlap */
    left: 30px;
    z-index: 1000;
}

/* Avatar Button */
.user-avatar-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7ef8ec 0%, #b3e3bc 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
    padding: 0;
}

.user-avatar-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(126, 248, 236, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

.user-avatar-button.active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.avatar-initial {
    color: white;
    font-size: 20px;
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-transform: uppercase;
    user-select: none;
}

/* Dropdown Menu */
.user-dropdown {
    position: absolute;
    bottom: 60px;
    left: 0;
    min-width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(126, 248, 236, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* Show state for dropdown */
.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* Dropdown Header */
.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(126, 248, 236, 0.2);
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7ef8ec 0%, #b3e3bc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropdown-initial {
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
}

.dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.dropdown-user-name {
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-user-email {
    color: rgba(0, 0, 0, 0.6);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dropdown Menu */
.dropdown-menu {
    padding: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(0, 0, 0, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    outline: none;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #7ef8ec 0%, #b3e3bc 100%);
    color: #ffffff;
}

.dropdown-item:focus-visible {
    background: linear-gradient(135deg, #7ef8ec 0%, #b3e3bc 100%);
    color: #ffffff;
    outline: 2px solid rgba(126, 248, 236, 0.5);
    outline-offset: -2px;
}

.dropdown-icon {
    display: none; /* Hide all dropdown icons */
}

.logout-item {
    color: rgba(220, 53, 69, 0.9);
}

.logout-item:hover {
    background: linear-gradient(135deg, #7ef8ec 0%, #b3e3bc 100%);
    color: #ffffff;
}

/* Divider */
.dropdown-divider {
    height: 1px;
    background: rgba(126, 248, 236, 0.2);
    margin: 8px 0;
}

/* Desktop Adjustments - Move avatar lower */
@media (min-width: 769px) {
    .user-avatar-container {
        bottom: 80px; /* Aligned horizontally with toggle button for desktop */
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .user-avatar-container {
        bottom: 50px; /* Moved up from 20px to avoid legal text overlap */
        left: 20px;
    }

    .user-avatar-button {
        width: 40px;
        height: 40px;
    }

    .avatar-initial {
        font-size: 18px;
    }

    .user-dropdown {
        min-width: 250px;
        bottom: 85px; /* Moved up to align with new avatar position */
    }

    /* On mobile, show dropdown as bottom sheet */
    @media (max-height: 600px) {
        .user-dropdown {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            border-radius: 16px 16px 0 0;
            max-height: 70vh;
            overflow-y: auto;
        }
    }
}


/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    .user-avatar-button {
        border-width: 3px;
    }

    .dropdown-item:focus-visible {
        outline-width: 3px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .user-avatar-button,
    .user-dropdown,
    .dropdown-item {
        transition: none;
    }
}