/* ===========================
   Forum Styles
   =========================== */

.forum-section {
    padding: 4rem 0;
    background: #f5f7fa;
}

.forum-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Sidebar */
.forum-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.sidebar-card h3 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

.category-item:hover {
    background: #f8f9fa;
}

.category-item.active {
    background: #e8f4f8;
    color: var(--primary-color);
}

.category-item i {
    font-size: 1.1rem;
}

.category-item span:nth-child(2) {
    flex: 1;
}

.category-item .count {
    background: #e1e8ed;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.category-item.active .count {
    background: var(--primary-color);
    color: #fff;
}

.forum-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

.forum-stats .stat-item strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.forum-stats .stat-item span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Main Content */
.forum-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.forum-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.forum-controls .search-box {
    flex: 1;
    position: relative;
}

.forum-controls .search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.forum-controls .search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
}

.forum-controls select {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

/* Topics List */
.topics-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 1.5rem;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.topic-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--primary-color);
}

.topic-item.solved {
    border-left-color: #27ae60;
}

.topic-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.topic-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.topic-content h3 a {
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.topic-content h3 a:hover {
    color: var(--primary-color);
}

.topic-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.topic-meta .author strong {
    color: var(--text-color);
}

.topic-meta .category {
    color: var(--primary-color);
}

.solved-badge {
    color: #27ae60;
    font-weight: 600;
}

.topic-excerpt {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.topic-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.topic-tags .tag {
    padding: 0.4rem 0.8rem;
    background: #f8f9fa;
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.85rem;
}

.topic-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.topic-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.topic-stats .stat i {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }

    .forum-sidebar {
        order: 2;
    }

    .forum-main {
        order: 1;
    }
}

@media (max-width: 768px) {
    .topic-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .topic-avatar {
        display: none;
    }

    .topic-stats {
        flex-direction: row;
        justify-content: flex-start;
    }

    .forum-controls {
        flex-direction: column;
    }

    .forum-stats {
        grid-template-columns: 1fr;
    }
}
