/* ============================================
   NEET HUB FORUMS — phpBB-Style Neon Theme
   ============================================ */

/* ============ HIDDEN-BY-DEFAULT ELEMENTS ============ */
/* User popup hover card — hidden until JS shows it */
.user-popup {
    position: fixed;
    z-index: 5000;
    width: 260px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-glow, #00f5ff);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 15px rgba(0, 245, 255, 0.1);
    display: none;
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity 0.15s, transform 0.15s;
}
.user-popup[style*="display: block"],
.user-popup[style*="display:block"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.popup-header { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.6rem; }
.popup-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--neon-purple, #b829e3); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem;
    border: 2px solid var(--border-glow, #00f5ff);
}
.popup-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.popup-name { font-weight: 700; color: var(--neon-cyan, #00f5ff); font-size: 0.95rem; }
.popup-role {
    font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 4px;
    background: rgba(0,245,255,0.1); color: var(--neon-cyan, #00f5ff);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.popup-role.admin { background: rgba(255,0,85,0.15); color: #ff0055; }
.popup-role.mod { background: rgba(184,41,227,0.15); color: #b829e3; }
.popup-bio { font-size: 0.8rem; color: var(--text-muted, #8892b0); margin: 0.4rem 0 0.6rem; }
.popup-stats { display: flex; gap: 1rem; margin-bottom: 0.6rem; }
.popup-stat { text-align: center; }
.popup-stat-val { display: block; font-weight: 700; color: var(--neon-cyan, #00f5ff); font-size: 0.95rem; }
.popup-stat-key { font-size: 0.68rem; color: var(--text-muted, #8892b0); text-transform: uppercase; }
.popup-dm-btn {
    background: rgba(0,245,255,0.08); border: 1px solid rgba(0,245,255,0.2);
    color: var(--neon-cyan, #00f5ff); padding: 0.35rem 0.6rem; border-radius: 6px;
    cursor: pointer; font-size: 0.78rem; transition: all 0.2s;
}
.popup-dm-btn:hover { background: rgba(0,245,255,0.18); }
.popup-footer { display: flex; justify-content: space-between; margin-top: 0.5rem; }
.popup-detail { font-size: 0.68rem; color: var(--text-muted, #8892b0); }

/* DM panel — hidden until opened */
.dm-panel {
    position: fixed;
    bottom: 0; right: 20px;
    width: 320px; height: 400px;
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-glow, #00f5ff);
    border-radius: 12px 12px 0 0;
    display: none;
    flex-direction: column;
    z-index: 4000;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
}
.dm-header {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(0,245,255,0.1);
    background: rgba(0,0,0,0.3); border-radius: 12px 12px 0 0;
}
.dm-title { flex: 1; font-weight: 700; color: var(--neon-cyan, #00f5ff); font-size: 0.9rem; }
.dm-close, .dm-back {
    background: none; border: none; color: var(--text-muted, #8892b0);
    cursor: pointer; font-size: 1rem; padding: 0.2rem;
}
.dm-close:hover, .dm-back:hover { color: var(--neon-cyan, #00f5ff); }
.dm-body { flex: 1; overflow-y: auto; padding: 0.5rem; }
.dm-empty { text-align: center; color: var(--text-muted, #8892b0); padding: 2rem 0.5rem; font-size: 0.85rem; }
.dm-unread-badge {
    background: #ff0055; color: #fff; font-size: 0.7rem;
    padding: 0.1rem 0.4rem; border-radius: 10px; font-weight: 700;
}
.dm-messages { flex: 1; overflow-y: auto; padding: 0.5rem; }
.dm-input-area { display: flex; gap: 0.4rem; padding: 0.5rem; border-top: 1px solid rgba(0,245,255,0.1); }
.dm-input {
    flex: 1; background: rgba(0,0,0,0.3); border: 1px solid rgba(0,245,255,0.15);
    color: #e0e0e0; padding: 0.4rem 0.6rem; border-radius: 6px; resize: none; font-size: 0.85rem;
}
.dm-send {
    background: var(--neon-cyan, #00f5ff); color: #0a0a1a; border: none;
    padding: 0.4rem 0.7rem; border-radius: 6px; cursor: pointer; font-weight: 700;
}

/* Lightbox — hidden until activated */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 9999;
    display: none; align-items: center; justify-content: center;
    cursor: zoom-out;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 90%; max-height: 90%; border-radius: 8px; }

/* ============ NAV OVERRIDES ============ */
.forum-btn.active {
    background: rgba(184, 41, 227, 0.25);
    border-color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(184, 41, 227, 0.2);
}
.topbar-btn {
    background: none; border: none; color: var(--neon-cyan);
    font-size: 1.1rem; cursor: pointer; padding: 0.4rem; transition: all 0.2s;
}
.topbar-btn:hover { color: var(--neon-purple); text-shadow: 0 0 10px var(--neon-cyan); }

/* ============ LAYOUT ============ */
.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 80px 1rem 2rem 1rem;
}

/* ============ BREADCRUMB ============ */
.forum-breadcrumb {
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted);
    margin-bottom: 1rem; padding: 0.4rem 0;
}
.forum-breadcrumb a { color: var(--neon-cyan); text-decoration: none; }
.forum-breadcrumb a:hover { text-decoration: underline; }
.forum-breadcrumb .bc-sep { color: var(--text-muted); margin: 0 0.1rem; }
.forum-breadcrumb .bc-current { color: var(--text-secondary); }

/* ============ TOOLBAR ============ */
.forum-toolbar {
    display: flex; align-items: center; gap: 0.8rem;
    margin-bottom: 1.2rem; flex-wrap: wrap;
}
.forum-search {
    flex: 1; min-width: 200px; position: relative;
}
.forum-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 0.85rem; z-index: 1;
}
.forum-search-input {
    width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); font-family: var(--font-body); font-size: 0.9rem;
    padding: 0.55rem 2rem 0.55rem 2.2rem; border-radius: 8px;
    transition: border-color 0.2s;
}
.forum-search-input:focus {
    outline: none; border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0,245,255,0.15);
}
.forum-search-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); font-size: 1.1rem;
    cursor: pointer; display: none; padding: 0.2rem 0.4rem;
}
.btn-new-thread {
    background: linear-gradient(135deg, rgba(0,245,255,0.15), rgba(184,41,227,0.15));
    border: 1px solid rgba(0,245,255,0.3); color: var(--neon-cyan);
    font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
    padding: 0.55rem 1.2rem; border-radius: 8px; cursor: pointer;
    white-space: nowrap; transition: all 0.2s;
}
.btn-new-thread:hover {
    background: linear-gradient(135deg, rgba(0,245,255,0.25), rgba(184,41,227,0.25));
    box-shadow: 0 0 12px rgba(0,245,255,0.2);
}

/* ============ FORUM INDEX — CATEGORY BLOCKS ============ */
.forum-category {
    margin-bottom: 1.5rem;
}
.forum-cat-header {
    display: flex; align-items: center; gap: 0.6rem;
    background: linear-gradient(90deg, rgba(184,41,227,0.12), rgba(0,245,255,0.05));
    border: 1px solid rgba(184,41,227,0.2); border-radius: 8px 8px 0 0;
    padding: 0.7rem 1rem; cursor: pointer; transition: all 0.2s;
}
.forum-cat-header:hover { background: linear-gradient(90deg, rgba(184,41,227,0.18), rgba(0,245,255,0.08)); }
.forum-cat-icon { font-size: 1.1rem; }
.forum-cat-name {
    font-family: var(--font-display); font-size: 0.85rem; font-weight: 700;
    color: var(--text-primary); letter-spacing: 1px; text-transform: uppercase;
}
.forum-cat-toggle {
    margin-left: auto; color: var(--text-muted); font-size: 0.8rem;
    transition: transform 0.2s;
}
.forum-cat-toggle.collapsed { transform: rotate(-90deg); }

.forum-boards {
    border: 1px solid var(--border); border-top: none;
    border-radius: 0 0 8px 8px; overflow: hidden;
}

/* ============ BOARD ROW ============ */
.board-row {
    display: grid;
    grid-template-columns: 42px 1fr 80px 80px 200px;
    align-items: center;
    padding: 0.7rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    gap: 0.5rem;
}
.board-row:last-child { border-bottom: none; }
.board-row:hover { background: rgba(22,22,42,0.8); }

.board-icon {
    font-size: 1.3rem; text-align: center;
}
.board-info { min-width: 0; }
.board-name {
    font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
    color: var(--neon-cyan); cursor: pointer; text-decoration: none;
    display: inline-block;
}
.board-name:hover { color: #fff; text-shadow: 0 0 8px rgba(0,245,255,0.4); text-decoration: none; }
.board-desc {
    font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.15rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board-sub-boards {
    font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem;
}
.board-sub-boards a { color: var(--neon-purple); font-size: 0.75rem; }

.board-stat {
    font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary);
    text-align: center;
}
.board-stat-label {
    display: block; font-size: 0.65rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.board-last-post {
    font-size: 0.75rem; color: var(--text-secondary); min-width: 0;
}
.board-last-post-title {
    color: var(--text-primary); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: block; cursor: pointer;
}
.board-last-post-title:hover { color: var(--neon-cyan); }
.board-last-post-meta {
    color: var(--text-muted); font-family: var(--font-mono); font-size: 0.7rem;
    margin-top: 0.1rem;
}
.board-last-post-meta a { color: var(--neon-purple); }

/* Board header row (column labels) */
.board-header-row {
    display: grid;
    grid-template-columns: 42px 1fr 80px 80px 200px;
    padding: 0.4rem 1rem;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}
.board-header-label {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px; text-align: center;
}
.board-header-label:nth-child(2) { text-align: left; }

/* ============ THREAD LISTING ============ */
.thread-list-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; gap: 0.8rem; flex-wrap: wrap;
}
.thread-list-title {
    font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
    color: var(--text-primary); letter-spacing: 0.5px;
}
.thread-list-title .tlt-icon { margin-right: 0.4rem; }
.thread-sort-tabs {
    display: flex; gap: 0.3rem;
}
.thread-sort-tab {
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    color: var(--text-secondary); font-family: var(--font-body); font-size: 0.8rem;
    font-weight: 500; padding: 0.35rem 0.9rem; border-radius: 20px;
    cursor: pointer; transition: all 0.2s;
}
.thread-sort-tab:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.thread-sort-tab.active { background: rgba(0,245,255,0.08); border-color: rgba(0,245,255,0.2); color: var(--neon-cyan); }

/* Thread table */
.thread-table {
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.thread-table-header {
    display: grid;
    grid-template-columns: 1fr 70px 70px 180px;
    padding: 0.45rem 1rem;
    background: linear-gradient(90deg, rgba(184,41,227,0.1), rgba(0,245,255,0.04));
    border-bottom: 1px solid rgba(184,41,227,0.15);
    gap: 0.5rem;
}
.thread-col-label {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px; text-align: center;
}
.thread-col-label:first-child { text-align: left; }

.thread-row {
    display: grid;
    grid-template-columns: 1fr 70px 70px 180px;
    padding: 0.65rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    gap: 0.5rem;
    align-items: center;
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: rgba(22,22,42,0.8); }
.thread-row.pinned { background: rgba(184,41,227,0.06); border-left: 3px solid var(--neon-purple); }
.thread-row.locked { opacity: 0.7; }

.thread-title-area { min-width: 0; }
.thread-badges {
    display: flex; gap: 0.3rem; margin-bottom: 0.15rem; flex-wrap: wrap;
}
.thread-badge {
    font-size: 0.6rem; font-family: var(--font-mono); padding: 0.1rem 0.4rem;
    border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.thread-badge.pinned { background: rgba(184,41,227,0.2); color: var(--neon-purple); }
.thread-badge.locked { background: rgba(255,45,117,0.15); color: var(--neon-pink); }
.thread-badge.solved { background: rgba(57,255,20,0.15); color: var(--neon-green); }
.thread-badge.hot { background: rgba(245,245,32,0.15); color: var(--neon-yellow); }

.thread-title-link {
    font-size: 0.92rem; font-weight: 600; color: var(--text-primary);
    cursor: pointer; display: inline; line-height: 1.3;
}
.thread-title-link:hover { color: var(--neon-cyan); text-decoration: none; }
.thread-row.pinned .thread-title-link { color: var(--neon-purple); }

.thread-meta {
    font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem;
    font-family: var(--font-mono);
}
.thread-meta a { color: var(--neon-purple); }
.thread-tags { display: inline; }
.thread-tag {
    font-size: 0.65rem; background: rgba(0,245,255,0.08); color: var(--neon-cyan);
    padding: 0.1rem 0.35rem; border-radius: 3px; margin-left: 0.3rem;
}

.thread-stat {
    font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-secondary);
    text-align: center;
}

.thread-last-post {
    font-size: 0.73rem; color: var(--text-secondary); min-width: 0;
}
.thread-last-post-by { color: var(--neon-purple); cursor: pointer; }
.thread-last-post-by:hover { text-decoration: underline; }
.thread-last-post-time {
    display: block; font-family: var(--font-mono); font-size: 0.68rem;
    color: var(--text-muted); margin-top: 0.1rem;
}

/* ============ THREAD VIEW — POSTS ============ */
.thread-view-header {
    margin-bottom: 1rem;
}
.thread-view-title {
    font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
    color: var(--text-primary); letter-spacing: 0.3px; margin-bottom: 0.3rem;
}
.thread-view-info {
    font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono);
    display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
}
.thread-view-info a { color: var(--neon-purple); }

.thread-mod-bar {
    display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.thread-mod-btn {
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 0.75rem; font-family: var(--font-body);
    padding: 0.3rem 0.7rem; border-radius: 6px; cursor: pointer;
    transition: all 0.2s;
}
.thread-mod-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.thread-mod-btn.danger { border-color: rgba(255,45,117,0.2); color: var(--neon-pink); }
.thread-mod-btn.danger:hover { background: rgba(255,45,117,0.1); }

/* Individual post in thread */
.forum-post {
    display: grid;
    grid-template-columns: 160px 1fr;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.8rem;
    overflow: hidden;
    background: var(--bg-card);
}
.forum-post.op { border-color: rgba(0,245,255,0.15); }
.forum-post:target { box-shadow: 0 0 12px rgba(0,245,255,0.2); }

/* Author sidebar */
.post-author-sidebar {
    background: rgba(0,0,0,0.15);
    padding: 1rem 0.8rem;
    text-align: center;
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.post-author-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--border);
    display: block; margin: 0 auto;
}
.post-author-avatar-fallback {
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; color: #fff;
    border: 2px solid var(--border);
}
.post-author-emoji-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; background: rgba(255,255,255,0.05);
    border: 2px solid var(--border);
}
.post-author-name {
    font-weight: 600; font-size: 0.85rem; color: var(--neon-cyan);
    cursor: pointer; word-break: break-word;
}
.post-author-name:hover { text-decoration: underline; }
.post-author-role {
    font-family: var(--font-mono); font-size: 0.6rem; padding: 0.1rem 0.4rem;
    border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.post-author-role.admin { background: rgba(255,45,117,0.15); color: var(--neon-pink); }
.post-author-role.mod { background: rgba(184,41,227,0.15); color: var(--neon-purple); }
.post-author-role.member { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.post-author-rank {
    font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-muted);
}
.post-author-stats {
    font-family: var(--font-mono); font-size: 0.62rem; color: var(--text-muted);
    line-height: 1.4;
}
.post-author-joined {
    font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted);
}
.post-author-signature {
    font-size: 0.7rem; color: var(--text-muted); font-style: italic;
    margin-top: 0.3rem; word-break: break-word; max-height: 60px; overflow: hidden;
    border-top: 1px solid var(--border); padding-top: 0.3rem;
}

/* Post content area */
.post-content-area {
    display: flex; flex-direction: column;
}
.post-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap; gap: 0.3rem;
}
.post-number {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
}
.post-number a { color: var(--text-muted); }
.post-number a:hover { color: var(--neon-cyan); }
.post-date {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
}

.post-body {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-primary);
    flex: 1;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* BBCode rendered elements */
.post-body .bb-bold { font-weight: 700; }
.post-body .bb-italic { font-style: italic; }
.post-body .bb-underline { text-decoration: underline; }
.post-body .bb-strike { text-decoration: line-through; color: var(--text-muted); }
.post-body .bb-code {
    display: block; background: rgba(0,0,0,0.3); border: 1px solid var(--border);
    border-radius: 6px; padding: 0.8rem 1rem; font-family: var(--font-mono);
    font-size: 0.82rem; color: var(--neon-green); margin: 0.5rem 0;
    overflow-x: auto; white-space: pre-wrap;
}
.post-body .bb-inline-code {
    background: rgba(0,0,0,0.3); padding: 0.15rem 0.4rem; border-radius: 3px;
    font-family: var(--font-mono); font-size: 0.85em; color: var(--neon-green);
}
.post-body .bb-quote {
    border-left: 3px solid var(--neon-purple);
    background: rgba(184,41,227,0.06);
    padding: 0.6rem 1rem; margin: 0.5rem 0; border-radius: 0 6px 6px 0;
    font-style: italic; color: var(--text-secondary);
}
.post-body .bb-quote-author {
    font-style: normal; font-weight: 600; color: var(--neon-purple);
    font-size: 0.8rem; margin-bottom: 0.3rem;
}
.post-body .bb-spoiler {
    background: var(--bg-tertiary); color: transparent; padding: 0.2rem 0.5rem;
    border-radius: 4px; cursor: pointer; transition: color 0.2s;
    user-select: none;
}
.post-body .bb-spoiler.revealed { color: var(--text-primary); }
.post-body .bb-heading {
    font-family: var(--font-display); font-size: 1rem; font-weight: 700;
    color: var(--neon-cyan); margin: 0.8rem 0 0.4rem;
}
.post-body .bb-url { color: var(--neon-cyan); text-decoration: underline; }
.post-body .bb-img {
    max-width: 100%; max-height: 400px; border-radius: 6px;
    cursor: pointer; margin: 0.4rem 0; display: block;
}
.post-body .bb-list { padding-left: 1.5rem; margin: 0.4rem 0; }
.post-body .bb-list li { margin-bottom: 0.2rem; }
.post-body .bb-color { /* color set inline */ }

/* Post attachments */
.post-attachments {
    padding: 0.5rem 1rem; border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.05);
}
.post-attachments-label {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; margin-bottom: 0.3rem;
}
.post-attachment-item {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: rgba(0,245,255,0.06); border: 1px solid rgba(0,245,255,0.15);
    border-radius: 5px; padding: 0.25rem 0.5rem; margin: 0.2rem;
    font-size: 0.75rem; color: var(--neon-cyan); cursor: pointer;
}
.post-attachment-item:hover { background: rgba(0,245,255,0.12); }
.post-attachment-img {
    max-width: 150px; max-height: 100px; border-radius: 4px;
    margin: 0.3rem; cursor: pointer;
}

/* Post footer (actions) */
.post-footer {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.08);
    flex-wrap: wrap;
}
.post-action-btn {
    background: none; border: none; color: var(--text-muted);
    font-size: 0.75rem; font-family: var(--font-body); cursor: pointer;
    padding: 0.25rem 0.5rem; border-radius: 4px;
    transition: all 0.2s; display: flex; align-items: center; gap: 0.25rem;
}
.post-action-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.post-action-btn.active { color: var(--neon-cyan); }
.post-action-btn.upvoted { color: var(--neon-cyan); text-shadow: 0 0 6px rgba(0,245,255,0.3); }
.post-action-btn.downvoted { color: var(--neon-pink); text-shadow: 0 0 6px rgba(255,45,117,0.3); }
.post-vote-count {
    font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
    min-width: 20px; text-align: center;
}

.post-edit-indicator {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted);
    margin-left: auto; cursor: pointer;
}
.post-edit-indicator:hover { color: var(--neon-cyan); }

/* ============ QUICK REPLY ============ */
.quick-reply-box {
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-card); padding: 1rem; margin-top: 0.5rem;
}
.quick-reply-box h3 {
    font-family: var(--font-display); font-size: 0.85rem; color: var(--text-primary);
    margin-bottom: 0.6rem;
}
.quick-reply-textarea {
    width: 100%; min-height: 120px; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 6px; color: var(--text-primary);
    font-family: var(--font-body); font-size: 0.9rem; padding: 0.7rem;
    resize: vertical; transition: border-color 0.2s;
}
.quick-reply-textarea:focus {
    outline: none; border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0,245,255,0.1);
}
.quick-reply-actions {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 0.6rem; gap: 0.5rem;
}
.quick-reply-submit {
    background: linear-gradient(135deg, rgba(0,245,255,0.15), rgba(184,41,227,0.15));
    border: 1px solid rgba(0,245,255,0.3); color: var(--neon-cyan);
    font-family: var(--font-body); font-weight: 600; font-size: 0.85rem;
    padding: 0.45rem 1.2rem; border-radius: 6px; cursor: pointer;
    transition: all 0.2s;
}
.quick-reply-submit:hover {
    background: linear-gradient(135deg, rgba(0,245,255,0.25), rgba(184,41,227,0.25));
    box-shadow: 0 0 10px rgba(0,245,255,0.2);
}
.quick-reply-attach {
    background: none; border: 1px solid var(--border); color: var(--text-secondary);
    font-size: 0.8rem; padding: 0.35rem 0.7rem; border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
}
.quick-reply-attach:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

/* ============ BBCODE TOOLBAR ============ */
.bbcode-toolbar {
    display: flex; gap: 0.2rem; padding: 0.4rem;
    background: rgba(0,0,0,0.15); border: 1px solid var(--border);
    border-bottom: none; border-radius: 6px 6px 0 0; flex-wrap: wrap;
}
.bbcode-toolbar button {
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 0.78rem; padding: 0.25rem 0.5rem;
    border-radius: 4px; cursor: pointer; transition: all 0.15s;
    min-width: 28px; text-align: center;
}
.bbcode-toolbar button:hover {
    background: rgba(0,245,255,0.1); color: var(--neon-cyan);
    border-color: rgba(0,245,255,0.2);
}
.bb-sep {
    width: 1px; background: var(--border); margin: 0.1rem 0.2rem;
    align-self: stretch;
}

/* ============ PAGINATION ============ */
.forum-pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 0.3rem; padding: 1rem 0; flex-wrap: wrap;
}
.page-btn {
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-secondary); font-family: var(--font-mono);
    font-size: 0.8rem; padding: 0.35rem 0.7rem; border-radius: 6px;
    cursor: pointer; transition: all 0.2s; min-width: 36px; text-align: center;
}
.page-btn:hover { background: rgba(0,245,255,0.08); color: var(--neon-cyan); border-color: rgba(0,245,255,0.2); }
.page-btn.active {
    background: rgba(0,245,255,0.12); border-color: var(--neon-cyan);
    color: var(--neon-cyan); font-weight: 600;
}
.page-btn.disabled { opacity: 0.4; cursor: default; pointer-events: none; }
.page-ellipsis {
    font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted);
    padding: 0.35rem 0.3rem;
}

/* ============ FORUM STATS BAR ============ */
.forum-stats-bar {
    display: flex; gap: 1.5rem; padding: 0.8rem 1rem; margin-top: 1rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; font-family: var(--font-mono); font-size: 0.75rem;
    color: var(--text-muted); flex-wrap: wrap;
}
.forum-stats-bar span { color: var(--neon-cyan); font-weight: 600; }

/* ============ EMPTY STATE ============ */
.forum-empty {
    text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.forum-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.forum-empty-text { font-size: 0.9rem; }
.forum-empty-cta {
    margin-top: 1rem; display: inline-block;
    background: linear-gradient(135deg, rgba(0,245,255,0.1), rgba(184,41,227,0.1));
    border: 1px solid rgba(0,245,255,0.2); color: var(--neon-cyan);
    padding: 0.5rem 1.5rem; border-radius: 8px; cursor: pointer;
    font-family: var(--font-body); font-weight: 600; font-size: 0.85rem;
    transition: all 0.2s;
}
.forum-empty-cta:hover { background: linear-gradient(135deg, rgba(0,245,255,0.2), rgba(184,41,227,0.2)); text-decoration: none; }

/* ============ SEARCH RESULTS ============ */
.search-result {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 0.8rem 1rem; margin-bottom: 0.6rem;
    transition: border-color 0.2s;
}
.search-result:hover { border-color: rgba(0,245,255,0.15); }
.search-result-title {
    font-weight: 600; font-size: 0.92rem; color: var(--neon-cyan); cursor: pointer;
}
.search-result-title:hover { text-decoration: underline; }
.search-result-snippet {
    font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.25rem;
    line-height: 1.4;
}
.search-result-snippet mark {
    background: rgba(0,245,255,0.15); color: var(--neon-cyan);
    padding: 0.05rem 0.2rem; border-radius: 2px;
}
.search-result-meta {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
    margin-top: 0.3rem;
}
.search-result-meta a { color: var(--neon-purple); }

/* ============ NEW THREAD MODAL OVERRIDES ============ */
.np-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300f5ff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 2rem; cursor: pointer;
}
.np-select option { background: var(--bg-secondary); color: var(--text-primary); }

/* ============ POST EDIT HISTORY POPUP ============ */
.edit-history-popup {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
    background: var(--bg-secondary); border: 1px solid var(--border-glow);
    border-radius: 12px; padding: 1.2rem; z-index: 10001;
    max-width: 500px; width: 90%; max-height: 70vh; overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.edit-history-popup h3 {
    font-family: var(--font-display); font-size: 0.9rem; margin-bottom: 0.8rem;
}
.edit-history-item {
    border-bottom: 1px solid var(--border); padding: 0.6rem 0;
}
.edit-history-item:last-child { border-bottom: none; }
.edit-history-time { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.edit-history-body { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.3rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .board-row {
        grid-template-columns: 32px 1fr 50px 50px;
    }
    .board-row .board-last-post { display: none; }
    .board-header-row {
        grid-template-columns: 32px 1fr 50px 50px;
    }
    .board-header-row .board-header-label:last-child { display: none; }

    .thread-row {
        grid-template-columns: 1fr 50px 50px;
    }
    .thread-row .thread-last-post { display: none; }
    .thread-table-header {
        grid-template-columns: 1fr 50px 50px;
    }
    .thread-table-header .thread-col-label:last-child { display: none; }

    .forum-post {
        grid-template-columns: 1fr;
    }
    .post-author-sidebar {
        flex-direction: row; text-align: left; gap: 0.6rem;
        padding: 0.6rem 0.8rem; border-right: none;
        border-bottom: 1px solid var(--border);
        flex-wrap: wrap; justify-content: flex-start;
    }
    .post-author-avatar, .post-author-avatar-fallback, .post-author-emoji-avatar {
        width: 36px; height: 36px; font-size: 1rem;
    }
    .post-author-stats, .post-author-joined, .post-author-signature { display: none; }
}

@media (max-width: 480px) {
    .page { padding: 72px 0.6rem 1.5rem; }
    .forum-toolbar { flex-direction: column; }
    .btn-new-thread { width: 100%; text-align: center; }
    .thread-list-header { flex-direction: column; align-items: flex-start; }
    .board-row { grid-template-columns: 1fr; gap: 0.3rem; padding: 0.6rem; }
    .board-icon, .board-stat { display: none; }
    .board-header-row { display: none; }
    .thread-row { grid-template-columns: 1fr; gap: 0.2rem; padding: 0.6rem; }
    .thread-stat { display: none; }
    .thread-table-header { display: none; }
}

/* ============ UPLOAD PREVIEW ============ */
.upload-preview {
    display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem;
}
.upload-preview-item {
    position: relative; background: rgba(0,0,0,0.2);
    border: 1px solid var(--border); border-radius: 6px;
    padding: 0.3rem; display: flex; align-items: center; gap: 0.3rem;
}
.upload-preview-item img {
    max-width: 60px; max-height: 40px; border-radius: 4px;
}
.upload-preview-item .upload-name {
    font-size: 0.72rem; color: var(--text-secondary); max-width: 100px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload-remove {
    position: absolute; top: -6px; right: -6px;
    background: var(--neon-pink); color: #fff; border: none;
    border-radius: 50%; width: 18px; height: 18px; font-size: 0.65rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ============ MISC / NEW POST MODAL ============ */
.new-post-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    z-index: 9999; justify-content: center; align-items: flex-start;
    padding: 80px 1rem 1rem; overflow-y: auto;
}
.new-post-overlay.active { display: flex; }
.new-post-modal {
    background: var(--bg-secondary); border: 1px solid var(--border-glow);
    border-radius: 12px; padding: 1.5rem; width: 100%; max-width: 600px;
}
.new-post-modal h2 {
    font-family: var(--font-display); font-size: 1rem; margin-bottom: 1rem;
}
.np-field { margin-bottom: 0.8rem; }
.np-label {
    display: block; font-family: var(--font-mono); font-size: 0.75rem;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}
.np-input {
    width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); font-family: var(--font-body); font-size: 0.9rem;
    padding: 0.55rem 0.8rem; border-radius: 6px;
}
.np-input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 8px rgba(0,245,255,0.1); }
.np-textarea {
    width: 100%; background: var(--bg-tertiary); border: 1px solid var(--border);
    color: var(--text-primary); font-family: var(--font-body); font-size: 0.9rem;
    padding: 0.7rem 0.8rem; border-radius: 0 0 6px 6px; resize: vertical;
    min-height: 150px;
}
.np-textarea:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 8px rgba(0,245,255,0.1); }
.np-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.np-tag {
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 0.8rem; padding: 0.3rem 0.7rem;
    border-radius: 16px; cursor: pointer; transition: all 0.2s;
}
.np-tag:hover { background: rgba(255,255,255,0.08); }
.np-tag.active { background: rgba(0,245,255,0.1); border-color: rgba(0,245,255,0.25); color: var(--neon-cyan); }
.np-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }
.np-cancel {
    background: none; border: 1px solid var(--border); color: var(--text-secondary);
    padding: 0.5rem 1.2rem; border-radius: 8px; cursor: pointer; font-size: 0.85rem;
}
.np-cancel:hover { border-color: var(--text-muted); color: var(--text-primary); }
.np-submit {
    background: linear-gradient(135deg, rgba(0,245,255,0.15), rgba(184,41,227,0.15));
    border: 1px solid rgba(0,245,255,0.3); color: var(--neon-cyan);
    font-weight: 600; padding: 0.5rem 1.5rem; border-radius: 8px;
    cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
}
.np-submit:hover { box-shadow: 0 0 12px rgba(0,245,255,0.2); }
.upload-btn {
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    color: var(--text-secondary); padding: 0.4rem 0.8rem; border-radius: 6px;
    cursor: pointer; font-size: 0.8rem; transition: all 0.2s;
}
.upload-btn:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

/* ============ LOADING SPINNER ============ */
.forum-loading {
    display: flex; justify-content: center; align-items: center;
    padding: 3rem; color: var(--text-muted);
}
.forum-loading::after {
    content: ''; width: 24px; height: 24px; border: 2px solid var(--border);
    border-top-color: var(--neon-cyan); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin-left: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ ONLINE INDICATOR ============ */
.online-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--neon-green); margin-right: 0.3rem;
    box-shadow: 0 0 4px var(--neon-green);
}
.offline-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-muted); margin-right: 0.3rem;
}
