/* ===============================
   FORUM / BBPRESS CORE
================================ */

/* Layout reset for bbPress pages */
body.bbpress #primary,
body.bbpress .content-area,
body.bbpress .site-content {
    width: 100%;
    max-width: 100%;
}

/* Hide default page chrome on forum screens */
body.bbpress .page-title,
body.bbpress .entry-title,
body.bbpress .page-header,
body.bbpress .hero {
    display: none;
}

/* Main forum wrapper */
body.bbpress #bbpress-forums {
    max-width: 1200px;
    margin: 30px auto;
    padding: 25px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* Forum lists */
#bbpress-forums ul.bbp-forums {
    display: block !important;
}

#bbpress-forums ul.bbp-forums > li {
    display: block;
    width: 100%;
    margin-bottom: 30px;
}

/* Forum header row */
#bbpress-forums li.bbp-header {
    background: #c4161c;
    border: none;
    border-radius: 10px 10px 0 0;
}

#bbpress-forums li.bbp-header li {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

/* Search */
#bbpress-forums #bbp-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

#bbpress-forums #bbp_search {
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#bbpress-forums #bbp_search:focus {
    outline: none;
    border-color: #c4161c;
    box-shadow: 0 0 0 2px rgba(196, 22, 28, 0.15);
}

#bbpress-forums #bbp_search_submit {
    height: 38px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: #c4161c;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(196, 22, 28, 0.3);
    transition: background 0.2s ease, transform 0.2s ease;
}

#bbpress-forums #bbp_search_submit:hover {
    background: #8f1014;
}

/* Forum titles */
#bbpress-forums .bbp-forum-title {
    position: relative;
    display: inline-block;
    padding-bottom: 6px;
    color: #111 !important;
    font-size: 16px;
    font-weight: 700;
}

#bbpress-forums .bbp-forum-title:hover {
    color: #e10600 !important;
}

#bbpress-forums .bbp-forum-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: #c4161c;
    border-radius: 2px;
    transition: width 0.3s ease;
}

#bbpress-forums li.bbp-forum-info:hover .bbp-forum-title::after {
    width: 70px;
}

/* Forum row card effect */
#bbpress-forums li.bbp-body ul.forum {
    margin-bottom: 30px;
    padding: 18px;
    border-radius: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

#bbpress-forums li.bbp-body ul.forum:hover {
    background: #fff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Child forums */
.bbp-forums-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.bbp-forums-list li {
    position: relative;
    display: inline-block;
    margin-right: 12px;
    font-size: 13px;
}

.bbp-forums-list li a {
    color: #333;
    font-weight: 600;
    transition: color 0.2s ease;
}

.bbp-forums-list li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: #e10600;
    transition: width 0.25s ease;
}

.bbp-forums-list li:hover {
    background: rgba(225, 6, 0, 0.08);
    border-radius: 6px;
}

.bbp-forums-list li:hover a {
    color: #e10600;
}

.bbp-forums-list li:hover a::after {
    width: 100%;
}

/* Freshness */
.moto-freshness-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.moto-freshness-wrap img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 2px solid #e10600;
    border-radius: 6px;
}

.moto-last-topic {
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.moto-last-topic:hover {
    color: #e10600;
}

.moto-last-info {
    font-size: 12px;
    color: #888;
}

/* Safer avatar scope */
body.bbpress .avatar {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 2px solid #e10600;
    border-radius: 8px;
}

/* Breadcrumb */
body.bbpress .bbp-breadcrumb {
    background: #fff !important;
    border: none !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 8px;
}

/* Topic title/meta */
body.bbpress .bbp-topic-title a {
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

body.bbpress .bbp-topic-meta {
    margin-top: 3px;
    font-size: 11px;
    color: #888;
}

body.bbpress .bbp-topic-meta a {
    color: #666;
}

body.bbpress .bbp-topic-meta a:hover {
    color: #e10600;
}

/* Active topics section */
.moto-active-topics {
    margin-bottom: 30px;
    padding: 0;
    list-style: none;
}

.moto-active-topics ul {
    padding: 0;
    list-style: none;
}

.moto-active-topics li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.moto-active-topics li:last-child {
    border-bottom: none;
}

.moto-active-topics a {
    color: #111;
    font-weight: 600;
}

.moto-topic-meta {
    margin-left: 8px;
    font-size: 12px;
    color: #888;
}

/* Forum custom sections */
.moto-forum-section {
    margin-top: 30px;
    margin-bottom: 25px;
    padding: 22px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.moto-section-title {
    margin-bottom: 15px;
    padding-bottom: 8px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 2px solid #e10600;
}

/* Forum hero */
.moto-forum-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 35px;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #020617);
    border-radius: 14px;
}

.moto-hero-content h1 {
    margin-bottom: 10px;
    font-size: 28px;
}

.moto-hero-content p {
    max-width: 420px;
    color: #bbb;
}

.moto-hero-buttons {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

/* Forum buttons */
.moto-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}

.moto-btn-primary {
    background: #e10600;
    color: #fff;
}

.moto-btn-primary:hover {
    background: #b90500;
    color: #fff !important;
}

.moto-btn-outline {
    border: 1px solid #e10600;
    color: #e10600;
}

.moto-btn-outline:hover {
    background: #e10600;
    color: #fff;
}

/* Community stats */
.moto-community-stats {
    display: flex;
    gap: 30px;
}

.moto-stat {
    text-align: center;
}

.moto-stat strong {
    display: block;
    font-size: 22px;
}

.moto-stat span {
    font-size: 12px;
    color: #aaa;
}

/* Topic cards */
.moto-topic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.moto-topic-card {
    display: block;
    padding: 18px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.moto-topic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.moto-topic-card h3 {
    margin-bottom: 14px;
    color: #111;
    font-size: 16px;
    line-height: 1.3;
    word-break: break-word;
}

.moto-topic-preview {
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.moto-trending {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #e10600;
    color: #fff;
    font-size: 10px;
}

.moto-topic-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.moto-topic-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.moto-topic-author img {
    border-radius: 50%;
}

.moto-author-name {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.moto-topic-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #777;
}

/* Online bar */
.moto-online-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 18px;
    background: #0f172a;
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
}

.moto-online-avatars img {
    margin-left: -8px;
    border: 2px solid #0f172a;
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 768px) {
    body.bbpress #bbpress-forums {
        padding: 18px;
    }

    body.bbpress .bbp-topic-title a {
        font-size: 12px;
    }

    .moto-forum-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }

    .moto-community-stats {
        flex-wrap: wrap;
        gap: 16px;
    }

    .moto-topic-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .moto-topic-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .moto-topic-card {
        padding: 16px;
    }
}

@media (hover: none) {
    .moto-topic-card:hover {
        transform: none;
        box-shadow: none;
    }

    #bbpress-forums li.bbp-body ul.forum:hover {
        transform: none;
    }
}