/* Forum SEO - Custom Styles */

:root {
    --forum-primary: #2563eb;
    --forum-primary-hover: #1d4ed8;
    --forum-success: #16a34a;
    --forum-muted: #6b7280;
    --forum-border: #e5e7eb;
    --forum-bg-light: #f9fafb;
}

body {
    background-color: var(--forum-bg-light);
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Category cards */
.category-card {
    transition: box-shadow 0.2s;
    border: 1px solid var(--forum-border);
}
.category-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.category-card .stats {
    color: var(--forum-muted);
    font-size: 0.875rem;
}

/* Thread list */
.thread-row {
    border-bottom: 1px solid var(--forum-border);
    padding: 0.75rem 0;
}
.thread-row:last-child {
    border-bottom: none;
}
.thread-title {
    font-weight: 600;
    color: #111827;
    text-decoration: none;
}
.thread-title:hover {
    color: var(--forum-primary);
}
.thread-meta {
    font-size: 0.8125rem;
    color: var(--forum-muted);
}

/* Pinned thread */
.thread-pinned {
    background-color: #fffbeb;
    border-left: 3px solid #f59e0b;
    padding-left: 1rem;
}

/* Posts */
.post-card {
    border: 1px solid var(--forum-border);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    background: #fff;
}
.post-card .post-header {
    background-color: var(--forum-bg-light);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--forum-border);
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.875rem;
}
.post-card .post-body {
    padding: 1rem;
}
.post-card .post-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--forum-border);
    font-size: 0.875rem;
}

/* Answer badge */
.post-answer {
    border-left: 4px solid var(--forum-success);
}
.badge-answer {
    background-color: var(--forum-success);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Vote buttons */
.btn-vote {
    border: 1px solid var(--forum-border);
    background: #fff;
    color: var(--forum-muted);
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 0.375rem;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-vote:hover {
    border-color: var(--forum-primary);
    color: var(--forum-primary);
}
.btn-vote-helpful:hover {
    border-color: var(--forum-success);
    color: var(--forum-success);
}

/* Author profile */
.author-card {
    text-align: center;
}
.author-card .avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
}
.author-card .username {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0.75rem;
}
.author-card .bio {
    color: var(--forum-muted);
    font-size: 0.9375rem;
}

/* Pagination */
.pagination .page-link {
    color: var(--forum-primary);
}
.pagination .page-item.active .page-link {
    background-color: var(--forum-primary);
    border-color: var(--forum-primary);
}

/* Sort controls */
.sort-controls .btn {
    font-size: 0.8125rem;
}
.sort-controls .btn.active {
    background-color: var(--forum-primary);
    color: #fff;
}

/* Login page */
.login-container {
    max-width: 420px;
    margin: 3rem auto;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.875rem;
    background: transparent;
    padding: 0;
}

/* Custom breadcrumb (disable Bootstrap separator) */
.breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
    content: none;
}
.breadcrumb-custom .breadcrumb-separator {
    color: #94a3b8;
    margin: 0 0.5rem;
}
.breadcrumb-custom .breadcrumb-link {
    color: #2a5ca8;
    text-decoration: none;
    font-weight: 600;
}
.breadcrumb-custom .breadcrumb-item--active {
    color: #334155;
    font-weight: 600;
}

/* Content formatting */
.post-content p:last-child {
    margin-bottom: 0;
}
.post-content img {
    max-width: 100%;
    height: auto;
}
.post-content pre {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
}
.post-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}
.post-content pre code {
    background: transparent;
    padding: 0;
}

