/* Eroids Forum Layout Styles - Matching Original Eroids.com */

/* Reset and Base Styles */
#bbpress-forums {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #333;
    background: transparent;
}

/* Main Forum Container */
.eroids-forums-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    background: #fff;
}

/* Forum List Container */
#bbpress-forums .bbp-forums-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #ddd;
    background: #fff;
}

/* Forum Category Headers */
#bbpress-forums .bbp-forum-header,
.bbp-forum-category-header {
    background: #4a90e2;
    color: #fff;
    padding: 8px 15px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #3d7bc6;
}

/* Individual Forum Items */
#bbpress-forums .bbp-forum-item {
    display: grid;
    grid-template-columns: 1fr 80px 120px 150px;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
    transition: background-color 0.2s;
}

#bbpress-forums .bbp-forum-item:hover {
    background: #f8f9fa;
}

/* Forum Title Column */
#bbpress-forums .bbp-forum-info {
    padding: 0;
    margin: 0;
}

#bbpress-forums .bbp-forum-title {
    font-size: 12px;
    font-weight: bold;
    margin: 0 0 3px 0;
}

#bbpress-forums .bbp-forum-title a {
    color: #2c5aa0;
    text-decoration: none;
}

#bbpress-forums .bbp-forum-title a:hover {
    text-decoration: underline;
}

#bbpress-forums .bbp-forum-content {
    font-size: 11px;
    color: #666;
    margin: 0;
    line-height: 1.3;
}

/* Forum Stats Column */
#bbpress-forums .bbp-forum-topic-count,
#bbpress-forums .bbp-forum-reply-count {
    text-align: center;
    font-size: 11px;
    color: #666;
    padding: 0 10px;
}

/* Forum Last Post Column */
#bbpress-forums .bbp-forum-freshness {
    font-size: 10px;
    color: #999;
    text-align: right;
    padding: 0;

    /* Critical: stack bbPress inner columns (remove floats and fixed widths) */
    #bbpress-forums li.bbp-body ul.topic > li,
    #bbpress-forums li.bbp-body ul.forum > li {
        float: none !important;
        width: 100% !important;
        display: block !important;
        clear: both !important;
    }
    #bbpress-forums .bbp-topic-title,
    #bbpress-forums .bbp-forum-info { width: 100% !important; margin: 0 0 6px !important; }
    #bbpress-forums .bbp-topic-voice-count,
    #bbpress-forums .bbp-topic-reply-count,
    #bbpress-forums .bbp-forum-topic-count,
    #bbpress-forums .bbp-forum-reply-count { width: auto !important; display: inline-block !important; margin-right: 12px !important; }
}

#bbpress-forums .bbp-forum-freshness a {
    color: #2c5aa0;
    text-decoration: none;
}

/* Topic List Styles */
#bbpress-forums .bbp-topics {
    border: 1px solid #ddd;
    margin: 20px 0;
}

#bbpress-forums .bbp-topic-title {
    font-size: 12px;
    font-weight: bold;
    margin: 0;
}

#bbpress-forums .bbp-topic-title a {
    color: #2c5aa0;
    text-decoration: none;
}

#bbpress-forums .bbp-topic-title a:hover {
    text-decoration: underline;
}

/* User Avatar Styles */
.bbp-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    margin-right: 8px;
}

/* Category Section Headers */
.bbp-forum-category {
    background: #4a90e2;
    color: #fff;
    padding: 10px 15px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 0 0;
    border: 1px solid #3d7bc6;
}

/* Forum List Layout Override */
#bbpress-forums .bbp-forums-list .bbp-header {
    display: none; /* Hide default headers */
}

#bbpress-forums .bbp-forums-list .bbp-body {
    display: block;
}

/* Custom Grid Layout for Forums */
#bbpress-forums .bbp-forums-list .bbp-list-item {
    display: grid;
    grid-template-columns: 1fr 80px 120px 150px; /* unify with single-forum topics */
    gap: 15px;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #e8e8e8;
    background: #fff;
}

#bbpress-forums .bbp-forums-list .bbp-list-item:hover {
    background: #f8f9fa;
}

