/**
 * Logged-In User Header Fixes
 * Center alignment and proper spacing
 */

/* Fix header-right alignment when user is logged in */
body.user-logged-in .header-right {
    justify-content: flex-end;
    min-width: 200px;
}

/* Ensure user dropdown is properly positioned */
body.user-logged-in .user-dropdown {
    display: flex;
    align-items: center;
}

/* Center the navigation properly when logged in */
body.user-logged-in .header-center {
    display: flex;
    justify-content: center;
    flex: 1;
}

/* Make sure login button is hidden when logged in */
body.user-logged-in .login-btn,
body.user-logged-in #header-login-btn {
    display: none !important;
}

/* Ensure user info is visible when logged in */
body.user-logged-in .user-dropdown,
body.user-logged-in #header-user-info {
    display: flex !important;
}

/* Fix user avatar button alignment */
.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 42px;
}

.user-avatar-btn:hover {
    background: rgba(255, 107, 53, 0.15);
    border-color: rgba(255, 107, 53, 0.5);
}

body[data-theme*="light"] .user-avatar-btn {
    background: rgba(255, 107, 53, 0.08);
    border-color: rgba(255, 107, 53, 0.25);
}

body[data-theme*="light"] .user-avatar-btn:hover {
    background: rgba(255, 107, 53, 0.12);
    border-color: rgba(255, 107, 53, 0.4);
}

/* User avatar image styling */
.user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* User name in header */
.user-name-header {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body[data-theme*="light"] .user-name-header {
    color: #111827;
}

/* Dropdown arrow */
.dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform 0.2s ease;
    margin-left: 2px;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .user-name-header {
        display: none; /* Hide name on mobile, show only avatar */
    }
    
    .user-avatar-btn {
        padding: 6px;
        min-width: 42px;
    }
    
    .dropdown-arrow {
        display: none; /* Hide arrow on mobile */
    }
    
    /* Adjust header spacing on mobile */
    body.user-logged-in .header-right {
        min-width: unset;
        gap: 8px;
    }
    
    body.user-logged-in .header-left {
        min-width: unset;
    }
}

/* Medium screens */
@media (max-width: 1024px) and (min-width: 769px) {
    .user-name-header {
        max-width: 100px;
    }
}
