.user_section {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: left;
    font-family: var(--font-family);
    box-sizing: border-box;
    position: relative;
    margin-top: auto; /* Push to bottom */
    margin-bottom: 0;
    padding-left: 5px;
    padding-bottom: 7px;
    padding-right: 5px;
    flex-shrink: 0;
    max-height: fit-content;
    overflow: visible;
    contain: layout;
}

.user_info {
    display: flex;
    flex-direction: left;
    align-items: center;
    
    gap: 12px;
    width: 100%;
    border-top-right-radius: 25px;
    border-bottom-right-radius  : 25px;
    padding: 0 3px 0 15px;

    opacity: 1;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease-in-out;



}

.user_info.notClickable {
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    background-color: var(--color-secondary, rgba(0, 0, 0, 0.05)); /* Compensate for padding to maintain original size */
}

.user_info.clickable {
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    background-color: none; /* Compensate for padding to maintain original size */
}

.user_info.clickable:hover {
    background-color: var(--color-secondary, rgba(0, 0, 0, 0.05));
}

.user_header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    transition: justify-content 0.3s ease;
    padding: 0 3px 0 15px;

}

.user_avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.text_content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;

    white-space: nowrap;
    overflow: hidden;
    opacity: 0; /* Start hidden */
    animation: delayedFadeIn 0.3s ease-in-out forwards; /* 0.3s delay + 0.3s fade in */
}

.username {
    font-size: 0.8rem !important;
    color: var(--color-text) !important;
    font-style: italic;

    
}

.logout_popup {
    position: absolute;
    bottom: 100%;
    left: 0px;
    right: 10px;
    background: var(--color-primary);
    border: none;
    border-top-right-radius: 25px;
    border-bottom-right-radius: 25px;
    z-index: 10;
    margin-bottom: 8px;
    overflow: hidden;
}

.logout_menu_button {
    width: 100%;
    padding: 12px 25px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: #181818;
    display: flex;
    align-items: center;
    gap: 8px;

}

.logout_menu_button:hover:not(:disabled) {
    background-color: var(--color-hover, rgba(0, 0, 0, 0.05));
}

.logout_menu_button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.logout_icon {
    font-size: 0.9rem;
    color: var(--color-gray);
}

.user_section h1 {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.;
    color: var(--color-text);
    font-family: var(--font-family);
    font-weight: 400;
    opacity: 0; /* Start hidden */
    animation: delayedFadeIn 0.3s ease-in-out forwards; /* 0.3s delay + 0.3s fade in */
    white-space: nowrap;

}

.user_section p {
    margin: 0;
    font-family: var(--font-family);
    opacity: 0; /* Start hidden */
    animation: delayedFadeIn 0.3s ease-in-out forwards; /* 0.3s delay + 0.3s fade in */
    white-space: nowrap;
}

.userContainer {
    padding: 12px;
    text-align: center;
    color: transparent;
    background-color: transparent;
    border: transparent;
}

/* Minimized User Section Styles */
.user_section.minimized {
    width: 100%; /* Match menu item width */
    padding: 20px 15px 8px 15px; /* Match menu item padding structure */
    align-items: center;
    justify-content: center;
    color: transparent;
    background-color: transparent;
    border: transparent;
}

.user_section.minimized .user_info {
    justify-content: center; /* Center the content when minimized */
    width: 100%;
    height: 40px;
    color: transparent;
    background-color: transparent;
    border: transparent;
    
}

.user_section.minimized .user_info.clickable:hover {
    background-color: transparent; /* Remove orange background on hover when minimized */
}

.user_section.minimized .user_info.notClickable {
    background-color: transparent; /* Remove orange background on hover when minimized */
}

.user_section.minimized .user_header {
    justify-content: center; /* Center the avatar when minimized */
    width: 100%;
    padding: 0; /* Remove padding to center properly */
}

.user_section.minimized .user_avatar {
    width: 40px;
    height: 40px;
}

.user_section.minimized .text_content {
    opacity: 0;
    width: 0;
    color: transparent;
    background-color: transparent;
    border: transparent;
    animation: none; /* Disable animation when minimized */
}

.user_section.minimized h1 {
    opacity: 0;
    color: transparent;
    background-color: transparent;
    border: transparent;
    animation: none; /* Disable animation when minimized */
    
}

.user_section.minimized p {
    opacity: 0;
    color: transparent;
    background-color: transparent;
    border: transparent;
    animation: none; /* Disable animation when minimized */
}

/* Minimized logout popup styles */
.logout_popup_minimized {
    left: 50%; /* Center horizontally over the user icon */
    bottom: calc(100% + 8px); /* Position above the user icon */
    transform: translateX(-50%) translateY(20px); /* Center and start position for animation */
    width: 40px; /* Same size as user avatar */
    height: 40px;
    margin-left: 0;
    margin-bottom: 0;
    border-radius: 50%; /* Make it circular */
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    overflow: visible; /* Allow tooltip to show */
    opacity: 0; /* Start invisible */
    animation: flyUpFadeIn 0.3s ease-out forwards; /* Animation */
    transition: opacity 0.2s ease-out; /* Smooth fade out when disappearing */
}

.logout_popup_minimized .logout_menu_button {
    justify-content: center;
    align-items: center;
    padding: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%; /* Make button circular */
    position: relative;
}

.logout_popup_minimized .logout_menu_button::after {
    content: 'Abmelden';
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);

    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 11;
}

.logout_popup_minimized .logout_menu_button:hover::after {
    opacity: 1;
}

.logout_popup_minimized .logout_icon {
    margin: 0;
    font-size: 1rem;
}

/* Animation keyframes for delayed text appearance */
@keyframes delayedFadeIn {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0; /* Stay hidden for first 50% (0.3s) */
    }
    100% {
        opacity: 1; /* Fade in during last 50% (0.3s) */
    }
}

/* Animation keyframes for fly up and fade in effect */
@keyframes flyUpFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

