/* ===== FORUM PAGE STYLES ===== */

html, body { height: 100%; overflow: hidden; }

/* Background overlay override */
.page-bg-overlay { background: rgba(5, 0, 10, 0.85); }

/* ===== LAYOUT ===== */
.app-container {
    position: relative; z-index: 1;
    display: flex; height: calc(100vh - var(--nav-h));
    margin-top: var(--nav-h);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w); min-width: var(--sidebar-w);
    height: 100%; display: flex; flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 300ms var(--ease-out-expo);
}

.sidebar-header {
    padding: 1.2rem 1.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-title {
    font-family: var(--font-display); font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted);
}

.sidebar-search {
    margin-top: 10px; width: 100%; padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px; outline: none; color: var(--white);
    font-family: var(--font-body); font-size: 0.82rem;
    transition: border-color 200ms ease, background 200ms ease;
}
.sidebar-search::placeholder { color: rgba(154,143,181,0.4); }
.sidebar-search:focus { border-color: rgba(166,110,247,0.3); background: rgba(255,255,255,0.08); }

.cat-list { flex: 1; overflow-y: auto; padding: 0.6rem; display: flex; flex-direction: column; gap: 2px; }
.cat-group { margin-bottom: 4px; }

.cat-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 10px; cursor: pointer;
    border: 1px solid transparent; font-family: var(--font-body);
    transition: background 200ms ease, border-color 200ms ease; user-select: none;
}
.cat-item:hover { background: rgba(255, 255, 255, 0.04); }
.cat-item.active {
    background: linear-gradient(135deg, rgba(166,110,247,0.18), rgba(92,200,223,0.1));
    border-color: rgba(255, 255, 255, 0.1);
}

.cat-icon {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}

.cat-name { font-size: 0.82rem; font-weight: 600; color: var(--white); flex: 1; }

.cat-count {
    font-size: 0.68rem; color: var(--muted); font-weight: 500;
    padding: 1px 8px; border-radius: 8px; background: rgba(255,255,255,0.04);
}

.cat-arrow { color: var(--muted); font-size: 0.7rem; transition: transform 250ms ease; }
.cat-item.expanded .cat-arrow { transform: rotate(90deg); }

.sub-list {
    max-height: 0; overflow: hidden;
    transition: max-height 300ms var(--ease-out-expo); padding-left: 20px;
}
.sub-list.show { max-height: 400px; }

.sub-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 8px; cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
    color: var(--muted); font-size: 0.78rem; font-weight: 500;
}
.sub-item:hover { background: rgba(255,255,255,0.04); color: var(--white); }
.sub-item.active { color: var(--neon-cyan); background: rgba(92,200,223,0.08); }
.sub-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--muted); flex-shrink: 0; transition: background 200ms ease;
}
.sub-item.active .sub-dot { background: var(--neon-cyan); }

.icon-0 { background: linear-gradient(135deg, rgba(166,110,247,0.35), rgba(92,200,223,0.2)); }
.icon-1 { background: linear-gradient(135deg, rgba(224,96,154,0.35), rgba(166,110,247,0.2)); }
.icon-2 { background: linear-gradient(135deg, rgba(74,222,128,0.35), rgba(92,200,223,0.2)); }
.icon-3 { background: linear-gradient(135deg, rgba(240,208,96,0.35), rgba(224,96,154,0.2)); }
.icon-4 { background: linear-gradient(135deg, rgba(92,200,223,0.35), rgba(166,110,247,0.2)); }
.icon-5 { background: linear-gradient(135deg, rgba(224,150,80,0.35), rgba(240,208,96,0.2)); }

/* ===== CONTENT AREA ===== */
.content-area { flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; overflow-y: auto; }
.content-header { padding: 1.5rem 2rem 0; flex-shrink: 0; }

.content-breadcrumb {
    font-size: 0.72rem; color: var(--muted); margin-bottom: 0.5rem;
    display: flex; align-items: center; gap: 6px;
}
.content-breadcrumb span { color: var(--neon-purple); }

.content-title-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.3rem; gap: 10px;
}

.content-title {
    font-family: var(--font-display); font-size: 1.2rem; font-weight: 800;
    letter-spacing: 0.04em;
}

.posts-count {
    font-size: 0.78rem; color: var(--muted); font-weight: 500;
    padding: 4px 14px; border-radius: 10px; white-space: nowrap;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
}

