/**
 * Forum Nuclear Fix CSS
 * 
 * Comprehensive solution to make the forum layout exactly match the Resources layout.
 * This CSS completely overrides all previous forum styling to ensure consistency.
 */

/* Reset all forum layout to match resources structure */

/* Force BuddyBoss container structure to be visible */
body.forum-page #content.site-content,
body.forum-page .container,
body.forum-page .bb-grid.site-content-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    position: relative !important;
    padding: 0 !important;
}

/* Hide the custom forum layout that's causing issues */
body.forum-page .forum-layout {
    display: none !important;
}

/* Main Layout Structure - Match Resources Exactly */
body.forum-page .resource-library-layout {
    display: flex !important;
    min-height: calc(100vh - 70px) !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Sidebar Styling - Identical to Resources */
body.forum-page .forum-sidebar {
    width: 280px !important;
    position: fixed !important;
    top: 70px !important;
    left: 0 !important;
    height: calc(100vh - 70px) !important;
    background-color: #fff !important;
    z-index: 50 !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05) !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Sidebar Header - Match Resources */
body.forum-page .forum-sidebar .sidebar-header {
    padding: 25px 20px !important;
    border-bottom: 1px solid #e5e7eb !important;
    background-color: #ffffff !important;
    color: inherit !important;
    position: relative !important;
    z-index: 15 !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 1) !important;
}

body.forum-page .forum-sidebar .sidebar-header h2 {
    margin: 0 !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.8) !important;
    position: relative !important;
    z-index: 10 !important;
    padding: 5px !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    display: inline-block !important;
    border-radius: 4px !important;
}

