/* Comments System Styles */
.comments-container {
    margin: 2rem 0;
}

.comment {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
}

.comment:hover {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.05);
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.comment-author {
    font-weight: 600;
    margin: 0;
    color: #344767;
    text-decoration: none;
}

.comment-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

.comment-content {
    margin: 0.75rem 0;
    line-height: 1.6;
    word-break: break-word;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-actions {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.comment-actions .btn-link {
    color: #6c757d;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.comment-actions .btn-link:hover {
    color: #5a5c69;
    text-decoration: none;
}

.comment-actions .dropdown-toggle::after {
    display: none;
}

/* Reply form */
.comment-reply-form {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #e9ecef;
}

/* Replies */
.replies-container {
    margin-top: 1rem;
    padding-left: 1.5rem;
    border-left: 2px solid #f8f9fa;
}

/* Comment status */
.comment-status-pending {
    background-color: rgba(255, 193, 7, 0.05);
    border-left: 3px solid #ffc107;
}

.comment-status-spam {
    background-color: rgba(220, 53, 69, 0.05);
    border-left: 3px solid #dc3545;
}

.comment-status-trash {
    opacity: 0.6;
    background-color: rgba(108, 117, 125, 0.05);
}

/* Highlight animation */
@keyframes highlight {
    0% { background-color: rgba(13, 110, 253, 0.1); }
    100% { background-color: transparent; }
}

.comment.highlight {
    animation: highlight 2s ease-out;
}

/* Like button */
.like-comment {
    position: relative;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.like-comment.active {
    color: #dc3545 !important;
}

.like-comment .like-count {
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

/* Edit form */
.comment-edit-form {
    margin-top: 0.5rem;
}

/* Loading state */
.comment-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Badges */
.comment-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-left: 0.5rem;
}

.badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.badge-spam {
    background-color: #f8d7da;
    color: #721c24;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .comment-avatar {
        width: 32px;
        height: 32px;
    }
    
    .comment-actions .btn-link {
        padding: 0.25rem;
    }
    
    .replies-container {
        padding-left: 1rem;
    }
}

/* Admin controls */
.comment-admin-actions {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #dee2e6;
}

.comment-admin-actions .btn-sm {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    margin-right: 0.25rem;
}

/* Nested comments */
.comment-depth-1 { margin-left: 1.5rem; }
.comment-depth-2 { margin-left: 3rem; }
.comment-depth-3 { margin-left: 4.5rem; }

/* Limit nesting depth */
.comment-depth-3 .comment-reply-form,
.comment-depth-4 .comment-reply-form {
    display: none !important;
}

/* Comment form */
.comment-form-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
}

.comment-form-container h4 {
    margin-bottom: 1rem;
    color: #344767;
}

.comment-form .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Alert messages */
.comment-alert {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
}

.comment-alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.comment-alert-error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Loading spinner */
.comment-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 0.2rem solid rgba(0, 0, 0, 0.1);
    border-left-color: #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.comments-empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.comments-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #dee2e6;
    display: block;
}

/* Pagination */
.comments-pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.comments-pagination .page-link {
    color: #5e72e4;
    border-color: #dee2e6;
}

.comments-pagination .page-item.active .page-link {
    background-color: #5e72e4;
    border-color: #5e72e4;
}

.comments-pagination .page-item.disabled .page-link {
    color: #6c757d;
}

/* Dark mode support */
[data-bs-theme="dark"] .comment {
    background-color: #2a2e35;
    border-color: #373c43;
}

[data-bs-theme="dark"] .comment-content {
    color: #e9ecef;
}

[data-bs-theme="dark"] .comment-author {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .comment-meta {
    color: #adb5bd;
}

[data-bs-theme="dark"] .comment-actions .btn-link {
    color: #adb5bd;
}

[data-bs-theme="dark"] .comment-actions .btn-link:hover {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .comment-form-container {
    background-color: #2a2e35;
    border: 1px solid #373c43;
}

[data-bs-theme="dark"] .comment-form-container h4 {
    color: #f8f9fa;
}

[data-bs-theme="dark"] .form-control {
    background-color: #2a2e35;
    border-color: #373c43;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .form-control:focus {
    background-color: #2a2e35;
    border-color: #86b7fe;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .comments-empty {
    background-color: #2a2e35;
    border: 1px solid #373c43;
    color: #adb5bd;
}

[data-bs-theme="dark"] .comments-empty i {
    color: #373c43;
}