.content-desc {
    font-size: 0.88rem; color: var(--muted); line-height: 1.6;
    max-width: 600px; margin-bottom: 1.2rem;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none; background: none; border: none; cursor: pointer;
    color: var(--muted); padding: 4px; transition: color 200ms ease;
}
.sidebar-toggle:hover { color: var(--white); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.sidebar-backdrop {
    display: none; position: fixed; inset: 0; z-index: 49;
    background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none;
    transition: opacity 300ms ease;
}

/* ===== NEW POST BUTTON ===== */
.new-post-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 20px; border: none; border-radius: 12px; cursor: pointer;
    background: linear-gradient(135deg, rgba(166,110,247,0.4), rgba(92,200,223,0.3));
    color: var(--white); font-family: var(--font-display);
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
    transition: background 250ms ease, transform 200ms var(--ease-spring), box-shadow 250ms ease;
    flex-shrink: 0;
}
.new-post-btn:hover {
    background: linear-gradient(135deg, rgba(166,110,247,0.55), rgba(92,200,223,0.45));
    transform: translateY(-1px); box-shadow: 0 4px 16px rgba(166,110,247,0.2);
}
.new-post-btn:active { transform: scale(0.95); }
.new-post-btn svg { width: 14px; height: 14px; }

/* ===== POST LIST ===== */
.posts-list { display: flex; flex-direction: column; gap: 0.8rem; padding: 0 2rem 2rem; }

.post-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px; padding: 1.3rem 1.5rem;
    display: flex; flex-direction: column; gap: 8px; cursor: pointer;
    transition: border-color 300ms ease, transform 300ms var(--ease-spring), background 300ms ease;
}
.post-card:hover {
    border-color: rgba(255, 255, 255, 0.15); transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
}

.post-card-top { display: flex; align-items: center; gap: 10px; }
.post-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; color: var(--white);
}
.post-author-info { flex: 1; min-width: 0; }
.post-author-name { font-size: 0.8rem; font-weight: 600; color: var(--white); }
.post-author-date { font-size: 0.66rem; color: rgba(154,143,181,0.5); }
.post-cat-tag {
    font-size: 0.58rem; font-weight: 600; padding: 2px 10px; border-radius: 6px;
    letter-spacing: 0.04em; flex-shrink: 0;
}

.post-card-title {
    font-family: var(--font-display); font-size: 0.82rem; font-weight: 700;
    letter-spacing: 0.03em; line-height: 1.4;
}
.post-card-preview {
    font-size: 0.82rem; color: var(--muted); line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-footer {
    display: flex; align-items: center; gap: 1.2rem;
    font-size: 0.68rem; color: rgba(154,143,181,0.5);
    padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.04);
}
.post-stat { display: flex; align-items: center; gap: 4px; }
.post-stat svg { width: 13px; height: 13px; opacity: 0.5; }
.post-links-count { color: var(--neon-cyan); }

.tag-ann { background: rgba(224,96,154,0.15); color: var(--neon-pink); }
.tag-chat { background: rgba(154,143,181,0.12); color: var(--muted); }
.tag-tactic { background: rgba(166,110,247,0.15); color: var(--neon-purple); }
.tag-event { background: rgba(92,200,223,0.15); color: var(--neon-cyan); }
.tag-bug { background: rgba(224,150,80,0.15); color: var(--neon-orange); }
.tag-suggest { background: rgba(74,222,128,0.15); color: var(--neon-green); }
.tag-show { background: rgba(240,208,96,0.15); color: var(--neon-yellow); }
.tag-res { background: rgba(166,110,247,0.15); color: var(--neon-purple); }

/* ===== POST DETAIL VIEW ===== */
.detail-view { display: none; flex-direction: column; height: 100%; }
.detail-view.active { display: flex; }
.list-view.hidden { display: none; }

.detail-toolbar {
    display: flex; align-items: center; gap: 12px;
    padding: 1rem 2rem; border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0;
}
.detail-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px;
    background: rgba(255,255,255,0.04); color: var(--muted); cursor: pointer;
    font-family: var(--font-body); font-size: 0.78rem; font-weight: 600;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.detail-back:hover { background: rgba(255,255,255,0.08); color: var(--white); border-color: rgba(255,255,255,0.15); }
.detail-back svg { width: 14px; height: 14px; }

.detail-body { flex: 1; overflow-y: auto; padding: 1.5rem 2rem 2rem; }

