.community__user-tag {
    display: inline-flex;
    align-items: center;
    background: var(--surface-color);
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 4px 12px 4px 4px;
    transition: all 0.2s ease;
}

.community__user-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-body);
    gap: 8px;
}

.community__avatar-wrapper {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.community__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community__username {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-body);
    white-space: nowrap;
}

/* Hover-Effekte */
.community__user-tag:hover {
    border-color: #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.community__user-link:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.community li {
    display: flex;
    align-items: center;
    justify-content: left;
}



.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 98%;
}

.comments-container {
    max-height: 600px;
    overflow-y: auto;
}

.community__comment-divider {
    margin: 10px 0;
    border: 1px dotted #cccccc;
    border-top: none;
    width: 98%;
}

.community__comment-header {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-body);
}

.community__comment-username {
    font-size: 14px;
    font-weight: 1000;
    color: var(--text-body);
    text-decoration: none;
}

.community__comment-username:hover {
    text-decoration:underline;
}

.community__comment-comment {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
    width: 98%;
    color: var(--text-body);
}




/* Community Chat Container – standardmäßig geschlossen */
.community-chat {
    position: fixed;
    bottom: 2rem;
    right: 0;
    min-width: 500px;
    width: 50vw;
    height: 72vh;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    /* Die gesamte Breite minus 20px (Handle-Breite) wird ausgeblendet */
    transform: translateX(calc(100%));
    opacity: 0.9;
    overflow: visible; /* Damit der Handle nicht abgeschnitten wird */
    z-index: 1000;
}

/* Deaktiviert die Transition beim initialen Laden (verhindert Animation) */
.community-chat.no-transition {
    transition: none;
}

.community-chat.open {
    transform: translateX(0);
}

/* Handle-Styles – absolut positioniert am rechten Rand des Containers */
.community-chat__handle {
    position: absolute;
    left: -40px;      /* Immer an der rechten Kante */
    top: 10px;      /* Vertikal mittig */
    width: 25px;
    height: 10px;
    cursor: pointer;
    align-items: center;
    font-size: 2em;
    transform: translateY(-50%);
    z-index: 100;
    color: var(--primary-color);


}
.community-chat__handle:hover {
    text-shadow: -1px -1px 0 var(--primary-color), 1px -1px 0 var(--primary-color), -1px 1px 0 var(--primary-color), 1px 1px 0 var(--primary-color);
    color: var(--text-body-white);
}
.community-chat__handle:hover .community-chat__close-x {
    color: var(--text-body-white);
}
.community-chat__content {
    display: flex;
    flex-direction: row;
    gap: 10px;
    height: 100%;
}

/* Im geschlossenen Zustand soll nur der "open"-Handle sichtbar sein */
.community-chat:not(.open) .community-chat__handle.close {
    display: none;
}
.community-chat:not(.open) .community-chat__handle.open {
    display: flex;
}

/* Im offenen Zustand den "open"-Handle ausblenden und den "close"-Handle anzeigen */
.community-chat.open .community-chat__handle.open {
    display: none;
}
.community-chat.open .community-chat__handle.close {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(20px) translateY(-50%); /* Bewegt den Handle um 20px nach rechts, wenn Chat geöffnet ist */
    position: relative; /* Für absolute Positionierung des X */
}

/* Das X innerhalb der Sprechblase positionieren */
.community-chat__close-x {
    position: absolute;
    font-size: 0.6em; /* Relativ zur Sprechblase-Größe */
    font-weight: bold;
    color: var(--text-body-white);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* Damit Klicks durch das X hindurchgehen */
}

.community-chat__chat-list-container {
    overflow-y: auto;
    flex-shrink: 0;
    width: 25%;
}


.community-chat__chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
}


.community-chat__messages {
    height: 47.5vh;
    overflow-y: auto; /* Scrollt automatisch zur neuesten Nachricht */
}

.community-chat__messages-container {
    height: calc(50vh - 40px);
    overflow-y: auto;
    justify-content: bottom;
}

.community-chat__input-container {
    display: flex;
    flex-direction: row;
    justify-content: bottom;
    margin-bottom: -15px;
}

.community-chat__input {
    width: 90%;
    height: 2.5vh;
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 5px;    
}
.community-chat__send-button {
    width: 10%;
    height: 2.5vh;
    margin-left: -15px;
    border: 0px solid #ccc;
    border-radius: 5px;
    color: var(--text-body-white);
    background-color: var(--primary-color);
    padding: 5px;
    
}

