@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css');

:root {
    --bg:            #0d0e11;
    --bg-1:          #13151b;
    --bg-2:          #181a22;
    --bg-3:          #1e202a;

    --border:        #232632;
    --border-hover:  #323646;

    --text:          #e2e4e9;
    --text-muted:    #828799;
    --text-faint:    #525666;

    --accent:        #e63946;
    --accent-dim:    rgba(230,57,70,0.12);
    --accent-hover:  rgba(230,57,70,0.2);

    --yellow:        #e5a93c;
    --green:         #2ec4b6;
    --red:           #e63946;

    --radius-sm:     3px;
    --radius:        4px;
    --radius-lg:     6px;

    --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --container:     1180px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 20px;
}

/* Navbar */
.navbar {
    height: 56px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.navbar__brand {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.navbar__brand span { color: var(--accent); }
.nav-link {
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.15s;
}
.nav-link:hover, .nav-link--active { color: #fff; }
.btn-cta {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.btn-cta:hover { background: #d62839; }

/* Main Layout */
.forum-page { padding: 24px 0; flex: 1; }
.forum-layout { display: flex; gap: 20px; }
.forum-sidebar { width: 240px; flex-shrink: 0; }
.forum-main { flex: 1; min-width: 0; }

/* Sidebar Sections (Blair style) */
.fnav-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-1);
    margin-bottom: 12px;
    overflow: hidden;
}
.fnav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}
.fnav-header:hover { color: var(--text); }
.fnav-chevron { font-size: 0.65rem; transition: transform 0.2s ease; }
.fnav-header.collapsed .fnav-chevron { transform: rotate(-90deg); }
.fnav-body { transition: all 0.2s ease; }
.fnav-body.collapsed { display: none; }

.forum-sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    transition: all 0.15s;
    cursor: pointer;
}
.forum-sidebar__item:hover, .forum-sidebar__item--active {
    color: #fff;
    background: rgba(255,255,255,0.03);
}
.forum-sidebar__item--active {
    border-left: 2px solid var(--accent);
    color: #fff;
    font-weight: 600;
}

/* Toolbar & Sorting */
.forum-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.forum-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
}
.sort-dropdown { position: relative; }
.sort-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
}
.sort-btn:hover { border-color: var(--border-hover); }
.sort-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 160px;
    z-index: 100;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    display: none;
}
.sort-dropdown.open .sort-menu { display: block; }
.sort-option {
    padding: 8px 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
}
.sort-option:hover { color: #fff; background: var(--bg-2); }
.sort-option.active { color: var(--accent); font-weight: 600; }

/* Thread List Table (HvH + Blair Hybrid) */
.thread-list {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.tl-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.tl-main { flex: 1; min-width: 0; }
.tl-right { display: flex; align-items: center; gap: 24px; }
.tl-col-replies, .tl-col-views, .tl-col-activity { width: 55px; text-align: center; }
.tl-col-avatars { width: 60px; display: flex; justify-content: flex-end; }

.tl-row {
    display: flex;
    align-items: center;
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    gap: 16px;
    cursor: pointer;
}
.tl-row:last-child { border-bottom: none; }
.tl-row:hover { background: var(--bg-2); }
.tl-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tl-title-wrap { display: flex; align-items: center; gap: 8px; }
.tl-title {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tl-title:hover { color: var(--accent); }
.tl-pinned-icon { color: var(--accent); font-size: 0.8rem; }
.tl-category { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); }
.tl-cat-square { width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }

.tl-excerpt {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tl-avatars { display: flex; align-items: center; justify-content: flex-end; }
.tl-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--bg);
    overflow: hidden;
    background: var(--bg-2);
}
.tl-avatar img { width: 100%; height: 100%; object-fit: cover; }

.tl-stat { width: 55px; text-align: center; font-size: 0.82rem; color: var(--text-muted); }
.tl-stat-replies { font-weight: 600; color: var(--text); }

/* Thread Reader Detail View */
.thread-reader-view {
    display: none;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.reader-author-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.reader-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.badge-role {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 2px;
    text-transform: uppercase;
}
.badge-admin { background: rgba(230,57,70,0.15); color: var(--accent); border: 1px solid rgba(230,57,70,0.3); }
.badge-dev { background: rgba(46,196,182,0.15); color: var(--green); border: 1px solid rgba(46,196,182,0.3); }

.reply-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 10px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    font-size: 0.8rem;
    color: var(--text-faint);
    text-align: center;
    background: var(--bg-1);
}