.detail-header { margin-bottom: 1.5rem; }
.detail-title {
    font-family: var(--font-display); font-size: 1.3rem; font-weight: 800;
    letter-spacing: 0.03em; line-height: 1.4; margin-bottom: 12px;
}
.detail-meta {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.detail-author {
    display: flex; align-items: center; gap: 8px;
}
.detail-author-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 700; color: var(--white);
}
.detail-author-name { font-size: 0.82rem; font-weight: 600; }
.detail-date { font-size: 0.72rem; color: var(--muted); }

.detail-content {
    font-size: 0.92rem; line-height: 1.9; color: rgba(240,234,255,0.85);
    padding: 1.4rem 1.6rem; margin-bottom: 2rem;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px; white-space: pre-wrap; word-break: break-word;
}
.detail-content a {
    color: var(--neon-cyan); text-decoration: none;
    border-bottom: 1px solid rgba(92,200,223,0.3);
    transition: border-color 200ms ease, color 200ms ease;
}
.detail-content a:hover { color: var(--neon-purple); border-color: rgba(166,110,247,0.5); }

/* ===== LINKS SECTION ===== */
.detail-links {
    margin-bottom: 1.5rem; padding: 1rem 1.2rem;
    background: rgba(92,200,223,0.04); border: 1px solid rgba(92,200,223,0.08);
    border-radius: 12px;
}
.detail-links-title {
    font-family: var(--font-display); font-size: 0.68rem; font-weight: 700;
    color: var(--neon-cyan); letter-spacing: 0.1em; margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px;
}
.detail-links-title svg { width: 14px; height: 14px; }
.detail-link-item {
    display: flex; align-items: center; gap: 8px; padding: 6px 0;
}
.detail-link-item a {
    color: var(--neon-cyan); text-decoration: none; font-size: 0.82rem; font-weight: 500;
    border-bottom: 1px solid transparent; transition: border-color 200ms ease;
}
.detail-link-item a:hover { border-color: var(--neon-cyan); }
.detail-link-icon { font-size: 0.7rem; opacity: 0.5; }

/* ===== COMMENTS ===== */
.comments-section { border-top: 1px solid rgba(255,255,255,0.06); padding-top: 1.5rem; }
.comments-title {
    font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.06em; margin-bottom: 1rem;
    display: flex; align-items: center; gap: 8px;
}
.comments-count-badge {
    font-size: 0.62rem; padding: 1px 8px; border-radius: 8px;
    background: rgba(255,255,255,0.06); color: var(--muted); font-weight: 500;
}

.comment-item {
    display: flex; gap: 12px; padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.comment-item:last-of-type { border-bottom: none; }
.comment-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 700; color: var(--white);
}
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-name { font-size: 0.78rem; font-weight: 600; }
.comment-date { font-size: 0.64rem; color: rgba(154,143,181,0.45); }
.comment-text { font-size: 0.84rem; color: rgba(240,234,255,0.75); line-height: 1.7; }
.comment-text a {
    color: var(--neon-cyan); text-decoration: none;
    border-bottom: 1px solid rgba(92,200,223,0.3);
    transition: border-color 200ms ease;
}
.comment-text a:hover { border-color: var(--neon-cyan); }