/* Chat List Styles */
.community-chat__chat-list {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.community-chat__chat-item {
    display: flex;
    align-items: center;
    padding: 4px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.community-chat__chat-item:hover {
    background-color: var(--hover-color);
}

.community-chat__chat-item.active {
    background-color: var(--active-color);
}

.community-chat__chat-item--unread {
    background-color: var(--hover-color);
    font-weight: 500;
}

.community-chat__chat-item--unread .community-chat__chat-name {
    font-weight: bold;
}

.community-chat__chat-item--unread .community-chat__chat-preview {
    color: var(--text-body);
    font-weight: 500;
}

.community-chat__chat-avatar {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.community-chat__chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.community-chat__chat-info {
    flex: 1;
    min-width: 0;
}

.community-chat__chat-name {
    font-weight: bold;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.community-chat__name-input {
    font-size: 1.5rem;
    font-weight: bold;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 4px 8px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    color: inherit;
}

.community-chat__name-input:hover {
    background-color: var(--hover-color);
    border-color: var(--border-color);
}

.community-chat__name-input:focus {
    outline: none;
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    cursor: text;
}

.community-chat__name-input[readonly] {
    cursor: pointer;
}

.community-chat__unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background-color: var(--primary-color);
    color: var(--text-body-white);
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
    line-height: 1;
}

.community-chat__chat-preview {
    font-size: 0.9em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.community-chat__chat-time {
    font-size: 0.8em;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 10px;
}

/* Chat Participants  */
.community-chat__participants {
    margin: 1rem 0;
}

.community-chat__participants-list {
    display: flex;
    flex-direction: row;
    gap: 0.3rem;
    max-height: 200px;
    overflow-y: auto;
}

.community-chat__participant {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.community-chat__participant-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.community-chat__participant-name {
    font-size: 0.9rem;
}

.community-chat__modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 1rem;
}

.community-chat__modal.open {
    display: flex;
}

.community-chat__modal-content {
    width: min(420px, 100%);
    background: var(--surface-color, #fff);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.community-chat__modal-header,
.community-chat__modal-footer {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #ddd);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.community-chat__modal-footer {
    border-bottom: none;
    border-top: 1px solid var(--border-color, #ddd);
    justify-content: flex-end;
}

.community-chat__modal-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
}

.community-chat__modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.community-chat__modal-hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary, #666);
}

.community-chat__modal-search {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
}

.community-chat__modal-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    min-height: 140px;
}

.community-chat__modal-list-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color, #eee);
    text-align: left;
    cursor: pointer;
}

.community-chat__modal-list-item:last-child {
    border-bottom: none;
}

.community-chat__modal-list-item.selected {
    background: rgba(33, 150, 243, 0.12);
}

.community-chat__modal-list-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}

.community-chat__modal-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-chat__modal-list-name {
    font-weight: 500;
    color: var(--text-body, #222);
}

.community-chat__modal-list-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary, #777);
}

.community-chat__modal-error {
    color: var(--danger-color, #c53030);
    font-size: 0.85rem;
}

.community-chat--disabled {
    opacity: 0.85;
}

.community-chat--disabled .community-chat__content {
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.community-chat__disabled-banner {
    background: var(--debug-todo);
    border: 1px solid #f0b429;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-align: center;
    color: var(--debug-todo);
    width: 100%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.community-chat__disabled-banner p {
    margin: 0.5rem 0 0;
    line-height: 1.4;
}


.community__user-tag_v2 {
    width: 80px;
    min-width: 80px;
    max-height: 110px;
    background-color: var(--surface-color);
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    padding: .3rem;
    transform: rotate(var(--angle, 0deg));
    transition: transform 0.3s ease;
    overflow: hidden;
    cursor: pointer;
}

.community__user-tag_v2 a {
    text-decoration: none;
}

.community__user-tag_v2__image-wrapper {
    display: block;
    width: 100%;
    height: 80px;
    overflow: hidden;
    border-bottom: 1px solid #e0e0e0;
    
}

.community__user-tag_v2__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community__user-tag_v2__name {
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-body);
    overflow: hidden;
    text-decoration: none;
}

/* OAuth-Heimat-Instanz (ADR 0006) — ergänzt den Anzeigenamen in der Kontaktliste */
.community__user-tag_v2__fediverse-host {
    display: block;
    text-align: center;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted, #666);
    line-height: 1.25;
}


.community__user-tag_v2_small {
    width: 60px;
    height: 70px;
    background-color: var(--surface-color);
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    padding: .2rem;
    transform: rotate(var(--angle, 0deg));
    transition: transform 0.3s ease;
    overflow: hidden;
}

.community__user-tag_v2_small__image-wrapper {
    width: 100%;
    height: 50px;
    overflow: hidden;
    border-bottom: 1px solid #e0e0e0;
    
}

.community__user-tag_v2_small__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community__user-tag_v2_small__name {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-body);
    overflow: hidden;
    text-decoration: none;
}

.community__user-tag_v2__usericon {
    font-size: 3.8rem;
    color: var(--text-body);
}



@media (max-width: 768px) {
    .community-chat__handle {
        display: none;
    }
    .community-chat {
        display: none;
    }
}