/**
 * Terminal Forum — Discussion Engine Styles
 *
 * Reusable across any terminal section (ghosts, philosophy, etc.).
 * All classes prefixed `.forum-` to avoid collisions.
 */

/* ── Loading / Empty States ────────────────────────────────────── */

.forum-loading {
    text-align: center;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.85rem;
    color: #6b5740;
    padding: 32px 0;
}

.forum-empty {
    text-align: center;
    padding: 32px 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.85rem;
    color: #a89279;
}

.forum-guest-notice {
    text-align: center;
    padding: 40px 20px;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.forum-guest-notice p {
    font-size: 0.88rem;
    color: #6b5740;
    margin: 0 0 8px;
}

.forum-guest-hint {
    font-size: 0.78rem !important;
    color: #a89279 !important;
    font-style: italic;
}

/* ── Toolbar (compose toggle + sort) ──────────────────────────── */

.forum-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.forum-compose-toggle {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.78rem;
    background: #ede4cc;
    color: #3d2b1f;
    border: 1px solid #8b7355;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    letter-spacing: 0.5px;
}

.forum-compose-toggle:hover {
    background: #e8dcc4;
    border-color: #d4a853;
}

.forum-sort {
    display: flex;
    gap: 4px;
}

.forum-sort-btn {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.72rem;
    background: transparent;
    color: #a89279;
    border: 1px solid transparent;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.15s, border-color 0.15s;
}

.forum-sort-btn:hover {
    color: #6b5740;
}

.forum-sort-btn--active {
    color: #3d2b1f;
    border-color: #8b7355;
    background: #ede4cc;
}

/* ── Compose Form ─────────────────────────────────────────────── */

.forum-compose {
    background: rgba(61, 43, 31, 0.03);
    border: 1px solid #c9b99a;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 16px;
}

.forum-compose-title {
    display: block;
    width: 100%;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.85rem;
    background: #f4edd8;
    color: #3d2b1f;
    border: 1px solid #c9b99a;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.forum-compose-title:focus {
    outline: none;
    border-color: #d4a853;
}

.forum-compose-body,
.forum-reply-input {
    display: block;
    width: 100%;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.82rem;
    background: #f4edd8;
    color: #3d2b1f;
    border: 1px solid #c9b99a;
    border-radius: 4px;
    padding: 10px 12px;
    resize: vertical;
    line-height: 1.5;
    box-sizing: border-box;
}

.forum-compose-body:focus,
.forum-reply-input:focus {
    outline: none;
    border-color: #d4a853;
}

.forum-compose-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.forum-compose-submit,
.forum-reply-submit {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.78rem;
    background: #3d2b1f;
    color: #ede4cc;
    border: 1px solid #3d2b1f;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    letter-spacing: 0.5px;
}

.forum-compose-submit:hover,
.forum-reply-submit:hover {
    background: #5a3f2e;
}

.forum-compose-submit:disabled,
.forum-reply-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.forum-compose-cancel {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.78rem;
    background: transparent;
    color: #a89279;
    border: 1px solid #c9b99a;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s;
}

.forum-compose-cancel:hover {
    color: #6b5740;
}

.forum-compose-error,
.forum-reply-error {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.75rem;
    color: #b05555;
    margin-top: 8px;
}

/* ── Thread List ──────────────────────────────────────────────── */

.forum-list {
    display: flex;
    flex-direction: column;
}

.forum-thread {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.15);
    cursor: pointer;
    transition: background 0.15s;
}

.forum-thread:last-child {
    border-bottom: none;
}

.forum-thread:hover {
    background: rgba(212, 168, 83, 0.06);
}

/* ── Vote Controls ────────────────────────────────────────────── */

.forum-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 36px;
    flex-shrink: 0;
    padding-top: 2px;
}

.forum-vote-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    color: #c9b99a;
    padding: 2px 6px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.forum-vote-btn:hover {
    color: #d4a853;
    background: rgba(212, 168, 83, 0.08);
}

.forum-vote-btn--active.forum-vote-up {
    color: #d4a853;
}

.forum-vote-btn--active.forum-vote-down {
    color: #b05555;
}

.forum-vote-score {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #3d2b1f;
    line-height: 1;
}

/* ── Thread Row Content ───────────────────────────────────────── */

.forum-thread-content {
    flex: 1;
    min-width: 0;
}

.forum-thread-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.88rem;
    color: #3d2b1f;
    line-height: 1.3;
    margin-bottom: 4px;
}

.forum-thread-snippet {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.78rem;
    color: #6b5740;
    line-height: 1.4;
    margin-bottom: 4px;
}

.forum-thread-meta {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.78rem;
    color: #a89279;
}

.forum-thread-author {
    color: #6b5740;
    font-weight: 700;
}

.forum-thread-sep {
    margin: 0 4px;
    color: #c9b99a;
}

/* ── Thread Detail ────────────────────────────────────────────── */

.forum-back-btn {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.75rem;
    background: transparent;
    color: #a89279;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 12px;
    transition: color 0.15s;
}

.forum-back-btn:hover {
    color: #d4a853;
}

.forum-detail {
    margin-bottom: 24px;
}

.forum-detail-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.05rem;
    color: #3d2b1f;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
}

.forum-detail-meta {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.75rem;
    color: #a89279;
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
}

.forum-detail-vote {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

.forum-detail-divider {
    height: 1px;
    background: linear-gradient(to right, #8b7355, #c9b99a, transparent);
    margin-bottom: 14px;
}

.forum-detail-body {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.85rem;
    color: #3d2b1f;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ── Replies ──────────────────────────────────────────────────── */

.forum-replies-section {
    border-top: 1px solid rgba(139, 115, 85, 0.2);
    padding-top: 16px;
}

.forum-replies-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.82rem;
    color: #6b5740;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}

.forum-replies-empty {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.78rem;
    color: #a89279;
    font-style: italic;
    margin: 0 0 16px;
}

.forum-replies {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 16px;
}

.forum-reply {
    padding: 10px 0;
    border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}

.forum-reply:last-child {
    border-bottom: none;
}

.forum-reply-meta {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.72rem;
    color: #a89279;
    margin-bottom: 4px;
}

.forum-reply-author {
    color: #6b5740;
    font-weight: 600;
}

.forum-reply-body {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.82rem;
    color: #3d2b1f;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ── Reply Form ───────────────────────────────────────────────── */

.forum-reply-form {
    margin-top: 16px;
}

.forum-reply-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ── Delete Button ────────────────────────────────────────────── */

.forum-delete-btn {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.7rem;
    background: transparent;
    color: #c9b99a;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.forum-delete-btn:hover {
    color: #b05555;
}

/* ── Pagination ───────────────────────────────────────────────── */

.forum-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(139, 115, 85, 0.15);
}

.forum-page-btn {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.75rem;
    background: transparent;
    color: #6b5740;
    border: 1px solid #c9b99a;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.forum-page-btn:hover {
    border-color: #d4a853;
    color: #d4a853;
}

.forum-page-info {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.72rem;
    color: #a89279;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 768px) {
    .forum-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .forum-thread {
        padding: 10px 4px;
    }

    .forum-vote {
        min-width: 30px;
    }

    .forum-compose {
        padding: 12px;
    }
}
