/* assets/css/comments-enhanced.css */
/* Facebook-Style Comment System */

/* Comments Section */
.comments-list-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.comments-list-container::-webkit-scrollbar {
    width: 8px;
}

.comments-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.comments-list-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.comments-list-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Comment Item */
.comment-item {
    animation: fadeIn 0.3s ease-in;
    transition: opacity 0.3s ease-out;
}

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

/* Comment Bubble (Facebook-style) */
.comment-bubble {
    position: relative;
    background: #F0F2F5;
    border: none;
    transition: background-color 0.2s;
}

.comment-bubble:hover {
    background: #E4E6EB;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .comment-bubble {
        background: #3A3B3C;
        color: #E4E6EB;
    }

    .comment-bubble:hover {
        background: #4E4F50;
    }

    .comment-text {
        color: #E4E6EB !important;
    }
}

/* Comment Text */
.comment-text {
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Comment Meta (Like, Delete buttons) */
.comment-meta .btn-link {
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    transition: all 0.2s;
}

.comment-meta .btn-link:hover {
    text-decoration: underline;
}

/* Comment Input */
.comment-textarea {
    border: 1px solid #CED4DA;
    border-radius: 18px;
    padding: 8px 12px;
    resize: none;
    overflow-y: hidden;
    min-height: 36px;
    max-height: 150px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-textarea:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.comment-textarea::placeholder {
    color: #6C757D;
}

/* Comment Actions */
.comment-actions {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.comment-input-wrapper:hover .comment-actions {
    opacity: 1;
}

.comment-actions .btn {
    font-size: 0.85rem;
    padding: 4px 12px;
    transition: all 0.2s;
}

.comment-actions .btn:hover {
    transform: scale(1.05);
}

/* Image Preview */
#comment-image-preview img {
    border: 2px solid #dee2e6;
}

/* Comment Images in Comments */
.comment-bubble img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.comment-bubble img:hover {
    transform: scale(1.02);
}

/* Loading Spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Empty State */
.comments-list-container .text-center {
    padding: 2rem 1rem;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
    .comment-bubble {
        font-size: 0.9rem;
    }

    .comment-meta {
        font-size: 0.75rem !important;
    }

    .comment-actions .btn {
        font-size: 0.8rem;
        padding: 3px 10px;
    }

    .comments-list-container {
        max-height: 400px;
    }
}

/* Emoji Picker Button */
.comment-actions .btn-light {
    background: #F0F2F5;
    border: none;
}

.comment-actions .btn-light:hover {
    background: #E4E6EB;
}

/* Send Button Pulse Animation */
.comment-actions .btn-primary:hover {
    animation: pulse 0.6s;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

/* Profile Picture Border */
.comment-item img.rounded-circle {
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Like Button Animation */
.comment-meta .btn-link.text-primary {
    animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Hover Effects */
.comment-item a:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* Word Filter Warning */
.word-filter-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

.word-filter-warning strong {
    color: #856404;
}

/* Smooth Transitions */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Focus Visible */
button:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Disabled State */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Comment Input Container */
.comment-input-container {
    background: #fff;
    border-top: 1px solid #dee2e6;
}

/* Gap utilities for older browsers */
.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}
