/* Modern Forum Styles */
.forum-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, var(--accent-color) 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.forum-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="forum-grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="20" fill="url(%23forum-grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-stats {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

/* Search and Filter Section */
.forum-controls {
    background: var(--bg-primary);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    margin: -3rem auto 3rem;
    max-width: 800px;
    position: relative;
    z-index: 3;
    border: 1px solid var(--border-light);
}

.search-section {
    margin-bottom: 2rem;
}

.search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    font-size: var(--text-base);
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--bg-primary);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.25rem;
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-50%) translateY(-2px);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
}

.filter-tab:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.filter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Topics Grid */
.topics-container {
    margin-bottom: 3rem;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Modern Topic Card */
.topic-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
    height: fit-content;
}

.topic-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(37, 99, 235, 0.2);
}

.topic-header {
    padding: 1.5rem;
    position: relative;
}

.topic-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topic-type-review {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.topic-type-general {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.topic-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.topic-author-info h6 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-weight: 600;
}

.topic-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.topic-rating {
    display: flex;
    gap: 0.125rem;
    margin-top: 0.25rem;
}

.topic-rating i {
    font-size: 0.875rem;
}

.bi-star-fill {
    color: #fbbf24;
}

.bi-star {
    color: var(--border-medium);
}

.topic-title {
    margin: 0 0 1rem 0;
    font-size: var(--text-xl);
    font-weight: 700;
    line-height: var(--leading-tight);
}

.topic-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.topic-excerpt {
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product Info for Reviews */
.topic-product-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
}

.topic-product-image {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.topic-product-name a {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--text-sm);
}

.topic-product-name a:hover {
    color: var(--primary-color);
}

/* Topic Footer */
.topic-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-stats {
    display: flex;
    gap: 1rem;
}

.topic-stat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.topic-stat i {
    font-size: 1rem;
}

.topic-read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all var(--transition-fast);
}

.topic-read-more:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Create Post Form */
.create-post-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-top: 3rem;
}

.create-post-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem;
    text-align: center;
}

.create-post-header h3 {
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.create-post-body {
    padding: 2rem;
}

.form-floating {
    margin-bottom: 1.5rem;
}

.form-floating .form-control {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    font-size: var(--text-base);
    transition: all var(--transition-fast);
}

.form-floating .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-floating label {
    color: var(--text-muted);
    font-weight: 500;
}

.editor-container {
    margin-bottom: 1.5rem;
}

.editor-container label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: var(--text-sm);
}

.editor-container textarea {
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    transition: all var(--transition-fast);
    resize: vertical;
    min-height: 120px;
}

.editor-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.submit-button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: var(--text-base);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.submit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.submit-button:hover::before {
    left: 100%;
}

/* Pagination */
.forum-pagination {
    margin-top: 3rem;
}

.pagination {
    justify-content: center;
    gap: 0.5rem;
}

.page-item .page-link {
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
}

.page-item .page-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .forum-hero {
        padding: 2rem 0;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .forum-controls {
        margin: -2rem 1rem 2rem;
        padding: 1.5rem;
    }
    
    .topics-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .filter-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .filter-tab {
        flex-shrink: 0;
    }
    
    .topic-header {
        padding: 1rem;
    }
    
    .topic-footer {
        padding: 1rem;
    }
    
    .create-post-header,
    .create-post-body {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .forum-controls {
        margin: -1.5rem 0.5rem 1.5rem;
        padding: 1rem;
    }
    
    .search-wrapper {
        max-width: none;
    }
    
    .topic-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .topic-stats {
        gap: 0.75rem;
    }
    
    .topic-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Dark theme support */
.dark-theme .topic-card {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

.dark-theme .topic-product-info {
    background: var(--bg-tertiary);
}

.dark-theme .topic-footer {
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
}

.dark-theme .create-post-section {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

.dark-theme .forum-controls {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

/* Animation classes */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

.loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}