/* Online indicator */
.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #198754;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}
.online-avatar {
    box-shadow: 0 0 0 2px #198754;
}
.avatar-fallback {
    width: 32px;
    height: 32px;
    background: #6c757d;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Recent activity sidebar */
.activity-item {
    border-left: none;
    border-right: none;
    font-size: 0.875rem;
}
.activity-item:first-child { border-top: none; }
.activity-thread-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-meta {
    font-size: 0.72rem;
    color: var(--forum-muted);
}

/* Similar threads */
.list-group-item .text-truncate {
    min-width: 0;
}

/* Invision-like topic view */
.forum-topic-banner {
    background: #f6f7f9;
    border: 1px solid #e3e6ea;
    border-radius: 0.4rem;
    color: #5a6470;
    font-size: 0.82rem;
    padding: 0.55rem 0.75rem;
}
.forum-topic-header {
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 0.55rem;
    padding: 1rem 1.1rem;
}
.forum-topic-title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}
.forum-topic-meta {
    color: #6f7a86;
    font-size: 0.82rem;
}
.forum-topic-meta a {
    color: #2a5ca8;
    text-decoration: none;
    font-weight: 600;
}
.forum-topic-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.forum-post {
    display: flex;
    align-items: stretch;
    border: 1px solid #dfe3e8;
    border-radius: 0.55rem;
    background: #fff;
    overflow: hidden;
    margin-bottom: 1rem;
}
.forum-post-user {
    width: 170px;
    min-width: 170px;
    border-right: 1px solid #e5e9ee;
    background: #fafbfc;
    padding: 0.95rem 0.8rem;
    text-align: center;
}
.forum-post-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.forum-post-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #64748b;
    color: #fff;
    font-weight: 700;
}
.forum-post-username {
    margin-top: 0.65rem;
    display: block;
    font-weight: 700;
    color: #1f2937;
    text-decoration: none;
}
.forum-post-role {
    color: #7a8795;
    font-size: 0.77rem;
}
.forum-post-stats {
    border-top: 1px solid #e7ebf0;
    padding-top: 0.55rem;
    color: #617284;
    font-size: 0.78rem;
}
.forum-post-stats li {
    margin-bottom: 0.25rem;
}
.forum-post-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.forum-post-head {
    border-bottom: 1px solid #e6ebf1;
    color: #6d7986;
    font-size: 0.8rem;
    padding: 0.7rem 1rem;
}
.forum-post-body {
    padding: 1rem 1rem 0.95rem;
}
.forum-post-foot {
    border-top: 1px solid #e6ebf1;
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.forum-post-foot .btn-link {
    color: #4d6ea8;
}

/* Invision-like category view */
.forum-category-header {
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 0.55rem;
    padding: 1rem 1.1rem;
}
.forum-list-toolbar {
    background: #edf2f8;
    border: 1px solid #dde4ee;
    border-radius: 0.55rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.7rem;
}
.forum-pages-inline {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.forum-page-pill {
    min-width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    border: 1px solid #ccd6e3;
    background: #fff;
}
.forum-page-pill.active {
    background: #11233f;
    color: #fff;
    border-color: #11233f;
}
.forum-page-more {
    font-size: 0.68rem;
    color: #5f6f81;
    margin-left: 0.3rem;
    font-weight: 600;
}
.forum-thread-list {
    border: 1px solid #dbe2ec;
    border-radius: 0.55rem;
    background: #fff;
    overflow: hidden;
}
.forum-thread-list-head {
    background: #f4f7fb;
    border-bottom: 1px solid #e1e7ef;
    padding: 0.45rem 0.75rem;
    min-height: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.forum-thread-list-head > strong {
    min-width: 0;
    padding-right: 0.75rem;
}
.forum-thread-list-head-right {
    width: calc(330px + 0.8rem);
    flex: 0 0 calc(330px + 0.8rem);
    display: grid;
    grid-template-columns: 160px 170px;
    column-gap: 0.8rem;
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    white-space: nowrap;
}
.forum-thread-list-head-right span:first-child {
    text-align: right;
}
.forum-thread-list-head-right span:last-child {
    text-align: left;
}
.forum-thread-row {
    padding: 0.65rem 0.75rem;
    display: grid;
    grid-template-columns: 1fr 160px 170px;
    gap: 0.8rem;
    border-bottom: 1px solid #edf1f5;
    align-items: center;
}
.forum-thread-row:last-child {
    border-bottom: none;
}
.forum-thread-main {
    min-width: 0;
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.forum-thread-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #5b8dd9;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.forum-thread-content {
    min-width: 0;
}
.forum-thread-title {
    font-size: 0.95rem;
    line-height: 1.3;
}
.forum-thread-byline {
    color: #6b7887;
    font-size: 0.77rem;
}
.forum-thread-byline a,
.forum-thread-last a {
    color: #2a5ca8;
    text-decoration: none;
}
.forum-thread-stats,
.forum-thread-last {
    font-size: 0.76rem;
    color: #607284;
    line-height: 1.35;
}
.forum-thread-stats {
    white-space: nowrap;
    text-align: right;
}
.forum-thread-last {
    text-align: left;
    min-width: 0;
}
.forum-thread-last a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.forum-thread-last div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item {
    overflow: hidden;
}
.search-result-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 0.8rem;
    align-items: start;
}
.search-result-main {
    min-width: 0;
}
.search-result-title {
    line-height: 1.35;
}
.search-result-meta,
.search-result-excerpt {
    white-space: normal;
    word-break: break-word;
}
.search-result-side {
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .thread-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    .post-card .post-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    .forum-topic-title {
        font-size: 1.4rem;
    }
    .forum-topic-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .forum-post {
        display: block;
    }
    .forum-post-user {
        width: auto;
        min-width: 0;
        border-right: 0;
        border-bottom: 1px solid #e5e9ee;
        text-align: left;
    }
    .forum-post-avatar {
        width: 54px;
        height: 54px;
        margin-right: 0.55rem;
    }
    .forum-list-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .forum-thread-row {
        grid-template-columns: 1fr;
    }
    .forum-thread-stats,
    .forum-thread-last {
        text-align: left;
        white-space: normal;
    }
    .search-result-wrap {
        grid-template-columns: 1fr;
    }
    .search-result-side {
        white-space: normal;
        text-align: left !important;
    }
}
