/* Core styles shared across all namespaces */
.newsfeed-wrapper {
    position: relative;
}

.newsfeed-posts-container {
    min-height: 200px;
}

.newsfeed-post-card {
    transition: box-shadow 0.3s ease;
}

.newsfeed-post-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.newsfeed-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.newsfeed-avatar-circle img {
    width: 40px;
    height: 40px;
}

.newsfeed-comments-avatar-circle {
   width: 25px;
    height: 25px;
    border-radius: 50%;
    background-color: #a0a0a0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.newsfeed-comments-avatar-circle img {
    width: 25px;
    height: 25px;
}

.newsfeed-post-content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Widget mode specific */
[data-display-mode="widget"] .newsfeed-posts-container {
    max-height: 500px;
    overflow-y: auto;
}

[data-display-mode="widget"] .newsfeed-post-card {
    font-size: 0.9rem;
}

[data-display-mode="widget"] .newsfeed-avatar-circle {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

/* Widget-specific styles */
.newsfeed-wrapper[data-display-mode="widget"] .newsfeed-posts-container {
    min-height: 200px; /* Prevent empty widget from collapsing */
    position: relative;
}

/* No posts message styling */
.newsfeed-no-posts {
    margin: 2rem 0;
    text-align: center;
}

.newsfeed-wrapper[data-display-mode="widget"] .newsfeed-no-posts {
    margin: 1rem;
    font-size: 0.9rem;
}

/* Loading spinner should be centered in widget */
.newsfeed-wrapper[data-display-mode="widget"] .newsfeed-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

/* Comment Item Styles */
.newsfeed-comment-item {
    position: relative;
}

.newsfeed-comments-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.newsfeed-comments-avatar-circle .avatar-initials {
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.newsfeed-comment-body {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 8px;
    flex-grow: 1;
}

.newsfeed-comment-author a {
    color: #212529;
    text-decoration: none;
}

.newsfeed-comment-author a:hover {
    text-decoration: underline;
}

.newsfeed-comment-text {
    color: #495057;
    line-height: 1.5;
    word-wrap: break-word;
}

.newsfeed-comment-actions {
    font-size: 12px;
}

.newsfeed-comment-actions .btn-link {
    font-size: 12px;
    text-decoration: none;
}

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

/* Nested replies indentation */
.newsfeed-comment-replies {
    border-left: 2px solid #dee2e6;
    padding-left: 12px;
}

/* Edit/Reply forms */
.newsfeed-comment-edit-form,
.newsfeed-comment-reply-form {
    margin-top: 8px;
}

/* Mobile responsiveness */
@media (max-width: 576px) {
    .newsfeed-comment-replies {
        margin-left: 0;
        padding-left: 8px;
    }
    
    .newsfeed-comments-avatar-circle {
        width: 28px;
        height: 28px;
    }
}