/* forum/css/forum.css */

/* ── Category list ─────────────────────────────────────────────────────────── */

.forum_category_list { display: flex; flex-direction: column; gap: var(--base_gap_md, 0.5rem); }

.forum_category_row { padding: 1rem 1.25rem !important; }
.forum_category_row_locked { opacity: 0.6; }

.forum_category_main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.forum_category_icon .material-symbols-outlined {
    font-size: 1.75rem;
    color: var(--btn_primary_bg);
    flex-shrink: 0;
}

.forum_category_info { flex: 1; min-width: 0; }

.forum_category_name {
    font-weight: 600;
    font-size: 1rem;
    color: inherit;
    text-decoration: none;
}
.forum_category_name:hover { text-decoration: underline; }
.forum_category_name_locked { font-weight: 600; font-size: 1rem; color: var(--text_muted, #888); }

.forum_category_desc {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
}

.forum_category_stats {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.82rem;
    line-height: 1.6;
    min-width: 80px;
}

.forum_category_last {
    flex-shrink: 0;
    min-width: 160px;
    max-width: 220px;
    font-size: 0.82rem;
    text-align: right;
}

.forum_last_link {
    color: inherit;
    text-decoration: none;
    font-size: 0.82rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.forum_last_link:hover { text-decoration: underline; }

@media (max-width: 680px) {
    .forum_category_stats,
    .forum_category_last { display: none; }
}

/* ── Thread table ───────────────────────────────────────────────────────────── */

.forum_thread_table { border-collapse: collapse; }

.forum_thread_row td { vertical-align: top; padding: 0.6rem 0.5rem; }
.forum_thread_row + .forum_thread_row td { border-top: 1px solid var(--border_color, rgba(255,255,255,0.08)); }

.forum_thread_pinned td { background: rgba(255,255,255,0.03); }

.forum_thread_title_cell { min-width: 0; }

.forum_thread_link {
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    font-size: 0.93rem;
}
.forum_thread_link:hover { text-decoration: underline; }

.forum_thread_icon { font-size: 14px; vertical-align: middle; flex-shrink: 0; }
.forum_icon_pinned  { color: var(--btn_primary_bg); }
.forum_icon_locked  { color: var(--text_muted, #888); }

.forum_col_replies,
.forum_col_views { width: 70px; text-align: center; font-size: 0.85rem; }

.forum_col_last { width: 130px; font-size: 0.82rem; }

@media (max-width: 600px) {
    .forum_col_views { display: none; }
    .forum_col_last  { display: none; }
}

/* ── Thread view ────────────────────────────────────────────────────────────── */

.forum_badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    padding: 2px 10px;
    border-radius: 99px;
    color: #fff;
    vertical-align: middle;
}
.forum_badge_pinned { background: var(--btn_primary_bg); }
.forum_badge_locked { background: var(--text_muted, #888); }

/* Post card */
.forum_post { padding: 0 !important; overflow: hidden; }

.forum_post_inner {
    display: flex;
    gap: 0;
}

.forum_post_author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 0.75rem;
    min-width: 90px;
    max-width: 90px;
    border-right: 1px solid var(--border_color, rgba(255,255,255,0.08));
    text-align: center;
}

.forum_post_avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--btn_primary_bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    flex-shrink: 0;
}
.forum_post_avatar:hover { opacity: 0.85; }

.forum_post_username {
    font-size: 0.75rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    word-break: break-all;
}
.forum_post_username:hover { text-decoration: underline; }

.forum_post_num { font-size: 0.7rem; }

.forum_post_body_wrap {
    flex: 1;
    min-width: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.forum_post_body {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.65;
    word-break: break-word;
}

.forum_post_footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border_color, rgba(255,255,255,0.08));
    gap: 0.5rem;
    flex-wrap: wrap;
}

.forum_post_actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

@media (max-width: 500px) {
    .forum_post_author { min-width: 64px; max-width: 64px; }
    .forum_post_avatar { width: 36px; height: 36px; font-size: 0.85rem; }
}

/* ── Pagination ─────────────────────────────────────────────────────────────── */

.forum_pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.forum_page_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border-radius: var(--border_radius, 6px);
    border: 1px solid var(--border_color, rgba(255,255,255,0.12));
    font-size: 0.85rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.forum_page_btn:hover      { background: rgba(255,255,255,0.07); }
.forum_page_btn.is_active  { background: var(--btn_primary_bg); color: #fff; border-color: var(--btn_primary_bg); }

/* ── Modals ──────────────────────────────────────────────────────────────── */

.modal_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}


/* ── Forum topic and conversation polish ─────────────────────────────────── */

.forum_page_header { padding: 1.2rem 1.35rem !important; }

.forum_breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-bottom: 0.85rem;
    color: var(--text_muted, #777);
    font-size: 0.84rem;
}
.forum_breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit;
    text-decoration: none;
}
.forum_breadcrumb a:hover { color: var(--btn_primary_bg); text-decoration: underline; }
.forum_breadcrumb .material-symbols-outlined { font-size: 1rem; }
.forum_breadcrumb [aria-current="page"] {
    max-width: 34rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forum_page_header_main { gap: 1rem; }

.forum_header_meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    margin-top: 0.65rem;
    color: var(--text_muted, #777);
    font-size: 0.78rem;
}
.forum_header_meta > span { display: inline-flex; align-items: center; gap: 0.3rem; }
.forum_header_meta .material-symbols-outlined { font-size: 1rem; color: var(--btn_primary_bg); }

.forum_topic_list { display: flex; flex-direction: column; gap: var(--base_gap_md, 0.5rem); }

.forum_topic_row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) minmax(135px, auto) minmax(150px, 190px);
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.25rem !important;
    cursor: pointer;
}
.forum_topic_row:focus-visible {
    outline: 3px solid var(--btn_primary_bg);
    outline-offset: 2px;
}

.forum_topic_icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--btn_primary_bg);
}
.forum_topic_icon .material-symbols-outlined { font-size: 1.75rem; }
.forum_topic_main { min-width: 0; }
.forum_topic_heading { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }

