/* Comments System Styles */

.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.comments-section h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

/* Comments List */
.comments-list {
    margin-bottom: 2rem;
}

.comment {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s ease;
}

.comment:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comment.admin-reply {
    background: #e3f2fd;
    border-color: #2196f3;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: #333;
}

.comment-author strong {
    color: #2c3e50;
}

.admin-badge {
    background: #2196f3;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.comment-date {
    color: #6c757d;
    font-size: 0.875rem;
}

.comment-content {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.reply-info {
    color: #6c757d;
    font-style: italic;
    margin-top: 0.5rem;
}

.no-comments {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Comment Form */
.comment-form-container {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.comment-form-container h4 {
    margin-bottom: 1.5rem;
    color: #333;
}

.comment-form .form-group {
    margin-bottom: 1.5rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.comment-form textarea {
    resize: vertical;
    min-height: 100px;
}

.comment-form small {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Captcha Styles */
.captcha-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.captcha-question {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.captcha-numbers {
    color: #2196f3;
    font-size: 1.2rem;
}

.captcha-operator {
    color: #495057;
    font-size: 1.1rem;
}

.captcha-equals {
    color: #495057;
    font-size: 1.1rem;
}

.captcha-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

.captcha-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.captcha-help {
    color: #6c757d;
    font-size: 0.875rem;
    font-style: italic;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.form-actions .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.form-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-actions .btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1976d2;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-form-container {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .captcha-question {
        font-size: 1rem;
    }
    
    .captcha-numbers {
        font-size: 1.1rem;
    }
}

/* Reply Button Styles */
.reply-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reply-btn:hover {
    background: #218838;
}

/* Comment Count Animation */
.comments-section h3 {
    transition: color 0.3s ease;
}

.comments-section h3.updated {
    color: #28a745;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading .btn {
    position: relative;
}

.loading .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
