/* Instagram-Style Comments System - Clean Implementation */

/* Main comment wrapper */
.ig-comment-wrapper {
    padding: 16px 12px;
    border-bottom: 1px solid var(--cl-secondary-border-color, #dbdbdb);
}

/* Comment item (both parent and reply) */
.ig-comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
}

/* Parent comment */
.ig-parent-comment {
    margin-bottom: 12px;
}

/* Reply comment with left border */
.ig-reply-comment {
    position: relative;
    margin-left: 40px;
    padding-left: 24px;
    margin-top: 12px;
}

.ig-reply-comment::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--cl-secondary-border-color, #dbdbdb);
}

/* Avatar */
.ig-comment-avatar {
    flex-shrink: 0;
}

/* Parent comment avatar - add spacing from edges */
.ig-parent-comment .ig-comment-avatar {
    margin-left: 8px !important;
    margin-top: 4px !important;
}

.ig-comment-item.ig-parent-comment .ig-comment-avatar {
    margin-left: 8px !important;
    margin-top: 4px !important;
}

.ig-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.ig-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Comment content */
.ig-comment-content {
    flex: 1;
    min-width: 0;
}

/* Comment header */
.ig-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.ig-username {
    text-decoration: none;
    color: var(--cl-primary-text-color, #262626);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ig-username strong {
    font-size: 14px;
    font-weight: 600;
}

.ig-verified-badge,
.ig-premium-badge {
    display: inline-flex;
    align-items: center;
}

.ig-verified-badge svg {
    width: 14px;
    height: 14px;
    display: block;
}

.ig-premium-badge img {
    display: block;
}

.ig-comment-time {
    font-size: 12px;
    color: var(--cl-secondary-text-color, #8e8e8e);
}

/* Comment text */
.ig-comment-text {
    font-size: 14px;
    line-height: 18px;
    color: var(--cl-primary-text-color, #262626);
    margin-bottom: 8px;
    word-wrap: break-word;
}

/* Media in comments */
.ig-comment-media {
    margin: 12px 0;
    max-width: 300px;
}

.ig-comment-media-small {
    max-width: 200px;
}

.ig-media-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.ig-media-img-small {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.ig-comment-video video {
    width: 100%;
    border-radius: 8px;
}

/* Comment actions */
.ig-comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    position: relative;
}

/* 3-dot menu dropdown styling */
.ig-comment-actions .ctrls-item.dropleft {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.ig-comment-actions .ctrls-item__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.ig-comment-actions .ctrls-item__icon:hover {
    background-color: var(--cl-secondary-bg-color, #f5f5f5);
}

.ig-action-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--cl-secondary-text-color, #8e8e8e);
    cursor: pointer;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ig-action-btn:hover {
    color: var(--cl-primary-text-color, #262626);
}

.ig-action-btn-small {
    font-size: 12px;
}

.ig-action-btn.ig-liked {
    color: #ed4956;
}

/* Like button - red when liked */
.ctrls-item.liked {
    color: #ed4956;
}

/* Heart icon SVG styling */
.ig-action-btn .ctrls-item__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ig-action-btn .ctrls-item__icon svg {
    display: block;
}

/* View replies button */
.ig-view-replies-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--cl-secondary-text-color, #8e8e8e);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.ig-view-replies-btn:hover {
    color: var(--cl-primary-text-color, #262626);
}

.ig-reply-line {
    width: 24px;
    height: 2px;
    background-color: var(--cl-secondary-text-color, #8e8e8e);
    border-radius: 1px;
}

/* Replies container */
.ig-replies-container {
    margin-top: 12px;
}

.ig-replies-container.ig-replies-visible {
    display: block !important;
}

/* Nested replies - additional indentation */
.ig-nested-replies {
    margin-left: 20px;
}

.ig-nested-replies .ig-reply-comment {
    margin-left: 20px;
}

/* Nested replies - additional indentation */
.ig-nested-replies {
    margin-left: 20px;
}

.ig-nested-replies .ig-reply-comment {
    margin-left: 20px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ig-comment-wrapper {
        padding: 12px 0;
    }
    
    .ig-avatar {
        width: 36px;
        height: 36px;
    }
    
    .ig-avatar-small {
        width: 28px;
        height: 28px;
    }
    
    .ig-reply-comment {
        margin-left: 32px;
        padding-left: 16px;
    }
    
    .ig-comment-text {
        font-size: 13px;
    }
    
    .ig-comment-media {
        max-width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .ig-comment-text {
        color: #f5f5f5;
    }
    
    .ig-username {
        color: #f5f5f5;
    }
}