.forum_thread_link {
    color: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
}
.forum_thread_link:hover { color: var(--btn_primary_bg); text-decoration: underline; }

.forum_topic_meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.3rem;
    color: var(--text_muted, #777);
    font-size: 0.76rem;
}

.forum_topic_stats {
    min-width: 80px;
    text-align: right;
    font-size: 0.82rem;
    line-height: 1.6;
}
.forum_topic_stats > span {
    display: block;
}
.forum_topic_stats strong { font-size: inherit; }

.forum_topic_stats small,
.forum_topic_last small,
.forum_topic_last time {
    color: var(--text_muted, #777);
    font-size: 0.7rem;
}
.forum_topic_stats small { margin-left: 0.25rem; }

.forum_topic_last {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 0.78rem;
}
.forum_topic_last strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
}

.forum_empty_state {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
}
.forum_empty_state > .material-symbols-outlined { color: var(--btn_primary_bg); font-size: 1.8rem; }
.forum_empty_state p { margin: 0.15rem 0 0; }

.forum_badge .material-symbols-outlined { font-size: 0.82rem; }
.forum_thread_heading { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }
.forum_thread_heading h1 { margin: 0; line-height: 1.2; }

.forum_post {
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid var(--border_color, rgba(0,0,0,0.1));
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.forum_post_author {
    justify-content: flex-start;
    padding: 1.05rem;
    min-width: 170px;
    max-width: 170px;
    border-right: 1px solid var(--border_color, rgba(255,255,255,0.08));
    background: rgba(255,255,255,0.2);
}

.forum_post_avatar {
    width: 62px;
    height: 62px;
    font-size: 1.15rem;
}
.forum_post_avatar img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.forum_post_author_identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.forum_post_username {
    max-width: 100%;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: normal;
}
.forum_post_handle {
    margin-top: 0.12rem;
    color: var(--text_muted, #777);
    font-size: 0.7rem;
}
.forum_author_badge {
    margin-top: 0.45rem;
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--btn_primary_bg);
    border-radius: 99px;
    color: var(--btn_primary_bg);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.forum_post_body_wrap { padding: 0; }

.forum_post_toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 42px;
    padding: 0.45rem 0.8rem 0.45rem 1rem;
    border-bottom: 1px solid var(--border_color, rgba(255,255,255,0.08));
    background: rgba(255,255,255,0.16);
}
.forum_post_time {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    color: var(--text_muted, #777);
    font-size: 0.73rem;
}
.forum_post_time a { color: var(--btn_primary_bg); font-weight: 700; text-decoration: none; }
.forum_post_time a:hover { text-decoration: underline; }

.forum_post_body {
    min-height: 72px;
    padding: 1rem 1.15rem 1.2rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.forum_post_actions .btn {
    min-width: 32px;
    min-height: 32px;
    padding: 0.25rem;
}
.forum_post_actions .material-symbols-outlined { font-size: 1.05rem; }

@media (max-width: 760px) {
    .forum_topic_row { grid-template-columns: 38px minmax(0, 1fr); align-items: start; }
    .forum_topic_icon { grid-row: 1 / span 3; }
    .forum_topic_stats { grid-column: 2; display: flex; }
    .forum_topic_stats > span {
        margin-right: 0.75rem;
    }
    .forum_topic_last {
        grid-column: 2;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .forum_topic_last small::after { content: ":"; }
}

@media (max-width: 680px) {
    .forum_post_inner { flex-direction: column; }
    .forum_post_author {
        flex-direction: row;
        align-items: center;
        gap: 0.7rem;
        min-width: 0;
        max-width: none;
        padding: 0.75rem 1rem;
        border-right: 0;
        border-bottom: 1px solid var(--border_color, rgba(255,255,255,0.08));
        text-align: left;
    }
    .forum_post_avatar { width: 44px; height: 44px; font-size: 0.9rem; }
    .forum_post_author_identity { align-items: flex-start; width: auto; }
    .forum_author_badge { margin-top: 0.3rem; }
    .forum_post_toolbar { padding-left: 0.85rem; }
    .forum_post_body { padding: 0.9rem; }
}

@media (max-width: 440px) {
    .forum_page_header { padding: 1rem !important; }
    .forum_header_meta { gap: 0.4rem 0.7rem; }
    .forum_post_toolbar { align-items: flex-start; }
}
