/**
 * Forum Stylesheet
 * Clean, modern design for the community forum
 */

@import 'theme.css';

/* ===== Forum Layout ===== */
.forum-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.forum-content {
    flex: 1;
}

.forum-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== Forum Header ===== */
.forum-header {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forum-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.forum-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.login-prompt {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-prompt a {
    color: var(--primary-color);
    font-weight: bold;
    text-decoration: none;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* ===== Threads List ===== */
.threads-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.thread-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.thread-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.thread-main {
    flex: 1;
}

.thread-category-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.thread-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
}

.thread-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.thread-title a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.thread-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.meta-author,
.meta-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ===== Thread Stats ===== */
.thread-stats {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex: 1;
    text-align: center;
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Empty State ===== */
.no-threads {
    background: white;
    border-radius: 8px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.no-threads p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-info {
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
}

/* ===== Sidebar Cards ===== */
.sidebar-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Categories ===== */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.category-link:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.category-link.active {
    background: #f0f4ff;
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-box {
    background: linear-gradient(135deg, #f0f4ff, #fef5ff);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

/* ===== Guidelines List ===== */
.guidelines-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guidelines-list li {
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
}

.guidelines-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary-color);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 1024px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }

    .forum-sidebar {
        flex-direction: row;
        gap: 1.5rem;
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .sidebar-card {
        flex: 0 0 300px;
    }
}

@media (max-width: 768px) {
    .forum-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .forum-sidebar {
        flex-direction: column;
    }

    .sidebar-card {
        flex: 1;
    }

    .category-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .category-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .forum-header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .forum-header-top .btn {
        width: 100%;
    }

    .forum-header h2 {
        font-size: 1.3rem;
    }

    .thread-item {
        padding: 1.2rem;
    }

    .thread-title {
        font-size: 1.1rem;
    }

    .thread-stats {
        gap: 1rem;
    }

    .stat {
        gap: 0.2rem;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .modal-close {
        align-self: flex-end;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .thread-meta {
        gap: 1rem;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .forum-header {
        padding: 1.5rem;
    }

    .thread-item {
        padding: 1rem;
    }

    .thread-title {
        font-size: 1rem;
    }

    .thread-stats {
        gap: 0.75rem;
    }

    .sidebar-card {
        padding: 1.2rem;
    }

    .card-title {
        font-size: 1rem;
    }
}