/* assets/css/community.css */

/* --- Haupt-Layout --- */
/* Wir entfernen das Standard-Container-Padding und machen die Seite Full-Width */
.main-content-default {
    padding: 0;
}
.main-content-default > .container {
    max-width: none;
    padding: 0;
}
/* Entfernt das `main`-Tag aus dem Flow, damit das Layout die volle Höhe einnimmt */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main.community-layout {
    display: grid;
    /* 3 Spalten: Channel-Liste | Hauptinhalt | User-Liste (optional) */
    grid-template-columns: 240px 1fr 240px; 
    height: calc(100vh - 70px); /* Volle Höhe minus Höhe des Headers */
    flex-grow: 1; /* Nimmt den restlichen Platz im Body ein */
}

/* --- Spalte 1: Sidebar / Channel-Liste --- */
.community-sidebar {
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-title {
    font-size: 1.1rem;
    margin: 0;
}
.sidebar-action-btn {
    color: var(--text-muted);
}
.channel-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}
.channel-group-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
    display: block;
}
.channel-nav ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}
.channel-nav li a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
}
.channel-nav li:hover a {
    background-color: var(--bg-body);
    color: var(--text-main);
}
.channel-nav li.active a {
    background-color: var(--accent-color);
    color: white;
}
.channel-icon {
    font-weight: 700;
    color: var(--text-muted);
}
.channel-nav li.active .channel-icon {
    color: white;
}


/* --- Spalte 2: Hauptinhalt / Chat --- */
.community-content {
    display: flex;
    flex-direction: column;
    height: 100%; /* Wichtig für internes Scrolling */
}
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    z-index: 1;
}
.channel-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    font-size: 1.1rem;
}
.content-header .channel-name {
    margin: 0;
    font-size: 1.1rem;
}
.content-header input[type="search"] {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    min-width: 200px;
}
.message-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
}
.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.message-avatar {
    font-size: 2rem;
    color: var(--text-muted);
}
.message-header {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    margin-bottom: 0.3rem;
}
.author-name {
    font-weight: 600;
    color: var(--text-main);
}
.timestamp {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.message-body {
    color: var(--text-main);
    line-height: 1.5;
}
.content-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.message-input-wrapper input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    color: var(--text-main);
}


/* --- Spalte 3: User-Liste --- */
.community-user-list {
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
}

/* --- Responsive Anpassungen --- */
@media (max-width: 992px) {
    main.community-layout {
        grid-template-columns: 240px 1fr; /* User-Liste ausblenden */
    }
    .community-user-list {
        display: none;
    }
}
@media (max-width: 768px) {
    main.community-layout {
        grid-template-columns: 1fr; /* Nur Hauptinhalt anzeigen */
    }
    .community-sidebar {
        display: none; /* Sidebar auf Mobile ausblenden (später per Button togglebar) */
    }
}