/* ===================================
   COMMENTS SYSTEM STYLING
   =================================== */

.comments-section {
    background: #fff;
    border-radius: 10px;
    padding: 2rem;
    margin-top: 3rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.comments-header h4 {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
}

.comments-count {
    background: #3498db;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Comment Box */
.comment-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.comment-box textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s;
}

.comment-box textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.comment-box-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.comment-box-actions .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

/* Comment Item */
.comment-item {
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s;
}

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

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

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.comment-author-info {
    display: flex;
    flex-direction: column;
}

.comment-author-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.comment-meta {
    color: #6c757d;
    font-size: 0.85rem;
}

.comment-meta i {
    margin-right: 0.25rem;
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
}

.comment-action-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.comment-action-btn:hover {
    color: #3498db;
}

.comment-action-btn.delete:hover {
    color: #e74c3c;
}

.comment-content {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.comment-footer {
    display: flex;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f3f5;
}

.comment-footer-btn {
    background: none;
    border: none;
    color: #3498db;
    font-size: 0.9rem;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.3s;
}

.comment-footer-btn:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Nested Replies */
.comment-replies {
    margin-left: 3rem;
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #e9ecef;
}

.comment-reply {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.comment-reply .comment-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}

.comment-reply .comment-author-name {
    font-size: 0.9rem;
}

.comment-reply .comment-content {
    font-size: 0.9rem;
}

/* Reply Box */
.reply-box {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    display: none;
}

.reply-box.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-box textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.reply-box-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Edit Mode */
.comment-edit-mode {
    background: #fff9e6;
    border-color: #ffc107;
}

.comment-edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid #ffc107;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

/* No Comments State */
.no-comments {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-comments i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Loading State */
.comments-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .comments-section {
        padding: 1.5rem;
    }
    
    .comment-replies {
        margin-left: 1.5rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .comment-actions {
        margin-top: 0.5rem;
    }
}

/* Status Badges */
.comment-status-pending {
    background: #ffc107;
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.comment-status-spam {
    background: #dc3545;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Sort Options */
.comments-sort {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sort-btn {
    background: none;
    border: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-btn:hover {
    background: #f8f9fa;
}

.sort-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Comment Count Badge */
.comment-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #e9ecef;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #495057;
}

.comment-count-badge i {
    color: #3498db;
}