/* Forum Name and Description */
.bbp-forum-info {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

/* Stats Columns */
.bbp-forum-topic-count,
.bbp-forum-reply-count {
    text-align: center;
    font-size: 11px;
    color: #666;
    font-weight: bold;
}

/* Last Post Info */
.bbp-forum-freshness {
    font-size: 10px;
    color: #999;
    text-align: right;
}

.bbp-forum-freshness a {
    color: #2c5aa0;
    text-decoration: none;
    font-weight: bold;
}

/* Pagination */
.bbp-pagination {
    text-align: center;
    margin: 20px 0;
}

.bbp-pagination a,
.bbp-pagination span {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 2px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #2c5aa0;
    font-size: 11px;
}

.bbp-pagination .current {
    background: #4a90e2;
    color: #fff;
    border-color: #3d7bc6;
}

/* Breadcrumb Styling */
.bbp-breadcrumb {
    font-size: 11px;
    margin-bottom: 15px;
    padding: 8px 0;
    color: #666;
}

.bbp-breadcrumb a {
    color: #2c5aa0;
    text-decoration: none;
}

.bbp-breadcrumb a:hover {
    text-decoration: underline;
}

/* Search Form */
.bbp-search-form {
    margin: 15px 0;
    text-align: right;
}

.bbp-search-form input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    font-size: 12px;
    width: 200px;
}

.bbp-search-form input[type="submit"] {
    padding: 6px 15px;
    background: #4a90e2;
    color: #fff;
    border: none;
    font-size: 12px;
    cursor: pointer;
    margin-left: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Turn lists into stacked cards on mobile (no table/grid) */
    #bbpress-forums li.bbp-header { display: none !important; }
    #bbpress-forums ul.bbp-forums,
    #bbpress-forums ul.bbp-topics { border: none !important; }
    #bbpress-forums li.bbp-body ul.forum,
    #bbpress-forums li.bbp-body ul.topic,
    #bbpress-forums .bbp-forums-list .bbp-list-item,
    .single-forum #bbpress-forums .bbp-topics .bbp-list-item {
        display: block !important;
        grid-template-columns: none !important;
        padding: 12px 14px !important;
        border-bottom: 1px solid #eef2f6 !important;
        background: #fff !important;
    }
    /* Title first, full width */
    #bbpress-forums .bbp-forum-title,
    #bbpress-forums .bbp-topic-title,
    #bbpress-forums .bbp-forum-info { 
        display: block !important; 
        margin: 0 0 6px !important; 
        white-space: normal !important; 
        word-break: normal !important; 
        overflow-wrap: anywhere !important; 
    }
    #bbpress-forums .bbp-forum-title a,
    #bbpress-forums .bbp-topic-title a { display: inline !important; }
    /* Counts inline under title */
    #bbpress-forums .bbp-topic-voice-count,
    #bbpress-forums .bbp-topic-reply-count,
    #bbpress-forums .bbp-forum-topic-count,
    #bbpress-forums .bbp-forum-reply-count {
        display: inline-flex !important; 
        gap: 12px !important; 
        align-items: center !important; 
        font-size: 11px !important; 
        color: #555 !important; 
        margin: 2px 0 0 !important; 
    }
    /* Hide freshness to prevent squeeze; optional to show below if needed */
    #bbpress-forums .bbp-forum-freshness,
    #bbpress-forums .bbp-topic-freshness { display: none !important; }
}

/* Fix for Topic List Inside Forums */
.single-forum #bbpress-forums .bbp-topics .bbp-header {
    display: grid;
    grid-template-columns: 1fr 80px 120px 150px; /* unified */
    gap: 15px;
    background: #f8f8f8;
    padding: 8px 15px;
    font-size: 11px;
    font-weight: bold;
    color: #666;
    border-bottom: 1px solid #ddd;
}

/* --- Custom User Profile Layout Tweaks --- */
.mg-user-profile #bbp-user-wrapper{margin-top:10px}
.mg-user-profile .mg-user-card{margin-bottom:12px}
.mg-user-profile .mg-user-nav{margin-bottom:12px}
.mg-user-profile .mg-user-body{min-height:200px}
.mg-user-profile .bbp-user-role{display:inline-block;padding:2px 6px;border-radius:12px;background:#eef2ff;color:#3730a3;font-size:11px}

.single-forum #bbpress-forums .bbp-topics .bbp-list-item {
    display: grid;
    grid-template-columns: 1fr 80px 120px 150px; /* unified */
    gap: 15px;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #e8e8e8;
}

