/* Global Profile Button Styles */
/* Based on the original cooking_main.html profile button design */

.global-profile-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.2s ease;
    min-width: 200px;
    height: 44px;
    position: relative;
}

.global-profile-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.global-profile-button:active {
    transform: translateY(0);
}

/* Profile Avatar - restored original design */
.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

/* Profile Info - restored original column layout */
.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.profile-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.profile-role {
    font-size: 0.75rem;
    opacity: 0.7;
    line-height: 1;
    color: white;
}

/* Profile Arrow - restored original styling */
.profile-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.6;
    color: white;
    transition: opacity 0.2s ease;
}

.global-profile-button:hover .profile-arrow {
    opacity: 0.8;
}

/* Loading State */
.profile-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    opacity: 0.9;
}

.profile-loading i {
    font-size: 14px;
}

/* Error State */
.profile-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #ffeb3b;
}

.profile-error i {
    font-size: 14px;
}

/* Dropdown Styles - updated for better contrast */
.global-profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    background: #2c3e50 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    width: max-content;
    max-width: 220px;
    z-index: 10001;
    overflow: hidden;
}

.global-profile-dropdown::before {
    display: none; /* Remove arrow pointer for cleaner look */
}

.global-profile-dropdown .dropdown-item {
    display: flex !important;
    align-items: center;
    padding: 12px 16px;
    color: #ecf0f1 !important;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    gap: 8px;
    background: transparent !important;
    border: none !important;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.global-profile-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.global-profile-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.global-profile-dropdown .dropdown-item i {
    margin-right: 0;
    width: 16px;
    color: #bdc3c7 !important;
}

.global-profile-dropdown .dropdown-item:hover i {
    color: #fff !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .global-profile-button {
        min-width: 120px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .profile-avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
        margin-right: 8px;
    }
    
    .profile-name {
        font-size: 13px;
        max-width: 60px;
    }
    
    .profile-role {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .global-profile-button {
        min-width: 100px;
        padding: 5px 8px;
    }
    
    .profile-info {
        display: none;
    }
    
    .profile-avatar {
        margin-right: 4px;
    }
    
    .profile-arrow {
        margin-left: 4px;
    }
}

/* Integration with existing page styles */
.user-section {
    position: relative;
    display: flex;
    align-items: center;
}

/* Ensure proper positioning in navigation areas */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Note: #userProfileContainer styles are defined inline on each page
   to allow different positioning strategies (flex for hub, fixed for events) */

/* Dark theme compatibility */
@media (prefers-color-scheme: dark) {
    .global-profile-dropdown {
        background: #2d3748;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .global-profile-dropdown::before {
        background: #2d3748;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-item {
        color: #e2e8f0;
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }
    
    .dropdown-item:hover {
        background-color: #4a5568;
        color: #90cdf4;
    }
    
    .dropdown-item i {
        color: #a0aec0;
    }
    
    .dropdown-item:hover i {
        color: #90cdf4;
    }
}