/**
 * Forum Three-Column Layout
 * 
 * A three-column layout for the community forum that displays:
 * 1. Left sidebar with navigation and filters
 * 2. Middle column with topic list
 * 3. Right column with topic details
 *  * Version: 1750551899
 */

/* Main Container *  * Version: 1750551899
 */
.forum-three-column-container {
    display: flex;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    gap: 20px;
    background-color: transparent;
}

/* Force container to take full width within page *  * Version: 1750551899
 */
.site-content .forum-three-column-container,
.content-area .forum-three-column-container,
#content .forum-three-column-container,
body.forum-page .forum-three-column-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Left Sidebar *  * Version: 1750551899
 */
.forum-sidebar.left-sidebar {
    width: 280px;
    min-width: 280px;
    flex: 0 0 280px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
    margin: 0;
    box-sizing: border-box;
}

/* Middle Column *  * Version: 1750551899
 */
.forum-middle-column {
    flex: 1;
    min-width: 0; /* Important for flex child to shrink properly *  * Version: 1750551899
 */
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 20px;
    height: fit-content;
    box-sizing: border-box;
}

/* Right Column *  * Version: 1750551899
 */
.forum-right-column {
    width: 280px;
    min-width: 280px;
    flex: 0 0 280px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Topic Detail Container *  * Version: 1750551899
 */
.topic-detail-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.topic-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f8fafc;
}

.topic-detail-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

.close-detail-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    display: none; /* Hidden on desktop, visible on mobile *  * Version: 1750551899
 */
}

.topic-detail-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Topic Detail Placeholder *  * Version: 1750551899
 */
.topic-detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 300px;
    color: #94a3b8;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.topic-detail-placeholder h3 {
    margin: 0 0 10px;
    color: #64748b;
}

.topic-detail-placeholder p {
    margin: 0;
    max-width: 240px;
}

/* Topic Detail Content *  * Version: 1750551899
 */
.detail-title {
    font-size: 20px;
    margin: 0 0 15px;
    color: #1e293b;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #64748b;
}

.detail-meta span {
    display: inline-flex;
    align-items: center;
}

.detail-content {
    line-height: 1.6;
    color: #334155;
    margin-bottom: 20px;
    word-break: break-word;
}

.detail-comments h3 {
    font-size: 16px;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    color: #1e293b;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.view-full-button {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.view-full-button:hover {
    background-color: #2563eb;
    text-decoration: none;
    color: white;
}

/* Forum Guidelines *  * Version: 1750551899
 */
.forum-guidelines {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 20px;
}

.forum-guidelines h3 {
    margin: 0 0 15px;
    color: #1e293b;
    font-size: 16px;
}

.forum-guidelines ul {
    margin: 0;
    padding: 0 0 0 20px;
    color: #334155;
    line-height: 1.6;
}

.forum-guidelines li {
    margin-bottom: 8px;
}

.forum-guidelines li:last-child {
    margin-bottom: 0;
}

/* Topic List Styling *  * Version: 1750551899
 */
.topic-section {
    margin-bottom: 30px;
}

.topic-section-title {
    font-size: 18px;
    margin: 0 0 15px;
    color: #1e293b;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.topic-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topic-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
}

.topic-item:hover {
    background-color: #f1f5f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.topic-item.active {
    background-color: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.topic-indicator {
    font-size: 18px;
    margin-right: 15px;
    min-width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-info {
    flex: 1;
    min-width: 0; /* Needed for text-overflow to work *  * Version: 1750551899
 */
}

.topic-title {
    font-size: 16px;
    margin: 0 0 5px;
    color: #1e293b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #64748b;
}

.topic-category {
    background-color: #e5e7eb;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    color: #334155;
}

/* Pinned Topic Styling *  * Version: 1750551899
 */
.topic-item.pinned {
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.topic-item.pinned:hover {
    background-color: #dbeafe;
}

/* New Topic Modal *  * Version: 1750551899
 */
.new-topic-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
}

.new-topic-modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    margin: 50px auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
}

.new-topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f8fafc;
}

.new-topic-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

.close-modal-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
}

.forum-form {
    padding: 20px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #1e293b;
}