.comment-input-area {
    display: flex; gap: 10px; margin-top: 1rem; padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.comment-input {
    flex: 1; padding: 10px 16px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px; outline: none; color: var(--white);
    font-family: var(--font-body); font-size: 0.84rem;
    transition: border-color 200ms ease, background 200ms ease;
    resize: none; min-height: 42px; max-height: 120px;
}
.comment-input::placeholder { color: rgba(154,143,181,0.35); }
.comment-input:focus { border-color: rgba(166,110,247,0.3); background: rgba(255,255,255,0.08); }

.comment-submit {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: none; border-radius: 50%; cursor: pointer;
    background: linear-gradient(135deg, rgba(166,110,247,0.4), rgba(92,200,223,0.3));
    color: var(--white); flex-shrink: 0;
    transition: background 250ms ease, transform 200ms var(--ease-spring);
}
.comment-submit:hover {
    background: linear-gradient(135deg, rgba(166,110,247,0.55), rgba(92,200,223,0.45));
    transform: scale(1.05);
}
.comment-submit:active { transform: scale(0.9); }
.comment-submit svg { width: 18px; height: 18px; }

/* ===== NEW POST MODAL ===== */
.modal-backdrop {
    display: none; position: fixed; inset: 0; z-index: 150;
    background: rgba(0,0,0,0.6);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    justify-content: center; align-items: center;
    opacity: 0; transition: opacity 300ms ease;
}
.modal-backdrop.show { display: flex; opacity: 1; }

.modal {
    width: 90%; max-width: 560px;
    background: linear-gradient(135deg, rgba(20,12,40,0.95), rgba(10,5,20,0.98));
    border: 1px solid rgba(255,255,255,0.1); border-radius: 20px;
    padding: 2rem; display: flex; flex-direction: column; gap: 1rem;
    transform: translateY(20px); transition: transform 300ms var(--ease-spring);
}
.modal-backdrop.show .modal { transform: translateY(0); }

.modal-title {
    font-family: var(--font-display); font-size: 0.9rem; font-weight: 800;
    letter-spacing: 0.06em;
}
.modal-input {
    padding: 10px 16px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; outline: none; color: var(--white);
    font-family: var(--font-body); font-size: 0.86rem;
    transition: border-color 200ms ease;
}
.modal-input:focus { border-color: rgba(166,110,247,0.3); }
.modal-input::placeholder { color: rgba(154,143,181,0.35); }

.modal-textarea {
    padding: 12px 16px; min-height: 140px; resize: vertical;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; outline: none; color: var(--white);
    font-family: var(--font-body); font-size: 0.86rem; line-height: 1.7;
    transition: border-color 200ms ease;
}
.modal-textarea:focus { border-color: rgba(166,110,247,0.3); }
.modal-textarea::placeholder { color: rgba(154,143,181,0.35); }

.modal-link-hint {
    font-size: 0.7rem; color: var(--muted);
    padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,0.03);
}

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-cancel {
    padding: 8px 20px; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
    background: transparent; color: var(--muted); cursor: pointer;
    font-family: var(--font-body); font-size: 0.82rem; font-weight: 600;
    transition: background 200ms ease, color 200ms ease;
}
.modal-cancel:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.modal-publish {
    padding: 8px 24px; border: none; border-radius: 12px; cursor: pointer;
    background: linear-gradient(135deg, rgba(166,110,247,0.4), rgba(92,200,223,0.3));
    color: var(--white); font-family: var(--font-display);
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
    transition: background 250ms ease, transform 200ms var(--ease-spring);
}
.modal-publish:hover { background: linear-gradient(135deg, rgba(166,110,247,0.55), rgba(92,200,223,0.45)); transform: translateY(-1px); }
.modal-publish:active { transform: scale(0.95); }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 2rem; right: 2rem; z-index: 200;
    padding: 12px 24px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(74,222,128,0.25), rgba(92,200,223,0.15));
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border: 1px solid rgba(74,222,128,0.2);
    color: var(--neon-green); font-family: var(--font-body);
    font-size: 0.82rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    transform: translateY(20px); opacity: 0;
    transition: transform 350ms var(--ease-spring), opacity 300ms ease;
    pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 16px; height: 16px; }

/* ===== SCROLLBAR ===== */
.content-area::-webkit-scrollbar, .cat-list::-webkit-scrollbar, .detail-body::-webkit-scrollbar { width: 3px; }
.content-area::-webkit-scrollbar-track, .cat-list::-webkit-scrollbar-track, .detail-body::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb, .cat-list::-webkit-scrollbar-thumb, .detail-body::-webkit-scrollbar-thumb { background: rgba(166,110,247,0.3); border-radius: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: 0; top: var(--nav-h); bottom: 0;
        z-index: 50; transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop { display: block; }
    .sidebar-backdrop.show { opacity: 1; pointer-events: all; }
    .sidebar-toggle { display: flex; }
    .content-header { padding: 1.2rem 1.2rem 0; }
    .posts-list { padding: 0 1.2rem 1.5rem; }
    .detail-toolbar { padding: 0.8rem 1.2rem; }
    .detail-body { padding: 1rem 1.2rem 1.5rem; }
    .detail-title { font-size: 1.1rem; }
    .toast { bottom: 1rem; right: 1rem; left: 1rem; justify-content: center; }
    .modal { width: 95%; padding: 1.5rem; }
}

@media (max-width: 480px) {
    .post-card { padding: 1rem 1.1rem; }
    .content-title { font-size: 1rem; }
    .new-post-btn span.btn-text { display: none; }
}
