/**
 * Forum System Layout Styles
 *
 * Styles for the custom forum system, integrated with BuddyBoss theme structure.
 *  * Version: 1750551899
 */

/* Reset and integrate with BuddyBoss grid system *  * Version: 1750551899
 */
body.forum-page .bb-grid.site-content-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 30px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

/* Make the first child be our sidebar *  * Version: 1750551899
 */
body.forum-page .bb-grid.site-content-grid > div:first-child {
    flex: 0 0 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
}

/* Make the second child be our content area *  * Version: 1750551899
 */
body.forum-page .bb-grid.site-content-grid > div:last-child {
    flex: 1 !important;
    min-width: 0 !important;
    width: calc(100% - 310px) !important;
    max-width: calc(100% - 310px) !important;
}

/* Legacy forum layout (for backward compatibility) *  * Version: 1750551899
 */
.forum-layout {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 30px;
}

/* Legacy sidebar container *  * Version: 1750551899
 */
.forum-sidebar-container {
    width: 280px;
    min-width: 280px;
    flex: 0 0 280px;
    height: 100%;
    position: sticky;
    top: 20px;
}

/* Legacy content container *  * Version: 1750551899
 */
.forum-content-container {
    flex: 1;
    min-width: 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-left: 0;
}

/* Responsive Layout *  * Version: 1750551899
 */
@media (max-width: 768px) {
    body.forum-page .bb-grid.site-content-grid,
    .forum-layout {
        flex-direction: column !important;
    }
    
    body.forum-page .bb-grid.site-content-grid > div:first-child,
    body.forum-page .bb-grid.site-content-grid > div:last-child,
    .forum-sidebar-container,
    .forum-content-container {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 20px !important;
    }
    
    body.forum-page .bb-grid.site-content-grid > div:first-child,
    .forum-sidebar-container {
        position: static !important;
    }
}

/* Forum Sidebar Styles *  * Version: 1750551899
 */
.forum-sidebar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar-header {
    background: #1e293b;
    color: white;
    padding: 15px;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.sidebar-search {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-search form {
    display: flex;
    position: relative;
}

.sidebar-search input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
}

.sidebar-search button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
}

/* Sidebar Navigation *  * Version: 1750551899
 */
.sidebar-nav {
    padding: 15px 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
    padding: 0;
}

.sidebar-nav a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: background-color 0.2s;
}

.sidebar-nav a:hover {
    background-color: #f3f4f6;
}

.sidebar-nav a.active {
    background-color: #f3f4f6;
    font-weight: 600;
    border-left: 3px solid #1e293b;
    padding-left: 12px;
}

.sidebar-nav .icon {
    margin-right: 8px;
    font-size: 16px;
}

.sidebar-nav .count {
    background: #e5e7eb;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    color: #4b5563;
}

.sidebar-nav .category-header {
    padding: 15px 15px 5px;
    font-weight: 600;
    color: #4b5563;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav .create-topic-btn {
    background-color: #1e293b;
    color: white;
    margin: 10px 15px;
    border-radius: 4px;
}

.sidebar-nav .create-topic-btn:hover {
    background-color: #2c3e50;
}

/* Recent Topics Section *  * Version: 1750551899
 */
.sidebar-section {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
}

.sidebar-section h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.sidebar-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-topics li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
}

.recent-topics li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-topic-link {
    display: block;
    color: #1e293b;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
}

.recent-topic-link:hover {
    color: #4b5563;
}

