/* Community forum styles (shared by community.html, community-thread.html,
   community-new-post.html). Ported look-and-feel from the cadvisor.xyz
   community, adapted to Plan My Retire's light theme. */

.forum-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

.forum-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.forum-tabs {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 10px;
}

.forum-tab {
    border: none;
    background: transparent;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    font-size: 0.95rem;
}

.forum-tab.active {
    background: white;
    color: #2563eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.forum-sort {
    padding: 0.5rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #334155;
    font-size: 0.9rem;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-chip {
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.category-chip.active {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.post-row {
    display: flex;
    gap: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.post-row:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1);
}

.post-row.pinned {
    border-color: #f59e0b;
    background: #fffbeb;
}

.vote-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-width: 44px;
}

.vote-btn {
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 8px;
    width: 36px;
    height: 32px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
}

.vote-btn:hover { border-color: #2563eb; color: #2563eb; }

.vote-btn.voted {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.vote-count {
    margin-top: 0.3rem;
    font-weight: 700;
    color: #334155;
}

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

.post-row-title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: #1e293b;
    overflow-wrap: anywhere;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
}

.badge {
    display: inline-block;
    border-radius: 6px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}

.badge.kind-question { background: #dbeafe; color: #1d4ed8; }
.badge.kind-feature_request { background: #ede9fe; color: #6d28d9; }
.badge.kind-announcement { background: #fef3c7; color: #b45309; }
.badge.status-answered { background: #dcfce7; color: #15803d; }
.badge.pin { background: #fef3c7; color: #b45309; }
.badge.lock { background: #fee2e2; color: #b91c1c; }

.forum-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    background: white;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.forum-error {
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.btn-new-post {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.3rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

/* ---- Thread view ---- */

.thread-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.thread-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: #1e293b;
    overflow-wrap: anywhere;
}

.thread-body, .reply-body {
    color: #334155;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.reply-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.reply-card.accepted {
    border-color: #22c55e;
    background: #f0fdf4;
}

.accepted-tag {
    color: #15803d;
    font-weight: 700;
    font-size: 0.8rem;
}

.reply-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.thread-actions, .reply-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.9rem;
}

.action-btn {
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    cursor: pointer;
}

.action-btn:hover { border-color: #94a3b8; }
.action-btn.danger { color: #b91c1c; }
.action-btn.mod { color: #6d28d9; }

.reply-form textarea, .post-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
}

.post-form input[type="text"], .post-form select {
    width: 100%;
    padding: 0.7rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    background: white;
}

.post-form label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.forum-muted { color: #94a3b8; font-size: 0.85rem; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Discord section heading spacing when below the forum */
.discord-section-title {
    text-align: center;
    margin: 3rem 0 1.5rem;
    color: #1e293b;
}

@media (max-width: 640px) {
    .forum-container { padding: 1.5rem 1rem 3rem; }
    .post-row { padding: 0.8rem; gap: 0.7rem; }
}
