/**
 * Comment System Styles
 * Version: 1.0.0
 */

/* Comment Container */
#comment-system-container {
    margin: 40px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Comment Header */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}


.comment-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.6em;
    color: #2c3e50;
    line-height: 1.4;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.comment-header .refresh-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    padding: 10px 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.comment-header .refresh-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.comment-header .refresh-btn:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-header .refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Dark theme header */
.comment-header.dark {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.comment-header.dark:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.comment-header.dark h3 {
    color: #ffc107;
    text-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.comment-header.dark .refresh-btn {
    background: linear-gradient(135deg, #343a40 0%, #2d2d2d 100%);
    border-color: #495057;
    color: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.comment-header.dark .refresh-btn:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    border-color: #6c757d;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Comment User Info */
.comment-user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-user-info:hover {
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.user-info-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-user-info:hover .user-avatar {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    border-color: #ff9800;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
}

.user-email {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.user-info-right {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 2px solid;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-edit-name {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #495057;
    border-color: #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-edit-name:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-logout {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border-color: #ff9800;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.btn-logout:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    border-color: #f57c00;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

/* Comment Form */
.comment-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 40px;
    border: 2px solid #e9ecef;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.comment-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff9800, #ffc107, #4caf50, #2196f3);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.comment-form:hover::before {
    opacity: 1;
}

.comment-form:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 6px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.comment-form.dark {
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    border-color: #495057;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.comment-form.dark:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.comment-form textarea {
    width: 100%;
    min-height: 140px;
    padding: 20px 24px;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    resize: vertical;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.7;
    font-weight: 400;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.06);
}

.comment-form textarea:hover {
    border-color: #ced4da;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.08);
}

.comment-form textarea::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.comment-form.dark textarea {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-color: #495057;
    color: #f8f9fa;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3);
}

.comment-form.dark textarea:hover {
    border-color: #6c757d;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
}

.comment-form.dark textarea::placeholder {
    color: #6c757d;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 5px rgba(255, 152, 0, 0.15), inset 0 3px 6px rgba(0, 0, 0, 0.06);
    transform: translateY(-3px);
    background: #ffffff;
}

.comment-form.dark textarea:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 5px rgba(255, 193, 7, 0.2), inset 0 3px 6px rgba(0, 0, 0, 0.3);
    background: #2d2d2d;
}

.comment-form .form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.comment-form.dark .form-footer {
    border-top-color: #495057;
}

.comment-form .char-count {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.comment-form.dark .char-count {
    color: #adb5bd;
}

.comment-form button[type="submit"] {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
}

.comment-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.comment-form button[type="submit"]:hover::before {
    left: 100%;
}

.comment-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 32px rgba(255, 152, 0, 0.45);
}

.comment-form button[type="submit"]:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

.comment-form button[type="submit"]:disabled {
    background: linear-gradient(135deg, #dee2e6 0%, #adb5bd 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0.6;
}

.comment-form.dark button[type="submit"]:disabled {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
}

/* ===== COMMENTS LIST ===== */
#comments-list {
    margin: 40px 0;
}

/* ===== COMMENT ITEMS - Facebook Style ===== */
.comment-item {
    display: flex;
    padding: 8px 0;
    margin-bottom: 4px;
}

.comment-item.dark {
    background: transparent;
}

/* Avatar */
.comment-avatar {
    margin-right: 12px;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* No Comments */
.no-comments {
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 24px;
    margin: 30px 0;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

/* Load More Trigger */
#load-more-trigger {
    text-align: center;
    padding: 10px;
}

/* Skeleton Loading */
.comment-skeleton {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton-line {
    border-radius: 4px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease-out;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.toast-success {
    border-left: 4px solid #4CAF50;
}

.toast-notification.toast-success i {
    color: #4CAF50;
}

.toast-notification.toast-error {
    border-left: 4px solid #f44336;
}

.toast-notification.toast-error i {
    color: #f44336;
}

/* Slide In Animation */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Required */
.login-required {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

.login-required.dark {
    background: #3a3a2a;
    border-color: #ffc107;
}

.login-required .google-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: white;
    color: #444;
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    margin-top: 10px;
}

.login-required .google-login-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-required .google-login-btn img {
    width: 20px;
    height: 20px;
}

/* Disabled Comments */
.comments-disabled {
    background: #f8d7da;
    border: 1px solid #f44336;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: #721c24;
}

.comments-disabled.dark {
    background: #3a2a2a;
    color: #f8d7da;
}

/* IP Banned */
.ip-banned {
    background: #f8d7da;
    border: 1px solid #f44336;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: #721c24;
}

.ip-banned.dark {
    background: #3a2a2a;
    color: #f8d7da;
}

/* ===== RESPONSIVE - Copy từ rating-system.css (dòng 1163-1307) ===== */
@media (max-width: 768px) {
    #comment-system-container {
        margin: 15px 0;
    }

    .comment-form {
        padding: 15px;
    }

    .comment-header h3 {
        font-size: 1.25rem;
    }

    /* Comment Header Responsive - Copy từ rating-system.css (dòng 1241-1264) */
    .comment-header {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: left;
    }

    .comment-header-right {
        align-items: flex-start;
    }

    .comment-avatar img {
        width: 36px;
        height: 36px;
    }

    .toast-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

/* Utility Classes */
.d-flex {
    display: flex;
}

.flex-grow-1 {
    flex-grow: 1;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mr-3 {
    margin-right: 1rem;
}

.p-3 {
    padding: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-circle {
    border-radius: 50%;
}

.bg-light {
    background-color: #f8f9fa;
}

.bg-dark {
    background-color: #343a40;
}

.text-white {
    color: #fff;
}

.text-dark {
    color: #212529;
}

/* WebView Warning Styles */
.webview-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: center;
}

.webview-warning.dark {
    background: #2d2d2d;
    border-color: #555;
    color: #ffc107;
}

.webview-warning h4 {
    margin: 0 0 10px 0;
    color: #856404;
}

.webview-warning.dark h4 {
    color: #ffc107;
}

.webview-warning .btn {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    margin: 5px;
    display: inline-block;
}

.webview-warning .btn:hover {
    background: #0056b3;
}

/* Mobile responsive cho WebView warning */
@media (max-width: 768px) {
    .webview-warning {
        padding: 12px;
        font-size: 14px;
    }

    .webview-warning .btn {
        display: block;
        width: 100%;
        margin: 8px 0;
        padding: 12px;
    }
}

/* ===== FACEBOOK-STYLE COMMENT UI ===== */

/* Comment Body - wrapper for bubble and meta */
.comment-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Comment Bubble - Facebook style */
.comment-bubble {
    background: #f0f2f5;
    border-radius: 18px;
    padding: 12px 16px;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
}

.comment-item.dark .comment-bubble {
    background: #3a3b3c;
}

.comment-bubble-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.comment-bubble .comment-text {
    margin-top: 4px;
    color: #050505;
    font-size: 15px;
    line-height: 1.4;
}

.comment-item.dark .comment-bubble .comment-text {
    color: #e4e6eb;
}

/* Comment Meta - actions, time, reactions */
.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    font-size: 12px;
}

/* Inline Actions - Like, Reply buttons */
.comment-inline-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    color: #65676b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn:hover {
    color: #050505;
}

.action-btn.action-like {
    display: inline-flex;
    align-items: center;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.15s ease;
}

.action-btn.action-like:hover {
    transform: scale(1.15);
}

.action-btn.action-like:active {
    transform: scale(0.95);
}

.comment-item.dark .action-btn {
    color: #b0b3b8;
}

.comment-item.dark .action-btn:hover {
    color: #e4e6eb;
}

.action-btn.action-liked {
    color: #1877f2;
}

.action-btn.action-liked.reaction-heart {
    color: #f33e58;
}

.action-btn.action-liked.reaction-haha,
.action-btn.action-liked.reaction-wow,
.action-btn.action-liked.reaction-sad {
    color: #f7b125;
}

.action-btn.action-liked.reaction-angry {
    color: #e9710f;
}

.action-separator {
    color: #65676b;
    font-weight: bold;
}

.comment-item.dark .action-separator {
    color: #b0b3b8;
}

/* Reaction Picker Popup - Facebook Style */
.action-like-wrapper {
    position: relative;
}

.reaction-picker-popup {
    position: absolute;
    bottom: 100%;
    left: -8px;
    background: #fff;
    border: none;
    border-radius: 28px;
    padding: 6px 10px;
    margin-bottom: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    display: flex;
    gap: 2px;
    z-index: 100;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(10px);
    transform-origin: bottom left;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.2s;
    pointer-events: none;
}

/* Bridge area to prevent hover gap */
.reaction-picker-popup::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 16px;
    background: transparent;
}

.comment-item.dark .reaction-picker-popup {
    background: #3a3b3c;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* Hover delay 300ms before showing - Facebook style */
.action-like-wrapper:hover .reaction-picker-popup {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    transition-delay: 0.3s;
}

.action-like-wrapper .reaction-picker-popup:hover {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}

/* Arrow pointer - hidden for cleaner look */
.reaction-picker-popup::after {
    display: none;
}

.reaction-picker-btn {
    background: none;
    border: none;
    font-size: 28px;
    padding: 6px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s ease;
    border-radius: 50%;
    opacity: 0;
    animation: reactionBounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    position: relative;
}

/* Staggered animation - Facebook style */
.reaction-picker-btn:nth-child(1) { animation-delay: 0.05s; }
.reaction-picker-btn:nth-child(2) { animation-delay: 0.1s; }
.reaction-picker-btn:nth-child(3) { animation-delay: 0.15s; }
.reaction-picker-btn:nth-child(4) { animation-delay: 0.2s; }
.reaction-picker-btn:nth-child(5) { animation-delay: 0.25s; }
.reaction-picker-btn:nth-child(6) { animation-delay: 0.3s; }

@keyframes reactionBounceIn {
    0% {
        opacity: 0;
        transform: scale(0) translateY(20px);
    }
    60% {
        opacity: 1;
        transform: scale(1.15) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.reaction-picker-btn:hover {
    transform: scale(1.5) translateY(-10px);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.reaction-picker-btn:active {
    transform: scale(1.3) translateY(-6px);
}

.comment-item.dark .reaction-picker-btn:hover {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.reaction-picker-btn.active {
    transform: scale(1.2);
}

/* Emoji label tooltip on hover */
.reaction-picker-btn::before {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.15s ease;
    pointer-events: none;
}

.reaction-picker-btn:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Comment Time in meta */
.comment-meta .comment-time {
    color: #65676b;
    font-size: 12px;
    font-weight: 400;
}

.comment-item.dark .comment-meta .comment-time {
    color: #b0b3b8;
}

/* Reactions inline display */
.comment-reactions-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.comment-reactions-inline .reaction-badge {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.comment-item.dark .comment-reactions-inline .reaction-badge {
    background: #3a3b3c;
    border-color: #4e4f50;
}

/* Highlight animation for scrolled-to comment */
.comment-item.highlight {
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(24, 119, 242, 0.1); }
}

.comment-item.dark.highlight {
    animation: highlightPulseDark 2s ease-out;
}

@keyframes highlightPulseDark {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(24, 119, 242, 0.2); }
}

/* ===== REACTIONS ROW - Separate line ===== */
.comment-reactions-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 12px;
    flex-wrap: wrap;
    min-height: 0;
}

.comment-reactions-row:empty {
    display: none;
}

.comment-reactions-row .reaction-badge {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: default;
}

.comment-item.dark .comment-reactions-row .reaction-badge {
    background: #3a3b3c;
    border-color: #4e4f50;
    color: #e4e6eb;
}

/* Mobile responsive for Facebook-style */
@media (max-width: 768px) {
    .comment-bubble {
        padding: 10px 14px;
    }

    .comment-meta {
        padding: 4px 8px;
        flex-wrap: wrap;
    }

    .reaction-picker-popup {
        left: -12px;
        padding: 4px 6px;
        border-radius: 24px;
    }

    .reaction-picker-btn {
        font-size: 24px;
        padding: 3px;
    }
}

/* Touch device support - long press for reaction picker */
@media (hover: none) and (pointer: coarse) {
    .action-like-wrapper:hover .reaction-picker-popup {
        opacity: 0;
        visibility: hidden;
        transition-delay: 0s;
    }

    /* Visual feedback when holding */
    .action-like.touch-holding {
        transform: scale(0.95);
        opacity: 0.7;
    }

    .action-like-wrapper.touch-active .reaction-picker-popup {
        opacity: 1;
        visibility: visible;
        transform: scale(1) translateY(0);
        pointer-events: auto;
        animation: popupSlideIn 0.2s ease-out;
    }

    @keyframes popupSlideIn {
        from {
            opacity: 0;
            transform: scale(0.8) translateY(10px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }

    /* Touch hover effect on reaction buttons */
    .reaction-picker-btn.touch-hover {
        transform: scale(1.4) translateY(-8px);
        background: rgba(0,0,0,0.05);
    }

    .comment-item.dark .reaction-picker-btn.touch-hover {
        background: rgba(255,255,255,0.1);
    }

    /* Disable animation delay on touch */
    .action-like-wrapper.touch-active .reaction-picker-btn {
        animation-delay: 0s !important;
        opacity: 1;
    }
}

/* ===== FACEBOOK-STYLE NESTED REPLIES ===== */

/* Replies Container */
.replies-container {
    margin-top: 8px;
    padding-left: 0;
    border-left: 2px solid transparent;
}

/* View Replies Button */
.view-replies-section {
    padding: 4px 12px;
    margin-top: 4px;
}

.view-replies-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #65676b;
    cursor: pointer;
    transition: color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.view-replies-btn:hover {
    color: #050505;
    text-decoration: underline;
}

.comment-item.dark .view-replies-btn {
    color: #b0b3b8;
}

.comment-item.dark .view-replies-btn:hover {
    color: #e4e6eb;
}

/* Reply Item - Nested under parent comment */
.reply-item {
    display: flex;
    padding: 6px 0;
    margin-top: 4px;
    position: relative;
}

/* Indentation for replies - Facebook style */
.comment-body > .reply-item {
    margin-left: 0;
}

/* Reply Avatar - Smaller than main comment */
.reply-avatar {
    margin-right: 8px;
    flex-shrink: 0;
}

.reply-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Reply Body */
.reply-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Reply Bubble - Slightly smaller than main comment */
.reply-bubble {
    background: #f0f2f5;
    border-radius: 16px;
    padding: 10px 12px;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
}

.reply-item.dark .reply-bubble {
    background: #3a3b3c;
}

.reply-bubble-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 3px;
}

.reply-bubble .reply-text {
    margin-top: 3px;
    color: #050505;
    font-size: 14px;
    line-height: 1.4;
}

.reply-item.dark .reply-bubble .reply-text {
    color: #e4e6eb;
}

/* Reply Meta - Actions and time */
.reply-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    font-size: 11px;
}

.reply-meta .action-btn {
    font-size: 11px;
}

.reply-meta .reply-time {
    color: #65676b;
    font-size: 11px;
    font-weight: 400;
}

.reply-item.dark .reply-meta .reply-time {
    color: #b0b3b8;
}

/* Reply Reactions Row */
.reply-reactions-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    flex-wrap: wrap;
    min-height: 0;
}

.reply-reactions-row:empty {
    display: none;
}

.reply-reactions-row .reaction-badge {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: default;
}

.reply-item.dark .reply-reactions-row .reaction-badge {
    background: #3a3b3c;
    border-color: #4e4f50;
    color: #e4e6eb;
}

/* ===== REPLY FORM ===== */

.reply-form-container {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f7f8fa;
    border-radius: 12px;
    animation: slideInDown 0.2s ease-out;
}

.comment-item.dark .reply-form-container {
    background: #2d2d2d;
}

.reply-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reply-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid #e4e6eb;
}

.comment-item.dark .reply-form-header {
    border-bottom-color: #4e4f50;
}

.replying-to {
    font-size: 13px;
    color: #65676b;
    font-weight: 500;
}

.comment-item.dark .replying-to {
    color: #b0b3b8;
}

.replying-to strong {
    color: #050505;
}

.comment-item.dark .replying-to strong {
    color: #e4e6eb;
}

.reply-cancel-btn {
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reply-cancel-btn:hover {
    background: #e4e6eb;
    color: #050505;
}

.comment-item.dark .reply-cancel-btn {
    color: #b0b3b8;
}

.comment-item.dark .reply-cancel-btn:hover {
    background: #4e4f50;
    color: #e4e6eb;
}

.reply-textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 12px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    color: #050505;
    transition: all 0.2s ease;
}

.reply-textarea:hover {
    border-color: #adb5bd;
}

.reply-textarea:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);
    background: #fff;
}

.comment-item.dark .reply-textarea {
    background: #1a1a1a;
    border-color: #495057;
    color: #e4e6eb;
}

.comment-item.dark .reply-textarea:hover {
    border-color: #6c757d;
}

.comment-item.dark .reply-textarea:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
    background: #2d2d2d;
}

.reply-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reply-form-footer .char-count {
    font-size: 12px;
    color: #65676b;
}

.comment-item.dark .reply-form-footer .char-count {
    color: #adb5bd;
}

.reply-submit-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reply-submit-btn:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

.reply-submit-btn:active {
    transform: translateY(0);
}

.reply-submit-btn:disabled {
    background: linear-gradient(135deg, #dee2e6 0%, #adb5bd 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.comment-item.dark .reply-submit-btn:disabled {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
}

/* Animation for replies appearing */
@keyframes replySlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-item {
    animation: replySlideIn 0.3s ease-out;
}

/* Mobile responsive for replies */
@media (max-width: 768px) {
    .reply-avatar img {
        width: 28px;
        height: 28px;
    }

    .reply-bubble {
        padding: 8px 10px;
    }

    .reply-bubble .reply-text {
        font-size: 13px;
    }

    .reply-meta {
        font-size: 10px;
    }

    .reply-textarea {
        font-size: 13px;
        padding: 8px 10px;
    }

    .reply-submit-btn {
        padding: 6px 16px;
        font-size: 12px;
    }
}
