/* Comments Container - 600px width */
.comments-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
    padding-bottom: 100px; /* Added space at bottom */
}

/* Comment Styles - UPDATED Facebook/Instagram Style */
.comments-list {
    padding: 0;
}

.comment-time {
    color: #999;
}

.comments-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* UPDATED: Facebook/Instagram Style Comment */
.comment {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
    background: transparent; /* Changed from #fff to transparent */
    max-width: 600px;
    margin: 0 auto;
}

.comment-content-wrapper {
    flex: 1;
    min-width: 0;
}

.comment-content {
    background: transparent; /* Changed from #f0f2f5 to transparent */
    border-radius: 18px;
    padding: 8px 12px;
    position: relative;
    max-width: 100%;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
    overflow: hidden;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* UPDATED: Comment Header - MOVED username near avatar */
.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    gap: 6px;
    position: relative;
    justify-content: flex-start;
    margin-left: 46px; /* Moved header near avatar */
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
}

.comment-username {
    color: #050505;
    font-size: 13px;
    font-weight: 600;
    margin-right: 4px;
}

.comment-time {
    font-size: 11px;
    color: #65676b;
    margin-right: auto;
}

.comment-time-mobile {
    display: none;
    font-size: 11px;
    color: #65676b;
}

/* UPDATED: Comment Text */
.comment-text {
    font-size: 14px;
    line-height: 1.4;
    color: #050505;
    word-wrap: break-word;
    margin-bottom: 4px;
    margin-top: -2px;
    margin-left: 46px; /* Align text with username */
}

/* UPDATED: Comment Actions - Facebook/Instagram Style */
.comment-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-left: 0;
    margin-left: 46px; /* Align actions with text */
    gap: 0;
}

