/* Forum Styles - EVD Aktuell */

.forum-container {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
    min-height: 70vh;
}

/* ── Header / Breadcrumbs ─────────────────────────────── */
.forum-header {
    margin-bottom: var(--spacing-lg);
    animation: forumFadeIn 0.4s ease-out;
}

.forum-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-red), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.forum-header .forum-subtitle {
    color: var(--text-secondary);
}

.forum-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.forum-breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.forum-breadcrumbs a:hover {
    color: var(--orange);
}

.forum-breadcrumbs i {
    font-size: 0.7rem;
}

/* ── Toolbar (Suche, Buttons) ─────────────────────────── */
.forum-toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.forum-search {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem 1rem;
}

.forum-search i { color: var(--text-muted); }

.forum-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.forum-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.forum-btn-primary {
    background: linear-gradient(135deg, var(--dark-red), var(--primary-red));
    color: #fff;
    box-shadow: var(--shadow-glow-red);
}

.forum-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(204, 0, 0, 0.5);
}

.forum-btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.forum-btn-secondary:hover {
    border-color: var(--orange);
    background: var(--card-bg-hover);
}

.forum-btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    border-radius: 8px;
}

.forum-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Badge im Toolbar-Button (ungelesene PMs) */
.forum-pm-badge {
    background: var(--primary-red);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* ── Kategorien-Liste ─────────────────────────────────── */
.forum-category-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.forum-category-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.1rem 1.3rem;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-normal);
    animation: forumFadeIn 0.4s ease-out;
}

.forum-category-card:hover {
    border-color: var(--orange);
    background: var(--card-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.forum-category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--dark-red), var(--orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}

.forum-category-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.forum-category-info p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
}

.forum-category-stats {
    display: flex;
    gap: 1.25rem;
    text-align: center;
}

.forum-category-stats .stat b {
    display: block;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.forum-category-stats .stat span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.forum-category-last {
    min-width: 180px;
    max-width: 220px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: right;
}

.forum-category-last .last-title {
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Thread-Liste ─────────────────────────────────────── */
.forum-thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.forum-thread-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
    animation: forumFadeIn 0.35s ease-out;
}

.forum-thread-row:hover {
    border-color: var(--orange);
    background: var(--card-bg-hover);
}

.forum-thread-row.pinned {
    border-color: rgba(255, 107, 0, 0.45);
    background: linear-gradient(135deg, rgba(204, 0, 0, 0.08), var(--card-bg));
}

.forum-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dark-red), var(--orange));
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 1rem;
}

.forum-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.forum-avatar.small { width: 32px; height: 32px; font-size: 0.85rem; }

.forum-thread-main { min-width: 0; }

.forum-thread-title {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow: hidden;
}

.forum-thread-title .title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forum-thread-title i {
    font-size: 0.78rem;
    color: var(--orange);
    flex-shrink: 0;
}

.forum-thread-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.forum-thread-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.forum-thread-stats b { color: var(--text-secondary); }

.forum-thread-last {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: right;
    min-width: 130px;
    white-space: nowrap;
}

/* ── Thread-Ansicht / Posts ───────────────────────────── */
.forum-post {
    display: grid;
    grid-template-columns: 190px 1fr;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    margin-bottom: 0.9rem;
    overflow: hidden;
    animation: forumFadeIn 0.35s ease-out;
}

.forum-post.deleted { opacity: 0.55; }

.forum-post-author {
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid var(--border-color);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
}

.forum-post-author .author-name {
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.forum-rank {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.forum-role-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--dark-red), var(--primary-red));
    color: #fff;
}

