/* APNews-inspired threading styles */
.threaded-comments {
    margin-top: 1rem;
    color: whitesmoke;
}

.thread-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    transition: all 0.2s ease;
    position: relative;
}

.thread-item:hover {
    background: rgba(0, 191, 255, 0.05);
}

    .thread-item.has-replies {
        border-left: 3px solid rgba(0, 123, 255, 0.3);
        background: rgba(0, 123, 255, 0.02);
    }

        .thread-item.has-replies .comment-header {
            background: rgba(0, 123, 255, 0.05);
            padding: 0.5rem;
            border-radius: 6px;
        }

.reply-count {
    color: rgba(0, 123, 255, 0.8);
    font-size: 0.85rem;
    margin-left: 1rem;
}

    .reply-count i {
        margin-right: 0.25rem;
    }

.has-replies-indicator {
    color: rgba(0, 123, 255, 0.7);
    font-size: 0.8rem;
    margin-left: 1rem;
}

    .has-replies-indicator i {
        margin-right: 0.25rem;
    }

/* Enhanced visual hierarchy for threaded discussions */
.thread-item.has-replies + .thread-item.is-reply {
    border-left: 3px solid rgba(0, 191, 255, 0.4);
    margin-left: 1rem;
    background: rgba(0, 191, 255, 0.02);
}

/* APNews-style threading with connection line */
.thread-item.is-reply {
    border-left: 3px solid rgba(0, 191, 255, 0.3);
    background: rgba(0, 191, 255, 0.02);
    margin-left: 1rem;
    position: relative;
}

.thread-item.is-reply::before {
    content: '';
    position: absolute;
    left: -3px;
    top: -1rem;
    width: 3px;
    height: 1rem;
    background: rgba(0, 191, 255, 0.3);
}

/* Main comment avatars (40px) */
.comment-avatar .user-avatar-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Reply avatars (32px - smaller) */
.thread-item.is-reply .comment-avatar .user-avatar-image,
.replies-section .comment-avatar .user-avatar-image {
    width: 32px;
    height: 32px;
}

.user-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0;
    color: rgba(248, 249, 250, 0.9);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.author {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.reply-indicator {
    color: rgba(0, 191, 255, 0.8);
    font-size: 0.9rem;
    font-style: italic;
}

.reply-indicator strong {
    color: #00BFFF;
    font-weight: 600;
}

.date {
    color: var(--bs-secondary);
    font-size: 0.85rem;
    margin-left: auto;
}

.comment-text {
    margin-bottom: 0.75rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comment-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: none;
    color: var(--bs-secondary);
    text-decoration: none;
}

.comment-actions .btn:hover {
    color: var(--primary-color, #007bff);
    background: rgba(0, 123, 255, 0.1);
}

.inline-reply-form {
    margin-left: 3rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 123, 255, 0.02);
}

/* Flagged comment styling */
.thread-item.flagged {
    border-left-color: #ffc107;
    background-color: rgba(255, 193, 7, 0.05);
}

.no-comments {
    background: rgba(108, 117, 125, 0.05);
    border-radius: 8px;
    padding: 2rem 1rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .thread-item.is-reply {
        margin-left: 0.5rem;
    }
    
    .inline-reply-form {
        margin-left: 1rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date {
        margin-left: 0;
    }
}

.comment-edit-form {
    margin: 0.5rem 0;
}

    .comment-edit-form textarea {
        resize: vertical;
        min-height: 80px;
        font-family: inherit;
    }

.edit-form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.edit-indicator {
    color: rgba(108, 117, 125, 0.8);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

    .edit-indicator i {
        margin-right: 0.25rem;
    }

/* Edit button styling */
.comment-actions .btn-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

    .comment-actions .btn-link:hover {
        text-decoration: none;
    }