.recent-topic-link .topic-title {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-topic-link .topic-meta {
    display: block;
    font-size: 12px;
    color: #6b7280;
}

/* Sidebar CTA *  * Version: 1750551899
 */
.sidebar-cta {
    padding: 20px 15px;
    background: #f3f4f6;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.sidebar-cta h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.sidebar-cta p {
    margin: 0 0 15px;
    font-size: 14px;
    color: #4b5563;
}

.sidebar-cta a {
    display: inline-block;
    background: #1e293b;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.sidebar-cta a:hover {
    background: #2c3e50;
}

/* Forum Categories *  * Version: 1750551899
 */
.category-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-title {
    margin: 0;
    font-size: 18px;
}

.topic-count {
    color: #6b7280;
    font-size: 14px;
}

.category-description {
    margin-bottom: 15px;
    color: #4b5563;
}

.recent-topics-list {
    margin: 15px 0;
    padding-left: 20px;
}

.recent-topics-list li {
    margin-bottom: 8px;
}

.recent-topics-list a {
    color: #1e293b;
    text-decoration: none;
}

.recent-topics-list a:hover {
    text-decoration: underline;
}

/* Buttons *  * Version: 1750551899
 */
.button {
    display: inline-block;
    background: #1e293b;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.button:hover {
    background: #2c3e50;
}

.button.secondary {
    background: white;
    color: #1e293b;
    border: 1px solid #1e293b;
}

.button.secondary:hover {
    background: #f8f9fa;
}

/* Topics Table *  * Version: 1750551899
 */
.topics-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.topics-table th {
    background: #f3f4f6;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
}

.topics-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
}

.topics-table tr:last-child td {
    border-bottom: none;
}

.topics-table .topic-title {
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
}

.topics-table .topic-title:hover {
    text-decoration: underline;
}

.topics-table .topic-excerpt {
    margin-top: 5px;
    color: #6b7280;
    font-size: 14px;
}

/* Topic Page *  * Version: 1750551899
 */
.topic-container {
    max-width: 800px;
    margin: 0 auto;
}

.topic-header {
    margin-bottom: 20px;
}

.topic-title {
    margin: 0 0 10px;
    font-size: 24px;
}

.topic-meta {
    display: flex;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 20px;
}

.topic-meta > div {
    margin-right: 20px;
}

.topic-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 30px;
}

/* Replies *  * Version: 1750551899
 */
.topic-replies {
    margin-top: 30px;
}

.reply {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.reply-author {
    font-weight: 500;
}

.reply-meta {
    color: #6b7280;
    font-size: 14px;
}

/* Reply Form *  * Version: 1750551899
 */
.reply-form {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
    margin-top: 30px;
}

.reply-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.reply-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 15px;
}

.reply-form button {
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.reply-form button:hover {
    background: #2c3e50;
}

/* Login Prompt *  * Version: 1750551899
 */
.login-prompt {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

/* Pinned Topics *  * Version: 1750551899
 */
.pinned-topics-section {
    margin-bottom: 30px;
}

.pinned-topics-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.pinned-topic-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 20px;
    border-left: 4px solid #f59e0b;
    display: flex;
    flex-direction: column;
}

.pinned-topic-header {
    margin-bottom: 10px;
}

.pinned-topic-title {
    font-size: 18px;
    margin: 0;
    display: flex;
    align-items: center;
}

.pinned-topic-title a {
    color: #1e293b;
    text-decoration: none;
}

.pinned-topic-title a:hover {
    text-decoration: underline;
}

.pin-icon {
    color: #f59e0b;
    margin-right: 8px;
}

.pinned-topic-meta {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.pinned-topic-excerpt {
    color: #4b5563;
    font-size: 14px;
    margin-bottom: 15px;
    flex-grow: 1;
}

.pinned-topic-footer {
    margin-top: auto;
}

.view-topic-button {
    display: inline-block;
    background: #f3f4f6;
    color: #1e293b;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.view-topic-button:hover {
    background: #e5e7eb;
}

/* Pinned Topics in Sidebar *  * Version: 1750551899
 */
.pinned-topics li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
}

.pinned-topics li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.pinned-topic-link {
    display: block;
    color: #1e293b;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    padding-left: 5px;
    border-left: 3px solid #f59e0b;
}

.pinned-topic-link:hover {
    color: #4b5563;
}

.pinned-topic-link .topic-title {
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pinned-topic-link .topic-meta {
    display: block;
    font-size: 12px;
    color: #6b7280;
}