/* Forum Layout */
:root {
    --content-max-width: 100%;
    --content-padding: 2.5rem;
    --content-gap: 2rem;
}

/* Reset any parent container constraints */
body.forum-page {
    overflow-x: hidden;
}

body.forum-page .dashboard-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    grid-template-columns: 1fr !important;
}

/* Main Forum Container */
.forum-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: white;
    border-radius: 0;
    box-shadow: none;
}

.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.forum-title {
    font-size: 1.8rem;
    color: #2d3436;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.forum-title i {
    color: #6c5ce7;
}

.create-thread-btn {
    background: #6c5ce7;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.create-thread-btn:hover {
    background: #5a4dcf;
    transform: translateY(-1px);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--content-gap);
    margin: 2.5rem 0 3.5rem;
    width: 100%;
    max-width: 100%;
}

.category-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    border: 1px solid #eee;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
    border-color: #e0e0e0;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #6c5ce7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.category-info h3 {
    margin: 0 0 0.25rem;
    color: #2d3436;
}

.category-stats {
    font-size: 0.85rem;
    color: #7f8c8d;
    display: flex;
    gap: 1rem;
}

.category-description {
    color: #636e72;
    line-height: 1.5;
    margin: 0;
}

/* Thread List */
.threads-list {
    margin-top: 2rem;
}

.threads-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.threads-title {
    font-size: 1.5rem;
    color: #2d3436;
    margin: 0;
}

.thread-filters {
    display: flex;
    gap: 0.75rem;
}

.filter-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: #6c5ce7;
    color: white;
    border-color: #6c5ce7;
}

.filter-btn:hover {
    background: #f1f2f6;
}

.thread-item {
    background: white;
    border-radius: 12px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #f0f0f0;
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

.thread-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.thread-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.thread-title {
    font-size: 1.1rem;
    color: #2d3436;
    margin: 0;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.thread-title:hover {
    color: #6c5ce7;
}

.thread-meta {
    display: flex;
    gap: 1.5rem;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.thread-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.thread-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.thread-preview {
    color: #636e72;
    margin: 0.75rem 0 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Thread View */
.thread-container {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin: 0 0 3rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.thread-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.thread-title {
    font-size: 1.8rem;
    margin: 0 0 1rem;
    color: #2d3436;
}

.thread-meta {
    display: flex;
    gap: 1.5rem;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.thread-content {
    line-height: 1.7;
    color: #2d3436;
    margin: 2rem 0;
}

/* Comments */
.comments-section {
    margin-top: 3rem;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.comments-title {
    font-size: 1.5rem;
    color: #2d3436;
    margin: 0;
}

.comment-form {
    margin: 3rem 0 4rem;
    padding: 2.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    width: 100%;
    box-sizing: border-box;
}

.comment-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.comment-submit {
    background: #6c5ce7;
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-submit:hover {
    background: #5a4dcf;
}

.comment {
    display: flex;
    gap: 1.5rem;
    padding: 2rem 0;
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #6c5ce7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: #2d3436;
}

.comment-time {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.comment-text {
    color: #2d3436;
    line-height: 1.6;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
}

.comment-action {
    color: #636e72;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s ease;
}

.comment-action:hover {
    color: #6c5ce7;
}

/* Thread List */
.threads-list {
    width: 100%;
    max-width: 100%;
}

/* Thread Items */
.thread-item {
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    transition: all 0.25s ease;
}

/* Comment Section */
.comments-section {
    width: 100%;
    max-width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d3436;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fff;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* Comment Form */
.comment-form {
    padding: 2.5rem;
    margin: 3rem 0;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
}

.comment-form .form-actions {
    border-top: none;
    padding-top: 0;
    margin-top: 1.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem 0;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    background: white;
    border-radius: 12px;
    margin: 2rem auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #2d3436;
}

.modal-body {
    padding: 2rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: #636e72;
    line-height: 1;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem 1rem;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #d63031;
}

/* Responsive Adjustments */
@media (max-width: 1600px) {
    :root {
        --content-padding: 2rem;
    }
    
    .forum-main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 1200px) {
    :root {
        --content-padding: 1.5rem;
    }
    
    .thread-container,
    .comment-form {
        padding: 2rem;
    }
}

@media (max-width: 992px) {
    :root {
        --content-max-width: 100%;
        --content-padding: 1.5rem;
    }
    
    .forum-container {
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .forum-container {
        padding: 1rem;
    }
    
    .thread-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .thread-meta {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .thread-stats {
        flex-wrap: wrap;
    }
}