.forum-role-badge.editor { background: linear-gradient(135deg, #b34700, var(--orange)); }
.forum-role-badge.fan { background: linear-gradient(135deg, #1a4d1a, #2e8b2e); text-transform: none; letter-spacing: 0; }
.forum-role-badge.fan i { margin-right: 0.15rem; }

.forum-post-count {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.forum-post-body {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.forum-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.forum-post-anchor { color: var(--text-muted); text-decoration: none; }
.forum-post-anchor:hover { color: var(--orange); }

.forum-post-content {
    color: var(--text-secondary);
    font-size: 0.97rem;
    line-height: 1.65;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

.forum-post-content a { color: var(--orange); }
.forum-post-content strong { color: var(--text-primary); }

.forum-post-content blockquote {
    border-left: 3px solid var(--orange);
    background: rgba(255, 107, 0, 0.06);
    padding: 0.4rem 0.8rem;
    margin: 0.4rem 0;
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
}

.forum-post-content .mention {
    color: var(--orange);
    font-weight: 600;
}

/* Zitat des Bezugsbeitrags */
.forum-quote-ref {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary-red);
    border-radius: 0 8px 8px 0;
    padding: 0.5rem 0.85rem;
    margin-bottom: 0.7rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.forum-quote-ref b { color: var(--text-secondary); }

.forum-post-deleted-note {
    font-style: italic;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.forum-post-edited {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.4rem;
}

/* Reaktionen */
.forum-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.8rem;
}

.forum-reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-family: inherit;
}

.forum-reaction-chip:hover { border-color: var(--orange); }

.forum-reaction-chip.reacted {
    background: rgba(204, 0, 0, 0.18);
    border-color: var(--primary-red);
    color: var(--text-primary);
}

.forum-reaction-add {
    position: relative;
}

.forum-emoji-picker {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.4rem;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    gap: 0.15rem;
}

.forum-emoji-picker.open { display: flex; }

.forum-emoji-picker button {
    background: none;
    border: none;
    font-size: 1.15rem;
    padding: 0.25rem 0.35rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.forum-emoji-picker button:hover { background: rgba(255, 255, 255, 0.08); }

/* Post-Aktionen */
.forum-post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.8rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.forum-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.forum-action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.forum-action-btn.danger:hover { color: #ff6b6b; }

/* ── Composer ─────────────────────────────────────────── */
.forum-composer {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    margin-top: var(--spacing-md);
}

.forum-composer h3 {
    font-size: 1rem;
    margin-bottom: 0.7rem;
    color: var(--text-primary);
}

.forum-composer textarea,
.forum-composer input[type="text"] {
    width: 100%;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.75rem 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
    resize: vertical;
}

.forum-composer textarea { min-height: 110px; }

.forum-composer textarea:focus,
.forum-composer input[type="text"]:focus {
    border-color: var(--orange);
}

.forum-composer select {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.7rem 0.9rem;
    outline: none;
    width: 100%;
}

.forum-composer .composer-row { margin-bottom: 0.75rem; }

.forum-composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.forum-composer-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.forum-reply-context {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(204, 0, 0, 0.12);
    border: 1px solid rgba(204, 0, 0, 0.4);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.7rem;
}

.forum-reply-context button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

/* Login-Hinweis statt Composer */
.forum-login-prompt {
    background: var(--card-bg);
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    margin-top: var(--spacing-md);
}

.forum-login-prompt .forum-btn { margin-top: 0.75rem; }

/* Kategorie-Badge (Themen-Liste + Thread-Header) */
.forum-cat-badge {
    display: inline-block;
    background: rgba(255, 107, 0, 0.12);
    border: 1px solid rgba(255, 107, 0, 0.35);
    color: var(--orange);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

/* Kategorie-Filter Dropdown */
.forum-cat-filter {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.6rem 0.9rem;
    outline: none;
    cursor: pointer;
    max-width: 220px;
}

.forum-cat-filter:focus { border-color: var(--orange); }

/* Archiv-Banner (read-only Threads) */
.forum-archive-banner {
    background: rgba(255, 107, 0, 0.08);
    border: 1px solid rgba(255, 107, 0, 0.4);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    color: var(--orange);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Sanktions-Banner */
.forum-sanction-banner {
    background: rgba(204, 0, 0, 0.12);
    border: 1px solid rgba(204, 0, 0, 0.5);
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    color: #ff9d9d;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ── Pagination ───────────────────────────────────────── */
.forum-pagination {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

.forum-page-btn {
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--transition-fast);
    padding: 0 0.5rem;
}

.forum-page-btn:hover { border-color: var(--orange); color: var(--text-primary); }

.forum-page-btn.active {
    background: linear-gradient(135deg, var(--dark-red), var(--primary-red));
    border-color: var(--primary-red);
    color: #fff;
    font-weight: 700;
}

/* ── Private Nachrichten ──────────────────────────────── */
.forum-pm-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1rem;
    min-height: 60vh;
}

.forum-pm-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.forum-pm-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.forum-pm-search input {
    width: 100%;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    padding: 0.55rem 0.8rem;
    font-size: 0.88rem;
    outline: none;
}

.forum-pm-search input:focus { border-color: var(--orange); }

.forum-pm-user-results {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    top: calc(100% - 0.25rem);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 60;
    overflow: hidden;
}

.forum-pm-user-results button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    padding: 0.55rem 0.8rem;
    cursor: pointer;
    font-size: 0.88rem;
    text-align: left;
}

.forum-pm-user-results button:hover { background: rgba(255, 255, 255, 0.06); }

.forum-pm-conversations {
    overflow-y: auto;
    flex: 1;
}

.forum-pm-conv {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.7rem;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    color: inherit;
    transition: background var(--transition-fast);
}

.forum-pm-conv:hover, .forum-pm-conv.active { background: rgba(255, 255, 255, 0.05); }

.forum-pm-conv .conv-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.forum-pm-conv .conv-preview {
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.forum-pm-conv .conv-time { font-size: 0.7rem; color: var(--text-muted); }

.forum-pm-chat {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.forum-pm-chat-header {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
}

.forum-pm-chat-header .pm-back {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
}

.forum-pm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 300px;
    max-height: 55vh;
}

.forum-pm-bubble {
    max-width: 75%;
    padding: 0.55rem 0.9rem;
    border-radius: 14px;
    font-size: 0.92rem;
    line-height: 1.5;
    word-wrap: break-word;
    color: var(--text-primary);
}

.forum-pm-bubble.from-me {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--dark-red), var(--primary-red));
    border-bottom-right-radius: 4px;
}

.forum-pm-bubble.from-them {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.07);
    border-bottom-left-radius: 4px;
}

.forum-pm-bubble .pm-time {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.2rem;
    text-align: right;
}

.forum-pm-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.forum-pm-input textarea {
    flex: 1;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    padding: 0.6rem 0.85rem;
    outline: none;
    resize: none;
    height: 44px;
    max-height: 120px;
}

.forum-pm-input textarea:focus { border-color: var(--orange); }

.forum-pm-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 0.6rem;
    padding: 2rem;
    text-align: center;
}

.forum-pm-empty i { font-size: 2rem; opacity: 0.4; }

/* ── Sonstiges ────────────────────────────────────────── */
.forum-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
}

.forum-empty i { font-size: 2.2rem; opacity: 0.4; display: block; margin-bottom: 0.75rem; }

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 0;
    color: var(--text-muted);
}

.loading-container .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: forumSpin 0.8s linear infinite;
}

@keyframes forumSpin { to { transform: rotate(360deg); } }

@keyframes forumFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.forum-highlight {
    animation: forumHighlight 2s ease-out;
}

@keyframes forumHighlight {
    0% { box-shadow: 0 0 0 2px var(--orange); }
    100% { box-shadow: 0 0 0 2px transparent; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
    .forum-category-last { display: none; }

    .forum-pm-layout { grid-template-columns: 1fr; }

    .forum-pm-layout.chat-open .forum-pm-sidebar { display: none; }
    .forum-pm-layout:not(.chat-open) .forum-pm-chat { display: none; }
    .forum-pm-chat-header .pm-back { display: block; }
}

@media (max-width: 700px) {
    .forum-thread-stats, .forum-thread-last { display: none; }

    .btn-label-wide { display: none; }

    .forum-cat-filter { max-width: 140px; }

    .forum-thread-row { grid-template-columns: auto 1fr; }

    .forum-post { grid-template-columns: 1fr; }

    .forum-post-author {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0.7rem 1rem;
        gap: 0.7rem;
        text-align: left;
        align-items: center;
    }

    .forum-post-author .author-name { font-size: 0.95rem; }

    .forum-category-card { grid-template-columns: auto 1fr; }
    .forum-category-stats { display: none; }

    .forum-header h1 { font-size: 1.7rem; }
}

/* ══════════════════════════════════════════════════════════
   Chat-Forum (Thread = Live-Chat) + Gruppen-Tabs
   ══════════════════════════════════════════════════════════ */

/* Gruppen-Tabs */
.forum-group-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.group-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.group-tab i { font-size: 0.68rem; color: var(--text-muted); }

.group-tab:hover { border-color: var(--orange); color: var(--text-primary); }

.group-tab.active {
    background: linear-gradient(135deg, var(--dark-red), var(--primary-red));
    border-color: var(--primary-red);
    color: #fff;
}

.group-tab.active i { color: rgba(255, 255, 255, 0.7); }

.group-tab .tab-count {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 0.7rem;
    padding: 0 0.45rem;
    color: inherit;
}

.forum-header-compact { margin-bottom: var(--spacing-sm); }
.forum-header-compact h1 { font-size: 1.6rem; }

/* Chat-Fenster */
.forum-chat {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.forum-chat-messages {
    overflow-y: auto;
    height: 62vh;
    min-height: 340px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.chat-load-older {
    align-self: center;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.chat-load-older:hover { border-color: var(--orange); color: var(--text-primary); }
.chat-load-older:disabled { opacity: 0.5; cursor: wait; }

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 0.6rem;
    text-align: center;
}

.chat-empty i { font-size: 2rem; opacity: 0.4; }

/* Chat-Nachricht */
.chat-msg {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.chat-msg.deleted { opacity: 0.55; }

.chat-msg-main { flex: 1; min-width: 0; }

.chat-msg-head {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.chat-msg-user {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.chat-msg-user.admin { color: #ff7b7b; }
.chat-msg-user.editor { color: var(--orange); }

.chat-msg-rank, .chat-msg-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.chat-msg-actions {
    margin-left: auto;
    display: flex;
    gap: 0.1rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.chat-msg:hover .chat-msg-actions { opacity: 1; }

@media (hover: none) {
    .chat-msg-actions { opacity: 1; }
}

.chat-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.chat-action-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.chat-msg-content {
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-top: 0.1rem;
}

.chat-msg-content a { color: var(--orange); }
.chat-msg-content strong { color: var(--text-primary); }

.chat-msg-content code {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 0.05rem 0.4rem;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.85em;
    color: #ffc599;
}

.chat-msg-content blockquote {
    border-left: 3px solid var(--orange);
    background: rgba(255, 107, 0, 0.06);
    padding: 0.3rem 0.7rem;
    margin: 0.3rem 0;
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
}

.chat-msg-content .mention {
    color: var(--orange);
    font-weight: 600;
}

.chat-msg-content.deleted-note {
    font-style: italic;
    color: var(--text-muted);
}

.chat-edited {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Antwort-Bezug */
.chat-reply-ref {
    background: rgba(255, 255, 255, 0.04);
    border-left: 2px solid var(--primary-red);
    border-radius: 0 6px 6px 0;
    padding: 0.25rem 0.6rem;
    margin: 0.2rem 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-reply-ref b { color: var(--text-secondary); }

/* Reaktionen im Chat kompakter */
.chat-reactions { margin-top: 0.35rem; }
.chat-reactions:empty { display: none; }
.chat-reactions .forum-reaction-chip { font-size: 0.78rem; padding: 0.1rem 0.5rem; }

/* Eingabezeile */
.forum-chat-inputbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    align-items: flex-end;
}

.forum-chat-inputbar textarea {
    flex: 1;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.93rem;
    padding: 0.6rem 0.85rem;
    outline: none;
    resize: none;
    min-height: 44px;
    max-height: 130px;
}

.forum-chat-inputbar textarea:focus { border-color: var(--orange); }

.forum-chat-inputbar .forum-btn { min-width: 52px; justify-content: center; }

.forum-chat-inputbar.chat-notice {
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    justify-content: center;
    padding: 1rem;
}

.forum-chat-inputbar.chat-notice a { color: var(--orange); }

/* Antwort-Kontext über der Eingabe */
#replyContext { padding: 0 0.75rem; }
#replyContext .forum-reply-context { margin: 0.5rem 0 0; }

@media (max-width: 700px) {
    .forum-chat-messages { height: 55vh; min-height: 280px; }
    .forum-header-compact h1 { font-size: 1.25rem; }
}

/* ══════════════════════════════════════════════════════════
   Chat V2: Vollbild-Layout, Teilnehmer-Sidebar, Seiten, Bilder
   ══════════════════════════════════════════════════════════ */

/* Thread-Ansicht nutzt die volle Breite */
.forum-container-wide {
    max-width: none;
    width: 100%;
    padding-left: clamp(1rem, 3vw, 2.5rem);
    padding-right: clamp(1rem, 3vw, 2.5rem);
}

/* Chat + Sidebar nebeneinander */
.forum-chat-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1rem;
    align-items: stretch;
}

.forum-chat-layout .forum-chat {
    min-width: 0;
    position: relative;
}

.forum-chat-layout .forum-chat-messages {
    height: calc(100vh - 340px);
    min-height: 380px;
}

/* ── Teilnehmer-Sidebar ───────────────────────────────── */
.forum-chat-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - 220px);
}

.sidebar-head {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-head i { color: var(--orange); font-size: 0.85rem; }

.sidebar-close {
    display: none;
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
}

.sidebar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-search i { color: var(--text-muted); font-size: 0.8rem; }

.sidebar-search input {
    flex: 1;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    outline: none;
    min-width: 0;
}

.sidebar-search input:focus { border-color: var(--orange); }

.sidebar-participants {
    overflow-y: auto;
    flex: 1;
    padding-bottom: 0.5rem;
}

.sidebar-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.75rem 1rem 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.sidebar-group-title.online { color: #6fd96f; }

.presence-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    display: inline-block;
    flex-shrink: 0;
}

.presence-dot.off { background: var(--text-muted); opacity: 0.5; }

.sidebar-none {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.25rem 1rem 0.5rem;
}

.participant-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition-fast);
}

.participant-row:hover { background: rgba(255, 255, 255, 0.05); }

.participant-avatar { position: relative; display: inline-flex; flex-shrink: 0; }

.participant-avatar.online::after {
    content: '';
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    border: 2px solid var(--card-bg);
}

.participant-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.participant-name.admin { color: #ff7b7b; }
.participant-name.editor { color: var(--orange); }

.participant-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
    flex-shrink: 0;
}

/* Angepinnte Nachrichten in der Sidebar */
.pinned-msg {
    display: block;
    width: 100%;
    background: rgba(255, 107, 0, 0.06);
    border: none;
    border-bottom: 1px solid rgba(255, 107, 0, 0.15);
    border-left: 3px solid var(--orange);
    color: inherit;
    font-family: inherit;
    text-align: left;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.pinned-msg:hover { background: rgba(255, 107, 0, 0.12); }

.pinned-msg b {
    display: block;
    font-size: 0.78rem;
    color: var(--orange);
}

.pinned-msg span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar-Toggle (nur mobil sichtbar) */
.chat-sidebar-toggle {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 0.35rem;
}

/* ── Seiten-Navigation im Chat ────────────────────────── */
.chat-pagination {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.chat-pagination:empty { display: none; }

.chat-page-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.chat-page-btns {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.chat-page-btns .forum-page-btn {
    min-width: 30px;
    height: 30px;
    font-size: 0.78rem;
}

/* ── Nachrichten: Bilder, Pin-Badge, Profil-Links ─────── */
.chat-avatar-link { text-decoration: none; flex-shrink: 0; }

a.chat-msg-user { text-decoration: none; }
a.chat-msg-user:hover { text-decoration: underline; }

.chat-msg.pinned {
    background: rgba(255, 107, 0, 0.05);
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    margin: 0 -0.5rem;
}

.chat-pinned-badge {
    font-size: 0.62rem;
    color: var(--orange);
}

.chat-msg-image {
    display: block;
    max-width: min(340px, 100%);
    max-height: 280px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin: 0.3rem 0;
    cursor: zoom-in;
    object-fit: cover;
}

/* Bild-Anhang über der Eingabezeile */
#chatImagePreview { padding: 0 0.75rem; }

.chat-img-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 107, 0, 0.1);
    border: 1px solid rgba(255, 107, 0, 0.35);
    border-radius: 10px;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.chat-img-chip img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.chat-img-chip button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.2rem;
}

.chat-img-chip button:hover { color: #ff6b6b; }

.chat-attach-btn {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
    min-width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.chat-attach-btn:hover { border-color: var(--orange); color: var(--orange); }

/* Lightbox für Bilder */
.chat-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: zoom-out;
    animation: forumFadeIn 0.15s ease-out;
}

.chat-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

/* @Mention-Vorschläge */
.chat-mention-box {
    position: absolute;
    bottom: 72px;
    left: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 80;
    overflow: hidden;
    min-width: 220px;
}

.chat-mention-box button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    text-align: left;
}

.chat-mention-box button:hover { background: rgba(255, 255, 255, 0.06); }

/* PM-Header: Link zum Profil */
.pm-partner-link {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: inherit;
    text-decoration: none;
}

.pm-partner-link:hover { color: var(--orange); }

/* ── Öffentliche Profilseite (/user/:id) ──────────────── */
.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    animation: forumFadeIn 0.4s ease-out;
}

.profile-card-head {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 84px;
    height: 84px;
    font-size: 2rem;
    flex-shrink: 0;
}

.profile-head-info { flex: 1; min-width: 200px; }

.profile-head-info h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.profile-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-meta i { margin-right: 0.25rem; }

.profile-rank { color: var(--orange); font-weight: 600; }

.profile-presence {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.profile-presence .presence-dot { background: var(--text-muted); opacity: 0.5; }
.profile-presence.online { color: #6fd96f; }
.profile-presence.online .presence-dot { background: #4caf50; opacity: 1; }

.profile-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.profile-bio {
    margin-top: 1.1rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.6;
    white-space: pre-line;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.profile-stat b {
    display: block;
    font-size: 1.35rem;
    color: var(--text-primary);
}

.profile-stat span { font-size: 0.78rem; color: var(--text-muted); }

.profile-section { margin-top: 1.5rem; }

.profile-section h2 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 0.7rem;
}

.profile-section h2 i { color: var(--orange); margin-right: 0.4rem; }

.profile-thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.profile-thread-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

.profile-thread-row:hover { border-color: var(--orange); background: var(--card-bg-hover); }

.profile-thread-row i { color: var(--text-muted); font-size: 0.85rem; }

.profile-thread-row .title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.profile-thread-row .time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Responsive: Sidebar wird mobil zum Overlay ───────── */
@media (max-width: 1000px) {
    .forum-chat-layout { grid-template-columns: 1fr; }

    .chat-sidebar-toggle { display: inline-block; }

    .forum-chat-sidebar {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 85vw);
        max-height: none;
        border-radius: 0;
        z-index: 500;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .forum-chat-sidebar.open { display: flex; }

    .sidebar-close { display: block; }

    .forum-chat-layout .forum-chat-messages { height: calc(100vh - 320px); min-height: 300px; }
}

@media (max-width: 700px) {
    .forum-chat-layout .forum-chat-messages { height: 55vh; min-height: 280px; }

    .chat-msg-image { max-width: 100%; max-height: 220px; }

    .profile-card-head { flex-direction: column; text-align: center; }
    .profile-head-info h1 { justify-content: center; }
    .profile-meta { justify-content: center; }
    .profile-stats { justify-content: center; gap: 1.5rem; }
}