/* UPDATED: Reply Text Button */
.reply-text-btn {
    background: none;
    border: none;
    color: #65676b; /* Light mode color */
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.reply-text-btn:hover {
    color: #1d9bf0;
}

/* UPDATED: Right Actions Container */
.comment-right-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* UPDATED: Like Button - CHANGED BACK TO comment-action */
.comment-action {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
    font-size: 12px;
    color: #65676b; /* Light mode color */
    min-width: auto;
}

.comment-action:hover {
    color: #f91880;
}

.comment-action.liked {
    color: #FF0000; /* Changed to red like post like */
}

.comment-action i {
    font-size: 12px;
}

.comment-action span {
    font-size: 11px;
    font-weight: 600;
}

/* UPDATED: More Options Button */
.more-options-btn {
    background: none;
    border: none;
    color: #65676b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-left: auto;
}

.more-options-btn:hover {
    opacity: 1;
    color: #1d9bf0;
}

/* Hide count when 0 */
.comment-action span:empty {
    display: none;
}

/* Comment Media Styles */
.comment-media {
    margin-top: 8px;
    margin-bottom: 8px;
    margin-left: 46px; /* Align media with text */
}

.comment-media img {
    width: 100%;
    max-height: 500px;
    border-radius: 12px;
    object-fit: cover;
}

.no-comments {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

/* Comments Header Styles */
.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0;
    max-width: 600px;
    margin: 0 auto 16px auto;
}

.comments-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comments-count {
    font-size: 15px;
    font-weight: 600;
    color: #666;
}

.comments-participants {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.commenter-avatars {
    display: flex;
    align-items: center;
}

.commenter-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -8px;
}

.commenter-avatar:first-child {
    margin-left: 0;
}

.commenter-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.views-count {
    font-size: 15px;
    color: #666;
    font-weight: 400;
}

.post-view-comment-input {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: white;
    border-top: 1px solid #eee;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
    background-color: white; /* Changed from glass effect */
}

.emoji-bar {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: white;
    border-top: 1px solid #eee;
    z-index: 1000;
    background-color: white; /* Changed from glass effect */
}

/* Avatar at bottom left - RESTORED */
.post-view-comment-input-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-view-comment-input-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-view-comment-input-avatar:empty::before {
    content: '👤';
    font-size: 18px;
    color: #999;
}

.post-view-comment-input-field-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

/* Emoji Bar - Moved above input container */


.emoji-button {
    background: none;
    border: none;
    font-size: 17px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: transform 0.2s, background-color 0.2s;
}

.emoji-button:hover {
    background-color: #f0f2f5;
    transform: scale(1.1);
}

/* Input field - RESTORED */
.post-view-comment-input-field {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 10px 45px 10px 16px;
    font-size: 15px;
    outline: none;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.4;
}

.post-view-comment-input-field:focus {
    border-color: #1d9bf0;
}

/* Input actions - RESTORED */
.post-view-comment-input-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-view-comment-image-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-view-comment-image-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.post-view-comment-image-button svg {
    width: 20px;
    height: 20px;
}

.post-view-comment-input-button {
    background-color: #e0e0e0;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-left: 8px;
}

.post-view-comment-input-button.active {
    background-color: #000;
}

.post-view-comment-input-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.post-view-comment-input-button svg {
    width: 20px;
    height: 20px;
}

/* Image preview - Above emoji bar */
.comment-image-preview-container {
    position: absolute;
    bottom: calc(100% + 50px);
    left: 58px;
    z-index: 1002;
}

.comment-image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image-button {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.remove-image-button:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* UPDATED: Like button styles - CHANGED BACK TO comment-action */
.comment-action svg {
    width: 16px;
    height: 16px;
    color: #65676b;
}

.comment-action.liked svg {
    color: #FF0000; /* Changed to red like post like */
}

.comment-action {
    font-size: 14px;
    gap: 6px;
}

.red-verified-badge {
    margin-left: 1px;
    color: #FFD700; /* Changed to yellow like post verification */
}

.media-preview-container {
    transition: opacity 0.3s ease;
}

.media-preview-container img {
    transition: transform 0.3s ease;
}

/* Comment text styling */
.comment-text .mention-link,
.comment-text .external-link {
    color: #FE2C55;
    text-decoration: none;
}

.comment-text .mention-link:hover,
.comment-text .external-link:hover {
    text-decoration: underline;
}

.comment-text .hashtag {
    color: #FE2C55;
}

/* Clickable elements */
.comment-username,
.comment-avatar {
    cursor: pointer;
}

.comment-username:hover,
.comment-avatar:hover {
    opacity: 0.8;
}

/* UPDATED: Smooth count animation */
.count-changing {
    animation: smoothCountChange 60s ease-in-out;
    display: inline-block;
}

@keyframes smoothCountChange {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }
    10% {
        opacity: 1;
        transform: scale(1.05);
    }
    20% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .comment {
        padding: 10px 12px;
    }
    
    .comment-actions {
        gap: 8px;
    }
    
    .comment-right-actions {
        gap: 8px;
    }
}

/* Dark Mode for Comments - Matching Notifications Style */
@media (prefers-color-scheme: dark) {
    /* Comments Container */
    .comments-container {
        background-color: #101010;
    }
    
    /* Comment Items */
    .comment {
        background: transparent; /* Changed from #101010 to transparent */
        border-bottom-color: #2f3336;
    }
    
    .comment-content {
        background: transparent; /* Changed from #1a1a1a to transparent */
    }
    
    /* Comment Header */
    .comment-username {
        color: #e7e9ea;
    }
    
    .comment-time {
        color: #71767b;
    }
    
    /* Comment Text */
    .comment-text {
        color: #e7e9ea;
    }
    
    /* Comment Actions */
    .reply-text-btn {
        color: #ffffff; /* Changed to white in dark mode */
    }
    
    .reply-text-btn:hover {
        color: #1877F2;
    }
    
    .comment-action {
        color: #ffffff; /* Changed to white in dark mode */
    }
    
    .comment-action:hover {
        color: #FF0000; /* Red on hover */
    }
    
    .comment-action.liked {
        color: #FF0000; /* Red when liked */
    }
    
    .more-options-btn:hover {
        color: #1877F2;
    }
    
    /* Comments Header */
    .comments-header {
        background: #101010;
    }
    
    .comments-count,
    .comments-participants {
        color: #71767b;
    }
    
    .no-comments {
        color: #71767b;
    }
    
    /* Comment Media */
    .comment-media img {
        border-color: #2f3336;
    }
    
    /* Input Field */
    .post-view-comment-input {
        background-color: #101010; /* Changed from glass effect */
        border-top-color: #2f3336;
    }
    
    .post-view-comment-input-field {
        background-color: #2d2d2d;
        border-color: #2f3336;
        color: #e7e9ea;
    }
    
    .post-view-comment-input-field:focus {
        border-color: #1877F2;
    }
    
    .post-view-comment-input-avatar {
        background-color: #2f3336;
    }
    
    .post-view-comment-input-avatar:empty::before {
        color: #8b98a5;
    }
    
    /* Emoji Bar */
    .emoji-bar {
        background-color: #101010; /* Changed from glass effect */
        border-top-color: #2f3336;
    }
    
    .emoji-button:hover {
        background-color: #2f3336;
    }
    
    /* Comment Text Elements */
    .comment-text .mention-link,
    .comment-text .external-link {
        color: #1877F2;
    }
    
    .comment-text .hashtag {
        color: #1877F2;
    }
    
    /* Image Preview */
    .comment-image-preview {
        background-color: #2d2d2d;
    }
    
    .remove-image-button {
        background: rgba(47, 51, 54, 0.9);
    }
    
    .remove-image-button:hover {
        background: rgba(47, 51, 54, 1);
    }
}


.like-btnn {
    background: transparent;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
}

.like-btnn.liked {
    color: #FF0000; /* Changed to red like post like */
}
