/*
 * Forum Module CSS
 * [SECURE-IMPLEMENTATION] Forum styling using consistent design patterns
 */

/* Forum Container */
.forum-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Alert Messages */
.messages-container {
    margin-bottom: 20px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.alert-close:hover {
    opacity: 1;
}

/* Common Button Styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    color: white;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #eee;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.card-body {
    padding: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

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

.form-hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .forum-container {
        padding: 15px;
    }

    .forum-header h1 {
        font-size: 1.8rem;
    }

    .forum-stats {
        gap: 20px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .category-card {
        flex-direction: column;
        text-align: center;
    }

    .category-stats {
        justify-content: center;
    }

    .topic-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .topic-stats {
        margin-top: 10px;
    }

    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .post-footer {
        flex-direction: column;
        gap: 10px;
    }
}

/* Loading States */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Markdown-like Content Styling */
.post-content {
    line-height: 1.7;
}

.post-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background: #1a1a2e;
    color: #eee;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
}

.post-content a {
    color: #667eea;
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

/* User Rank Colors */
.rank-expert {
    color: #7c3aed;
}

.rank-advanced {
    color: #2563eb;
}

.rank-member {
    color: #059669;
}

.rank-newcomer {
    color: #d97706;
}

.rank-new {
    color: #6b7280;
}
