/* Forum Page Styles - Biostars-inspired Design */

/* Forum Container */
.forum-container {
    max-width: 1400px;
    margin: 130px auto 0;
    padding: 20px;
    min-height: calc(100vh - 200px);
}

/* Forum Header */
.forum-header {
    background: linear-gradient(135deg, #1a1f3a 0%, #2d3561 100%);
    border-radius: 12px;
    padding: 30px 40px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.forum-header-content h1 {
    color: #fff;
    font-size: 2em;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.forum-header-content h1 i {
    color: #667eea;
}

.forum-header-content p {
    color: #a0aec0;
    margin: 0;
    font-size: 1.05em;
}

.forum-header-actions {
    margin-left: auto;
    margin-right: 30px;
}

.new-post-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    color: #667eea;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.new-post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: #f0f4ff;
}

.new-post-btn i {
    font-size: 0.9em;
}

.forum-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    text-align: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.stat-number {
    display: block;
    font-size: 1.8em;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.85em;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* New Posts Alert */
.new-posts-alert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: #fff;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-posts-alert i {
    font-size: 1.2em;
}

.new-posts-alert button {
    padding: 6px 16px;
    background: #fff;
    color: #38a169;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.new-posts-alert button:hover {
    transform: scale(1.05);
}

/* New Post Highlight */
.post-item.new-post {
    background: linear-gradient(90deg, #f0fff4 0%, #fff 50%);
    border-left: 3px solid #48bb78;
}

/* Forum Main Layout */
.forum-main {
    display: flex;
    gap: 25px;
}

/* Sidebar */
.forum-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.sidebar-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.sidebar-section h3 {
    font-size: 1em;
    color: #2c3e50;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Search Box */
.search-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.search-box {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 0.95em;
    outline: none;
}

.search-box button {
    background: #667eea;
    border: none;
    padding: 12px 18px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #5a6fd6;
}

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #4a5568;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.95em;
}

.sidebar-nav a:hover {
    background: #f0f4ff;
    color: #667eea;
}

.sidebar-nav a.active {
    background: #667eea;
    color: #fff;
}

.sidebar-nav a i {
    width: 18px;
    text-align: center;
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f4ff;
    color: #667eea;
    border-radius: 15px;
    font-size: 0.85em;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.tag-item:hover {
    background: #667eea;
    color: #fff;
}

.tag-item.active {
    background: #667eea;
    color: #fff;
}

.tag-count {
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 3px;
}

.loading-tags {
    color: #a0aec0;
    font-size: 0.9em;
}

/* Back Link */
.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-size: 0.95em;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.back-link:hover {
    background: #f0f4ff;
}

/* Forum Content */
.forum-content {
    flex: 1;
    min-width: 0;
}

/* Filter Info */
.filter-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #e2e8f0;
}

#current-filter {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

#result-count {
    color: #718096;
    font-size: 0.9em;
}

/* Posts List */
.posts-list {
    background: #fff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.loading-posts {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 1.1em;
}

.loading-posts i {
    margin-right: 10px;
}

/* Post Item - Biostars Style */
.post-item {
    display: flex;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s;
}

.post-item:hover {
    background: #f8fafc;
}

.post-item:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

/* Post Stats */
.post-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    flex-shrink: 0;
    margin-right: 15px;
}

.post-stat {
    text-align: center;
    padding: 8px 5px;
    border-radius: 6px;
    margin-bottom: 5px;
    width: 100%;
}

.post-stat.votes {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
}

.post-stat.replies {
    background: #e6fffa;
    border: 1px solid #81e6d9;
}

.post-stat.views {
    background: #faf5ff;
    border: 1px solid #d6bcfa;
}

.post-stat .number {
    display: block;
    font-size: 1.1em;
    font-weight: 700;
    color: #2c3e50;
}

.post-stat .label {
    font-size: 0.7em;
    color: #718096;
    text-transform: uppercase;
}

/* Post Content */
.post-content {
    flex: 1;
    min-width: 0;
}

.post-title {
    margin: 0 0 8px 0;
    font-size: 1.15em;
    line-height: 1.4;
}

.post-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}

.post-title a:hover {
    color: #667eea;
}

.post-preview {
    color: #718096;
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    font-size: 0.85em;
    color: #718096;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-author a {
    color: #667eea;
    text-decoration: none;
}

.post-author a:hover {
    text-decoration: underline;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.post-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f4ff;
    color: #667eea;
    border-radius: 12px;
    font-size: 0.8em;
    text-decoration: none;
    transition: all 0.2s;
}

.post-tag:hover {
    background: #667eea;
    color: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 25px;
    background: #fff;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #4a5568;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pagination button.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    padding: 0 15px;
    color: #718096;
    font-size: 0.9em;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.no-results i {
    font-size: 3em;
    color: #e2e8f0;
    margin-bottom: 15px;
}

.no-results p {
    font-size: 1.1em;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .forum-main {
        flex-direction: column;
    }

    .forum-sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }

    .sidebar-section {
        flex: 1;
        min-width: 200px;
        margin-bottom: 0;
    }

    .forum-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .forum-container {
        padding: 15px;
        margin-top: 120px;
    }

    .forum-header {
        padding: 20px;
    }

    .forum-header-content h1 {
        font-size: 1.5em;
    }

    .forum-stats {
        gap: 15px;
    }

    .stat-item {
        padding: 8px 12px;
    }

    .stat-number {
        font-size: 1.4em;
    }

    .post-item {
        flex-direction: column;
    }

    .post-stats {
        flex-direction: row;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        gap: 10px;
    }

    .post-stat {
        margin-bottom: 0;
    }
}

/* Animation for loading */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-item {
    animation: fadeIn 0.3s ease-out;
}

.post-item:nth-child(1) {
    animation-delay: 0.05s;
}

.post-item:nth-child(2) {
    animation-delay: 0.1s;
}

.post-item:nth-child(3) {
    animation-delay: 0.15s;
}

.post-item:nth-child(4) {
    animation-delay: 0.2s;
}

.post-item:nth-child(5) {
    animation-delay: 0.25s;
}