/* Extra-small: stack for both lists */
@media (max-width: 600px) {
    #bbpress-forums .bbp-forums-list .bbp-list-item,
    .single-forum #bbpress-forums .bbp-topics .bbp-list-item { grid-template-columns: 1fr !important; }
}

/* Remove default bbPress styling that conflicts */
#bbpress-forums {
    background: none !important;
    border: none !important;
}

#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies {
    list-style: none;
    margin: 0;
    padding: 0;
}

#bbpress-forums li.bbp-body ul.forum,
#bbpress-forums li.bbp-body ul.topic {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bbp-topic-title:hover {
    color: #0073aa;
    text-decoration: underline;
}

.bbp-topic-author {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.bbp-topic-author a {
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
}

.bbp-topic-author a:hover {
    text-decoration: underline;
}

.bbp-topic-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
    margin-left: 8px;
}

.bbp-topic-status.sticky {
    background-color: #ff6b35;
}

.bbp-topic-status.closed {
    background-color: #dc3545;
}

.bbp-topic-status.super-sticky {
    background-color: #007cba;
}

.bbp-topic-meta {
    text-align: center;
    font-size: 12px;
    color: #666;
}

.bbp-topic-reply-count,
.bbp-topic-voice-count {
    font-weight: bold;
    color: #333;
    display: block;
}

.bbp-topic-freshness {
    font-size: 11px;
    color: #888;
}

.bbp-topic-freshness a {
    color: #0073aa;
    text-decoration: none;
}

/* Forum Reply Styles */
.bbp-replies-container {
    margin: 20px 0;
}

.bbp-reply-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e8e8e8;
    position: relative;
}

.bbp-reply-item:last-child {
    border-bottom: none;
}

.bbp-reply-author {
    text-align: center;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.bbp-reply-author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    margin: 0 auto 8px;
    display: block;
}

.bbp-reply-author-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.bbp-reply-author-name a {
    color: #0073aa;
    text-decoration: none;
}

.bbp-reply-author-name a:hover {
    text-decoration: underline;
}

.bbp-user-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    margin: 2px 0;
    color: white;
}

.bbp-user-role.administrator {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
}

.bbp-user-role.moderator {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.bbp-user-role.keymaster {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
}

.bbp-user-role.participant {
    background: linear-gradient(135deg, #007bff, #6610f2);
}

.bbp-user-stats {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
}

.bbp-reply-content {
    padding: 10px 0;
}

.bbp-reply-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.bbp-reply-permalink {
    font-size: 12px;
    color: #999;
    text-decoration: none;
}

.bbp-reply-permalink:hover {
    color: #0073aa;
}

.bbp-reply-content-text {
    line-height: 1.6;
    color: #333;
}

.bbp-reply-content-text p {
    margin-bottom: 12px;
}

.bbp-reply-content-text p:last-child {
    margin-bottom: 0;
}

/* Quote styling within replies */
.bbp-reply-content-text blockquote {
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    padding: 10px 15px;
    margin: 10px 0;
    font-style: italic;
    color: #555;
}

/* Code blocks within replies */
.bbp-reply-content-text code {
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.bbp-reply-content-text pre {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
}

/* Reply actions */
.bbp-reply-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.bbp-reply-actions a {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    margin-right: 15px;
}

.bbp-reply-actions a:hover {
    color: #0073aa;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bbp-topic-item {
        grid-template-columns: 40px 1fr auto;
        gap: 8px;
        padding: 10px 0;
    }
    
    .bbp-topic-author-avatar {
        width: 32px;
        height: 32px;
    }
    
    .bbp-topic-meta:nth-child(4),
    .bbp-topic-meta:nth-child(5) {
        display: none;
    }
    
    .bbp-reply-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .bbp-reply-author {
        display: grid;
        grid-template-columns: 60px 1fr;
        gap: 10px;
        align-items: center;
        text-align: left;
    }
    
    .bbp-reply-author-avatar {
        margin: 0;
    }
}

/* Forum breadcrumb styling */
.bbp-breadcrumb {
    background: #f8f8f8;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
}

.bbp-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}

.bbp-breadcrumb a:hover {
    text-decoration: underline;
}

/* Forum pagination */
.bbp-pagination {
    text-align: center;
    margin: 20px 0;
}

.bbp-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    background: #f8f8f8;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.bbp-pagination .page-numbers:hover,
.bbp-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}