.form-field input[type="text"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    color: #1e293b;
    background-color: white;
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.form-submit {
    text-align: right;
}

.forum-submit-button {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.forum-submit-button:hover {
    background-color: #2563eb;
}

/* Forum Action Buttons *  * Version: 1750551899
 */
.forum-content-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    align-items: center;
}

.forum-new-topic-button {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.forum-new-topic-button:hover {
    background-color: #2563eb;
    text-decoration: none;
    color: white;
}

.forum-filter-controls {
    display: flex;
    gap: 10px;
}

.forum-filter-button {
    background-color: #f1f5f9;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.forum-filter-button:hover {
    background-color: #e5e7eb;
}

.forum-filter-button.active {
    background-color: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

/* Header Section *  * Version: 1750551899
 */
.forum-content-header {
    margin-bottom: 20px;
}

.forum-page-title {
    font-size: 24px;
    margin: 0 0 10px;
    color: #1e293b;
}

.forum-page-description {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

/* No Topics Message *  * Version: 1750551899
 */
.no-topics-message {
    padding: 30px;
    text-align: center;
    color: #64748b;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #e5e7eb;
}

/* Responsive Adjustments *  * Version: 1750551899
 */
@media (max-width: 1200px) {
    .forum-three-column-container {
        padding: 15px;
    }
    
    .forum-sidebar.left-sidebar {
        width: 250px;
        min-width: 250px;
        flex: 0 0 250px;
    }
    
    .forum-right-column {
        width: 280px;
        min-width: 280px;
        flex: 0 0 280px;
    }
}

@media (max-width: 992px) {
    .forum-three-column-container {
        flex-wrap: wrap;
    }
    
    .forum-sidebar.left-sidebar {
        width: 250px;
        min-width: 250px;
        flex: 0 0 250px;
    }
    
    .forum-middle-column {
        flex: 1;
        min-width: calc(100% - 270px); /* Sidebar width + gap *  * Version: 1750551899
 */
    }
    
    .forum-right-column {
        width: 100%;
        min-width: 100%;
        flex: 0 0 100%;
        margin-top: 20px;
        display: none; /* Hide by default on tablet *  * Version: 1750551899
 */
    }
    
    .forum-right-column.mobile-visible {
        display: block; /* Show when a topic is selected *  * Version: 1750551899
 */
    }
    
    .close-detail-button {
        display: block; /* Show close button on mobile *  * Version: 1750551899
 */
    }
}

@media (max-width: 768px) {
    .forum-three-column-container {
        flex-direction: column;
        padding: 10px;
    }
    
    .forum-sidebar.left-sidebar {
        width: 100%;
        min-width: 100%;
        flex: 0 0 100%;
        position: static;
        margin-bottom: 15px;
    }
    
    .forum-middle-column {
        width: 100%;
        min-width: 100%;
    }
    
    .forum-content-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .topic-meta {
        display: none; /* Hide meta info on mobile to save space *  * Version: 1750551899
 */
    }
    
    .topic-item {
        padding: 10px;
    }
    
    .new-topic-modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* Dark mode support *  * Version: 1750551899
 */
@media (prefers-color-scheme: dark) {
    .forum-three-column-container {
        background-color: #1a1a1a;
    }
    
    .forum-sidebar.left-sidebar,
    .forum-middle-column,
    .forum-right-column,
    .topic-detail-container,
    .forum-guidelines,
    .new-topic-modal-content {
        background-color: #262626;
        border-color: #404040;
    }
    
    .topic-detail-header,
    .topic-item,
    .forum-filter-button {
        background-color: #333333;
        border-color: #404040;
    }
    
    .topic-title,
    .detail-title,
    .forum-page-title,
    .topic-section-title,
    .detail-comments h3,
    .forum-guidelines h3 {
        color: #e5e5e5;
    }
    
    .topic-meta,
    .detail-meta,
    .forum-page-description,
    .detail-content,
    .forum-guidelines li {
        color: #b3b3b3;
    }
    
    .topic-item:hover {
        background-color: #383838;
    }
    
    .topic-item.active {
        background-color: #333955;
        border-color: #3b82f6;
    }
    
    .topic-item.pinned {
        background-color: #333955;
    }
    
    .form-field input[type="text"],
    .form-field textarea,
    .form-field select {
        background-color: #333333;
        border-color: #404040;
        color: #e5e5e5;
    }
}

/* Ensure layout even without proper functions *  * Version: 1750551899
 */
.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    margin-bottom: 10px;
}

.sidebar-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1e293b;
    text-decoration: none;
    padding: 5px 0;
}

.sidebar-list li a:hover {
    color: #3b82f6;
}

.sidebar-list li a .count {
    background-color: #f1f5f9;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    color: #475569;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section h3 {
    font-size: 16px;
    margin: 0 0 15px;
    color: #1e293b;
}

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

.sidebar-header h2 {
    font-size: 18px;
    margin: 0;
    color: #1e293b;
}

/* Force 3-column layout for creator-community page *  * Version: 1750551899
 */
body.page-creator-community .forum-container {
    display: flex !important;
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    gap: 20px !important;
    background-color: transparent !important;
    flex-wrap: wrap !important;
}

body.page-creator-community .forum-sidebar {
    width: 280px !important;
    min-width: 280px !important;
    flex: 0 0 280px !important;
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    padding: 20px !important;
    height: fit-content !important;
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
    position: sticky !important;
    top: 20px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    order: 1 !important;
}

body.page-creator-community .forum-content {
    flex: 1 !important;
    min-width: 0 !important;
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    padding: 20px !important;
    height: fit-content !important;
    box-sizing: border-box !important;
    order: 2 !important;
}

/* Create third column for any existing page *  * Version: 1750551899
 */
body.page-creator-community .forum-content::after {
    content: "";
    width: 280px !important;
    min-width: 280px !important;
    flex: 0 0 280px !important;
    background-color: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
    padding: 20px !important;
    height: fit-content !important;
    box-sizing: border-box !important;
    order: 3 !important;
    display: block !important;
    margin-left: 20px !important;
    position: sticky !important;
    top: 20px !important;
}

@media (max-width: 992px) {
    body.page-creator-community .forum-container {
        flex-direction: column !important;
    }
    
    body.page-creator-community .forum-sidebar,
    body.page-creator-community .forum-content {
        width: 100% !important;
        min-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 0 20px 0 !important;
    }
    
    body.page-creator-community .forum-content::after {
        display: none !important;
    }
}