:root {
    --forum-bg: #0b0c14;
    --thread-bg: #151722;
    --sidebar-bg: #1a1c29;
    --border-soft: rgba(255, 255, 255, 0.08);
    --border-focus: #6c63ff;
    --text-muted: #8b8ea1;
    --rank-admin: #ff4b2b;
    --rank-pro: #00d2ff;
    --rank-elite: #9d50bb;
    /* Restore global primary from style.css */
    --primary: #6C63FF;
}

body {
    background-color: var(--forum-bg);
    background-image: none;
    font-family: 'Inter', sans-serif;
}

/* Container & Layout */
.forum-container {
    padding-bottom: 80px;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    align-items: start;
}

/* Sidebar Styling */
.sidebar-box {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
}

.sidebar-box h3 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-soft);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    margin-bottom: 5px;
}

.category-list li:hover,
.category-list li.active {
    background: rgba(108, 99, 255, 0.1);
    color: #fff;
}

.cat-count {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Modal Fixes */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
}

/* Breadcrumbs */
.breadcrumb {
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb span {
    margin: 0 5px;
}

/* Forum Hero & Header */
.forum-hero {
    padding: 100px 0 40px;
    background: linear-gradient(180deg, rgba(108, 99, 255, 0.05) 0%, transparent 100%);
    text-align: center;
}

.forum-hero h1 {
    font-size: 2.5rem;
    letter-spacing: -1px;
}

/* Thread List View (XenForo Style) */
.forum-table-header {
    background: var(--sidebar-bg);
    padding: 12px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-soft);
}

.topic-item {
    background: var(--thread-bg);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.topic-item:last-child {
    border-radius: 0 0 12px 12px;
}

.topic-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Global Postbit Layout (Thread View) */
.post-container {
    display: block;
    margin-bottom: 20px;
    animation: fadeIn 0.4s ease-out;
}

.post-row {
    background: var(--thread-bg);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 250px;
    overflow: hidden;
}

/* LEFT COLUMN: User Information (Postbit) */
.post-user-info {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-soft);
    padding: 25px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.post-user-info .author-avatar {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-size: 2rem;
}

.user-name {
    font-weight: 800;
    color: #fff;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-rank-box {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.user-extra-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 100%;
    border-top: 1px solid var(--border-soft);
    padding-top: 15px;
    text-align: left;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    position: relative;
}

.stat-row span {
    background: var(--sidebar-bg);
    z-index: 1;
    padding-right: 5px;
}

.stat-row strong {
    background: var(--sidebar-bg);
    z-index: 1;
    padding-left: 5px;
}

.stat-row::after {
    content: "";
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
    z-index: 0;
}

/* Header Nav Spacing Fix */
.nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* RIGHT COLUMN: Content Area */
.post-content-area {
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 10px;
}

.post-body {
    flex: 1;
    font-size: 1rem;
    line-height: 1.6;
    color: #e0e2ef;
}

.post-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid var(--border-soft);
}

/* User Signature */
.user-signature {
    margin-top: 30px;
    border-top: 1px dotted var(--border-soft);
    padding-top: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Editor Styles */
.forum-editor-container {
    background: var(--thread-bg);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}

.toolbar-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.toolbar-btn:hover {
    background: var(--primary);
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .post-row {
        grid-template-columns: 1fr;
    }

    .post-user-info {
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-soft);
        padding: 15px;
        text-align: left;
    }

    .post-user-info .author-avatar {
        width: 50px;
        height: 50px;
        margin-right: 15px;
        margin-bottom: 0;
    }

    .user-extra-stats {
        display: none;
    }
}