/* Sidebar Search - Match Resources */
body.forum-page .forum-sidebar .sidebar-search {
    padding: 15px 20px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

body.forum-page .forum-sidebar .sidebar-search form {
    position: relative !important;
}

body.forum-page .forum-sidebar .sidebar-search input[type="text"] {
    width: 100% !important;
    padding: 10px 35px 10px 15px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 4px !important;
    font-size: 0.9rem !important;
}

body.forum-page .forum-sidebar .sidebar-search button {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    color: #64748b !important;
    cursor: pointer !important;
}

/* Sidebar Navigation - Match Resources */
body.forum-page .forum-sidebar .sidebar-nav {
    flex: 1 !important;
    padding: 15px 0 !important;
    margin-bottom: 0 !important;
}

body.forum-page .forum-sidebar .sidebar-nav ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.forum-page .forum-sidebar .sidebar-nav li {
    margin-bottom: 5px !important;
}

body.forum-page .forum-sidebar .sidebar-nav a {
    display: flex !important;
    align-items: center !important;
    padding: 12px 20px !important;
    color: #1e293b !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
    justify-content: space-between !important;
    border-left: none !important;
    background-color: transparent !important;
}

body.forum-page .forum-sidebar .sidebar-nav a:hover {
    background-color: rgba(59, 130, 246, 0.05) !important;
    color: #3b82f6 !important;
}

body.forum-page .forum-sidebar .sidebar-nav a.active {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
    font-weight: 600 !important;
    border-left: none !important;
    padding-left: 20px !important;
}

body.forum-page .forum-sidebar .sidebar-nav .icon {
    margin-right: 12px !important;
    font-size: 1.1rem !important;
    color: #64748b !important;
}

body.forum-page .forum-sidebar .sidebar-nav .count {
    background-color: #f1f5f9 !important;
    padding: 2px 8px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    color: #64748b !important;
    margin-left: auto !important;
}

body.forum-page .forum-sidebar .sidebar-nav .category-header {
    padding: 10px 20px 5px !important;
    color: #64748b !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: 600 !important;
}

/* Main Content - Match Resources */
body.forum-page .main-content {
    margin-left: 280px !important;
    flex: 1 !important;
    padding: 40px !important;
    width: calc(100% - 280px) !important;
    max-width: calc(100% - 280px) !important;
    background-color: #f1f5f9 !important;
}

/* Topic Cards - Match Resource Articles */
body.forum-page .topic-card {
    background-color: #fffcf7 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 30px !important;
    margin-bottom: 30px !important;
}

body.forum-page .topic-header {
    margin-bottom: 30px !important;
    position: relative !important;
    border-bottom: none !important;
    padding: 25px 20px !important;
    text-align: center !important;
    background-color: #ffffff !important; /* Changed from dark to white to match resources */
    border-radius: 6px 6px 0 0 !important;
}

body.forum-page .topic-header .primary-category {
    display: inline-block !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #3b82f6 !important; /* Changed to blue to match resources */
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 8px !important;
    text-decoration: none !important;
}

body.forum-page .topic-header .primary-category:hover {
    color: #2563eb !important;
    text-decoration: underline !important;
}

body.forum-page .topic-header h1 {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    color: #1e293b !important; /* Changed to dark blue to match resources */
    margin: 0 auto 15px auto !important;
    line-height: 1.2 !important;
    letter-spacing: -0.5px !important;
    max-width: 800px !important;
}

body.forum-page .topic-header .meta-info {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.85rem !important;
    color: #64748b !important; /* Changed to slate color to match resources */
    margin-bottom: 0 !important;
}

body.forum-page .topic-header .meta-date {
    display: flex !important;
    align-items: center !important;
    margin-right: 20px !important;
}

body.forum-page .topic-header .meta-date svg {
    width: 14px !important;
    height: 14px !important;
    margin-right: 5px !important;
    fill: currentColor !important;
}

body.forum-page .topic-header .meta-date time {
    font-weight: 500 !important;
    color: #64748b !important; /* Changed to slate color to match resources */
}

body.forum-page .topic-header .reading-time {
    display: flex !important;
    align-items: center !important;
}

body.forum-page .topic-header .reading-time svg {
    width: 14px !important;
    height: 14px !important;
    margin-right: 5px !important;
    fill: currentColor !important;
}

/* Topic Content - Match Resource Articles */
body.forum-page .topic-content {
    font-size: 1.05rem !important;
    line-height: 1.7 !important;
    color: #1e293b !important; /* Changed to match resource content color */
    padding: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

body.forum-page .topic-content h2 {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: #1e293b !important; /* Changed to match resource heading color */
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.3rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    letter-spacing: -0.3px !important;
}

body.forum-page .topic-content h3 {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #1e293b !important; /* Changed to match resource heading color */
    margin-top: 1.75rem !important;
    margin-bottom: 0.75rem !important;
    letter-spacing: -0.2px !important;
}

body.forum-page .topic-content p {
    font-size: 1.05rem !important;
    line-height: 1.7 !important;
    margin-bottom: 1.1rem !important;
    color: #334155 !important; /* Changed to match resource paragraph color */
}

/* Topic replies - Styled like resource content */
body.forum-page .topic-replies {
    margin-top: 40px !important;
}

body.forum-page .topic-replies h2 {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.3rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.forum-page .reply {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

body.forum-page .reply-header {
    display: flex !important;
    justify-content: space-between !important;
    margin-bottom: 15px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.forum-page .reply-author {
    font-weight: 600 !important;
    color: #1e293b !important;
}

body.forum-page .reply-meta {
    color: #64748b !important;
    font-size: 0.9rem !important;
}

body.forum-page .reply-content {
    font-size: 1.05rem !important;
    line-height: 1.7 !important;
    color: #000000 !important;
}

/* Reply form - Match resource styling */
body.forum-page .reply-form {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 30px !important;
    margin-top: 30px !important;
}

body.forum-page .reply-form h3 {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
}

body.forum-page .reply-form label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
}

body.forum-page .reply-form textarea {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    resize: vertical !important;
    min-height: 150px !important;
    margin-bottom: 1rem !important;
    font-size: 1rem !important;
}

body.forum-page .reply-form button {
    background-color: #3b82f6 !important;
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    transition: background-color 0.2s !important;
}

body.forum-page .reply-form button:hover {
    background-color: #2563eb !important;
}

/* Categories List - Match resource card grid */
body.forum-page .forum-categories {
    margin-bottom: 40px !important;
}

body.forum-page .category {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 25px !important;
    margin-bottom: 20px !important;
    border: 1px solid #e5e7eb !important;
}

body.forum-page .category-header {
    margin-bottom: 15px !important;
}

body.forum-page .category-header h3 {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 0 !important;
}

body.forum-page .topic-count {
    color: #64748b !important;
    font-size: 0.9rem !important;
}

/* Recent topics grid - Match resource cards */
body.forum-page .recent-topics-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 20px !important;
    margin-top: 20px !important;
}

body.forum-page .recent-topic-card {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden !important;
    transition: transform 0.3s, box-shadow 0.3s !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

body.forum-page .recent-topic-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

body.forum-page .recent-topic-content {
    padding: 20px !important;
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

body.forum-page .recent-topic-category {
    display: inline-block !important;
    padding: 3px 10px !important;
    background-color: #f1f5f9 !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    color: #475569 !important;
    text-decoration: none !important;
    margin-bottom: 10px !important;
}

body.forum-page .recent-topic-title {
    font-size: 1.3rem !important;
    margin: 0 0 10px !important;
    line-height: 1.4 !important;
}

body.forum-page .recent-topic-title a {
    color: #1e293b !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

body.forum-page .recent-topic-title a:hover {
    color: #3b82f6 !important;
}

body.forum-page .recent-topic-excerpt {
    color: #64748b !important;
    margin-bottom: 15px !important;
    font-size: 0.95rem !important;
}

body.forum-page .recent-topic-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 0.85rem !important;
    color: #94a3b8 !important;
    margin-top: auto !important;
}

body.forum-page .recent-topic-date {
    color: #94a3b8 !important;
}

body.forum-page .recent-topic-link {
    color: #3b82f6 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

/* Login prompt - Match resource styling */
body.forum-page .login-prompt {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 30px !important;
    margin-bottom: 30px !important;
    text-align: center !important;
}

body.forum-page .login-prompt p {
    font-size: 1.1rem !important;
    color: #1e293b !important;
    margin-bottom: 20px !important;
}

body.forum-page .login-prompt a {
    display: inline-block !important;
    background-color: #3b82f6 !important;
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    border: none !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    transition: background-color 0.2s !important;
}

body.forum-page .login-prompt a:hover {
    background-color: #2563eb !important;
}

/* New topic form - Match resource styling */
body.forum-page .new-topic-form {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 30px !important;
    margin-top: 40px !important;
    margin-bottom: 40px !important;
}

body.forum-page .new-topic-form h2 {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
}

body.forum-page .form-field {
    margin-bottom: 20px !important;
}

body.forum-page .form-field label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
}

body.forum-page .form-field input[type="text"],
body.forum-page .form-field select,
body.forum-page .form-field textarea {
    width: 100% !important;
    padding: 0.75rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    font-size: 1rem !important;
}

body.forum-page .form-field textarea {
    resize: vertical !important;
    min-height: 150px !important;
}

body.forum-page .form-submit button {
    background-color: #3b82f6 !important;
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    transition: background-color 0.2s !important;
}

body.forum-page .form-submit button:hover {
    background-color: #2563eb !important;
}

/* Pinned topics section - Match resource styling */
body.forum-page .pinned-topics-section {
    margin-bottom: 40px !important;
}

body.forum-page .pinned-topics-section h2 {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    color: #000000 !important;
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
}

body.forum-page .pinned-topics-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 20px !important;
}

body.forum-page .pinned-topic-card {
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    padding: 25px !important;
    border-left: 4px solid #3b82f6 !important;
    display: flex !important;
    flex-direction: column !important;
}

body.forum-page .pinned-topic-header {
    margin-bottom: 15px !important;
}

body.forum-page .pinned-topic-title {
    font-size: 1.3rem !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

body.forum-page .pinned-topic-title a {
    color: #1e293b !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

body.forum-page .pinned-topic-title a:hover {
    color: #3b82f6 !important;
}

body.forum-page .pin-icon {
    color: #3b82f6 !important;
    margin-right: 10px !important;
}

body.forum-page .pinned-topic-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    color: #64748b !important;
    font-size: 0.9rem !important;
    margin: 10px 0 !important;
}

body.forum-page .pinned-topic-excerpt {
    color: #475569 !important;
    font-size: 0.95rem !important;
    margin-bottom: 20px !important;
    flex-grow: 1 !important;
}

body.forum-page .pinned-topic-footer {
    margin-top: auto !important;
}

body.forum-page .view-topic-button {
    display: inline-block !important;
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
}

body.forum-page .view-topic-button:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

/* Extra protection for dark background in sidebar header */
body.forum-page .forum-sidebar .sidebar-header::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: white !important;
    z-index: 1 !important;
    border-radius: 4px 4px 0 0 !important;
}

body.forum-page .forum-sidebar .sidebar-header > * {
    position: relative !important;
    z-index: 2 !important;
}

/* Additional protection for Creator Community heading specifically */
body.forum-page .forum-sidebar .sidebar-header h2:contains("Creator Community"),
body.forum-page .forum-sidebar .sidebar-header h2[innerText*="Creator Community"] {
    font-weight: 700 !important;
    color: #1e293b !important;
    background-color: white !important;
    padding: 8px 12px !important;
    display: inline-block !important;
    border-radius: 6px !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 1) !important;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.8) !important;
}

/* Responsive layout - Match resources exactly */
@media (max-width: 767px) {
    body.forum-page .forum-sidebar {
        width: 100% !important;
        position: relative !important;
        height: auto !important;
        top: 0 !important;
    }
    
    body.forum-page .resource-library-layout {
        flex-direction: column !important;
    }
    
    body.forum-page .main-content {
        margin-left: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        padding: 20px !important;
    }
    
    body.forum-page .topic-header {
        margin-bottom: 25px !important;
        padding: 20px 15px !important;
    }
    
    body.forum-page .topic-header h1 {
        font-size: 1.8rem !important;
        margin-bottom: 15px !important;
    }
    
    body.forum-page .topic-header .meta-info {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    body.forum-page .topic-header .meta-date {
        margin-bottom: 8px !important;
    }
    
    body.forum-page .pinned-topics-list,
    body.forum-page .recent-topics-grid {
        grid-template-columns: 1fr !important;
    }
}