/* ===========================================
   COMMUNITY PROFIL-MENÜ
   =========================================== */

.community-user-menu {
    position: relative;
}

.community-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 20px;
    transition: background 0.2s;
}

.community-user-toggle:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar.avatar-placeholder {
    background: linear-gradient(135deg, var(--gray-500) 0%, var(--gray-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
}

.community-user-toggle .user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Community Dropdown */
.community-user-menu .user-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 0;
    z-index: 1002;
    /* Bei niedrigem Viewport intern scrollen statt unten abzuschneiden,
       sonst sind Abmelden/Datenschutz auf kurzen Bildschirmen unerreichbar. */
    max-height: calc(100vh - 84px);
    max-height: calc(100dvh - 84px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.community-user-menu.active .user-dropdown-menu {
    display: block;
}

/* User Header im Dropdown */
.dropdown-user-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.dropdown-avatar.avatar-placeholder {
    background: linear-gradient(135deg, var(--gray-500) 0%, var(--gray-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dropdown-user-info strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-info small {
    font-size: 12px;
    color: var(--gray-400);
}

/* Dropdown Items */
.community-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.community-dropdown .dropdown-item:hover {
    background: var(--gray-100);
}

.community-dropdown .dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 4px 0;
}

/* SVG Icons */
.dropdown-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--gray-600);
}

.community-dropdown .dropdown-item:hover .dropdown-icon {
    color: var(--primary-color);
}

/* Logout Item */
.logout-item {
    color: var(--gray-600);
}

.logout-item:hover {
    background: var(--alert-error-bg) !important;
}

.logout-item:hover .dropdown-icon {
    color: var(--error-color) !important;
}

/* ===========================================
   HEADER ICON BUTTON (Chat, etc.)
   =========================================== */
a.header-icon-btn,
button.header-icon-btn,
.header-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-dark) !important;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
a.header-icon-btn:hover,
button.header-icon-btn:hover,
.header-icon-btn:hover {
    background: var(--gray-100);
    color: var(--text-dark) !important;
}
.header-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--error-color);
    color: var(--text-on-color);
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===========================================
   THEME TOGGLE IN DROPDOWN
   =========================================== */
.theme-toggle-item {
    position: relative;
}
.theme-toggle-item .icon-moon-dd,
.theme-toggle-item .icon-sun-dd {
    display: none;
}
[data-theme="light"] .theme-toggle-item .icon-moon-dd,
html:not([data-theme]) .theme-toggle-item .icon-moon-dd {
    display: block;
}
[data-theme="dark"] .theme-toggle-item .icon-sun-dd {
    display: block;
}

