/* ── Forum board view (topic list) ─────────────────── */

.forum-page-wrapper {
    box-sizing: border-box;
    max-width: 980px;
    margin: 42px auto;
    padding: 0 20px;
    width: 100%;
}

.forum-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #d7e3f1;
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.forum-page-header h2 {
    font-family: "Comic Sans MS", sans-serif;
    color: #243c5a;
    margin: 0;
}

.breadcrumb {
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #718197;
    margin-bottom: 8px;
}

.breadcrumb a {
    color: #507cad;
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

/* Topic list table */
.topic-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #d5e1ef;
    border-radius: 12px;
    box-shadow: 0 4px 0 #dce6f1, 0 10px 22px rgba(48, 76, 109, 0.08);
    background: #fff;
    margin-bottom: 20px;
    overflow: hidden;
}

.topic-table th {
    background: linear-gradient(110deg, #507cad, #6498d2);
    color: white;
    font-family: "Comic Sans MS", sans-serif;
    font-size: 14px;
    padding: 10px 12px;
    border: 0;
    text-align: left;
}

.topic-table td {
    padding: 12px 14px;
    border: 1px solid #edf1f6;
    font-family: Arial, sans-serif;
    vertical-align: top;
}

.topic-table tbody tr:nth-child(even) { background-color: #f8fafd; }
.topic-table tbody tr:hover { background-color: #eff6ff; }

.topic-title-link {
    font-family: "Comic Sans MS", sans-serif;
    font-size: 17px;
    font-weight: bold;
    color: #315f91;
    text-decoration: none;
    transition: color 0.15s ease;
}
.topic-title-link:hover { color: #1c4779; text-decoration: underline; }

.topic-meta {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.pinned-badge {
    display: inline-block;
    background: #ffcc29;
    color: #000;
    border: 1px solid #c99c00;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    padding: 1px 6px;
    margin-right: 5px;
    font-family: "Comic Sans MS", sans-serif;
}

.forum-badge-icon {
    height: 13px;
    margin-right: 3px;
    object-fit: contain;
    vertical-align: -2px;
    width: 13px;
}

.locked-badge {
    display: inline-block;
    background: #e0e0e0;
    color: #555;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    padding: 1px 6px;
    margin-right: 5px;
    font-family: "Comic Sans MS", sans-serif;
}

.col-stat {
    width: 80px;
    text-align: center;
}

.stat-num {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.no-topics-msg {
    padding: 30px;
    text-align: center;
    font-family: "Comic Sans MS", sans-serif;
    color: #666;
    font-size: 16px;
}

/* ── Individual post cards (topic view) ────────────── */

.topic-post-card {
    background: #fff;
    border: 1px solid #d5e1ef;
    border-radius: 12px;
    box-shadow: 0 4px 0 #dce6f1, 0 10px 22px rgba(48, 76, 109, 0.08);
    margin-bottom: 22px;
    overflow: hidden;
}

.post-header {
    background: linear-gradient(110deg, #f5f9ff, #edf4fc);
    border-bottom: 1px solid #dbe5f0;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.post-author {
    font-family: "Comic Sans MS", sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: #284a70;
    text-decoration: none;
}
.post-author:hover { text-decoration: underline; }

.post-author-line {
    flex: 0 1 auto;
    max-width: 100%;
}

.post-author-line .post-author {
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-date {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #888;
}

.post-header > span:last-child {
    margin-left: auto;
}

.post-body {
    padding: 14px 16px;
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.72;
    color: #35475b;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-body > :first-child {
    margin-top: 0;
}

.post-body > :last-child {
    margin-bottom: 0;
}

.post-body .forum-post-image,
.rich-text-editor .forum-post-image {
    display: block;
    height: auto;
    margin: 10px 0;
    max-height: 720px;
    max-width: 100%;
    object-fit: contain;
}

.post-deleted {
    padding: 14px 16px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #999;
    font-style: italic;
}

/* Delete post button */
.delete-post-btn {
    background: #d32f2f;
    color: #fff;
    border: 1px solid #8e1b1b;
    border-radius: 4px;
    font-size: 12px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: "Comic Sans MS", sans-serif;
    transition: background 0.1s;
}
.delete-post-btn:hover { background: #b71c1c; }

.post-action-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
    filter: invert(26%) sepia(88%) saturate(1150%) hue-rotate(326deg) brightness(88%) contrast(95%);
}

.post-votes {
    align-items: center;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 8px;
    padding: 8px 14px;
}

.vote-button {
    align-items: center;
    background: #f4f7fb;
    border: 1px solid #c5ccd4;
    border-radius: 5px;
    color: #333;
    cursor: pointer;
    display: inline-flex;
    font: bold 13px Arial, sans-serif;
    gap: 6px;
    min-width: 54px;
    padding: 4px 8px;
}

.vote-button:hover:not(:disabled),
.vote-button.selected {
    background: #e2ecf8;
    border-color: #507cad;
}

.vote-button:disabled {
    cursor: default;
    opacity: 0.72;
}

.vote-button img {
    height: 20px;
    object-fit: contain;
    width: 20px;
}

.vote-button[data-vote="1"] img {
    filter: invert(43%) sepia(56%) saturate(650%) hue-rotate(83deg) brightness(88%) contrast(90%);
}

.vote-button[data-vote="-1"] img {
    filter: invert(24%) sepia(87%) saturate(1400%) hue-rotate(333deg) brightness(90%) contrast(95%);
}

.vote-status {
    color: #b3261e;
    font: 12px Arial, sans-serif;
}

.report-post-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #555;
    cursor: pointer;
    display: inline-flex;
    font: 13px Arial, sans-serif;
    gap: 4px;
    margin-left: auto;
    padding: 5px 8px;
}

.report-post-button:hover {
    color: #9b2525;
    text-decoration: underline;
}

.report-form {
    background: #f7f8fa;
    border: 1px solid #d5dbe3;
    border-radius: 5px;
    flex-basis: 100%;
    padding: 10px;
}

.report-form[hidden] {
    display: none;
}

.report-form label {
    color: #333;
    display: block;
    font: bold 13px Arial, sans-serif;
    margin-bottom: 6px;
}

.report-form textarea {
    border: 1px solid #aaa;
    border-radius: 4px;
    box-sizing: border-box;
    display: block;
    font: 13px Arial, sans-serif;
    min-height: 70px;
    padding: 8px;
    resize: vertical;
    width: 100%;
}

.report-submit-button {
    background: #507cad;
    border: 1px solid #345d8c;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font: bold 12px Arial, sans-serif;
    margin-top: 7px;
    padding: 6px 10px;
}

.report-submit-button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.report-status,
.report-submitted {
    color: #555;
    font: 12px Arial, sans-serif;
    margin-left: 8px;
}

.report-submitted {
    color: #477046;
}

/* Reply form */
.reply-box {
    margin-top: 30px;
    background: linear-gradient(145deg, #fff 0%, #f8fbff 100%);
    border: 1px solid #d5e1ef;
    border-radius: 14px;
    box-shadow: 0 5px 0 #dce6f1, 0 12px 26px rgba(48, 76, 109, 0.08);
    padding: 26px;
}

.reply-box:focus-within {
    border-color: #abc6e4;
}

.reply-box h3 {
    font-family: "Comic Sans MS", sans-serif;
    color: #243c5a;
    margin: 0 0 14px;
}

.reply-box textarea,
.rich-text-editor {
    width: 100%;
    min-height: 120px;
    padding: 10px;
    border: 1px solid #b9cce1;
    border-radius: 8px;
    box-sizing: border-box;
    font: 15px Arial, sans-serif;
    resize: vertical;
    margin-bottom: 12px;
}

.rich-text-editor {
    background: #fff;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.rich-text-editor:focus {
    border-color: #6498d2;
    box-shadow: 0 0 0 3px rgba(100, 152, 210, 0.17);
    outline: none;
}

.rich-text-editor:empty::before {
    content: attr(data-placeholder);
    color: #888;
    pointer-events: none;
}

.image-upload-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

.image-upload-button {
    align-items: center;
    background: #f4f7fb;
    border: 1px solid #b8c6d5;
    border-radius: 5px;
    color: #333;
    cursor: pointer;
    display: inline-flex;
    font: bold 13px Arial, sans-serif;
    gap: 6px;
    padding: 6px 10px;
}

.image-upload-button:hover:not(:disabled) {
    background: #e5eef8;
}

.image-upload-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.image-upload-button img {
    height: 18px;
    object-fit: contain;
    width: 18px;
}

.image-upload-status {
    color: #555;
    font: 12px Arial, sans-serif;
}

.editor-hint {
    color: #666;
    font: 12px Arial, sans-serif;
    margin: -4px 0 12px;
}

.reply-status {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
    min-height: 1.4em;
    margin-top: 8px;
}

/* Locked / login prompts */
.topic-notice {
    padding: 16px;
    background: #f4f7fb;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-family: "Comic Sans MS", sans-serif;
    font-size: 15px;
    color: #555;
    text-align: center;
    margin-top: 30px;
}

.topic-notice a { color: #0044cc; }
