/* Comments System CSS */
.comments-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.comments-header h2 {
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
    margin-bottom: 30px;
}
.category-navigation {
    margin-bottom: 40px;
}
.category-navigation h3 {
    color: #333;
    margin-bottom: 15px;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}
.category-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.category-card:hover {
    background: #e9ecef;
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 186, 0.2);
}
.category-card.active {
    background: #007cba;
    color: white;
    border-color: #005d8c;
}
.category-card.active:hover {
    background: #005d8c;
}
.category-name {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}
.category-stats {
    font-size: 0.9em;
    color: #666;
}
.category-card.active .category-stats {
    color: #cce7ff;
}
.comment-form {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
}
.comment-form h4 {
    color: #333;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s ease;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 123, 186, 0.1);
}
.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}
.latex-help {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #bbdefb;
    border-radius: 8px;
}
.latex-help summary {
    cursor: pointer;
    font-weight: 600;
    color: #1565c0;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}
.latex-help summary:hover {
    color: #0d47a1;
}
.latex-help details[open] summary {
    margin-bottom: 1rem;
}
.latex-examples {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}
.latex-examples ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}
.latex-examples li {
    margin-bottom: 0.5rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}
.latex-preview {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    border-left: 4px solid #007cba;
}
.latex-preview h5 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}
.comments-container {
    margin-top: 40px;
}
.category-header {
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}
.category-header h3 {
    color: #333;
    margin: 0;
}
.comments-list {
    min-height: 200px;
}
.comment {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}
.comment:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.reply {
    margin-left: 40px;
    background-color: #f9f9f9;
    border-left: 4px solid #007cba;
}
.comment-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.comment-author {
    color: #333;
    font-weight: 600;
}
.comment-date {
    color: #666;
    font-size: 0.9em;
}
.comment-category {
    color: #007cba;
    font-size: 0.85em;
    font-weight: bold;
    background: #e7f3ff;
    padding: 2px 8px;
    border-radius: 12px;
}
.comment-content {
    margin: 15px 0;
    line-height: 1.6;
    color: #333;
}
.comment-actions {
    margin-top: 15px;
}
.reply-btn, .btn-primary, .btn-secondary {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}
.reply-btn, .btn-primary {
    background: #007cba;
    color: white;
}
.reply-btn:hover, .btn-primary:hover {
    background: #005d8c;
}
.btn-secondary {
    background: #6c757d;
    color: white;
    margin-left: 10px;
}
.btn-secondary:hover {
    background: #545b62;
}
.reply-form {
    margin-top: 20px;
    padding: 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}
.pagination {
    margin: 30px 0;
    text-align: center;
}
.pagination-link, .pagination-current {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 2px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #007cba;
    transition: all 0.3s ease;
}
.pagination-link:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}
.pagination-current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}
.pagination-info {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}
.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #007cba;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.alert {
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 6px;
    border: 1px solid transparent;
}
.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}
.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}
.no-comments {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}
@media (max-width: 768px) {
    .comments-section {
        padding: 15px;
    }
    .category-grid {
        grid-template-columns: 1fr;
    }
    .reply {
        margin-left: 20px;
    }
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
    }
}