.post-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.avatar-group {
    display: flex;
    margin-left: 8px;
}

.avatar-group img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -8px;
}

.pinned-badge {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.comment-section {
    max-height: 500px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 16px;
}

.comment-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.comment-reply {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-left: 40px;
    margin-top: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #e4e6eb;
    transition: all 0.2s;
}

.comment-reply:hover {
    background: #f0f2f5;
    border-left-color: #0d6efd;
}

.reaction-btn {
    border: none;
    background: none;
    color: #6c757d;
    font-size: 14px;
    padding: 4px 8px;
    transition: all 0.2s;
    border-radius: 6px;
    font-weight: 500;
}

.reaction-btn:hover {
    color: #0d6efd;
    background: #e7f3ff;
}

.reaction-btn.active {
    color: #0d6efd;
    background: #e7f3ff;
}

.reply-btn {
    color: #65676b;
}

.reply-btn:hover {
    color: #0d6efd;
}

/* Reply Input Styles */
.reply-input-container {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reply-input-container .comment-input {
    background: #f8f9fa;
    border: 1px solid #e4e6eb;
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 14px;
    transition: all 0.2s;
}

.reply-input-container .comment-input:focus {
    background: white;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Replies Container */
.replies-container {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* View Replies Button */
.view-replies-btn {
    color: #65676b;
    background: none;
    border: none;
    font-size: 13px;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.view-replies-btn:hover {
    background: #f0f2f5;
    color: #0d6efd;
}

.view-replies-btn i {
    margin-right: 4px;
}

.post-stats {
    color: #65676b;
    font-size: 14px;
    padding: 8px 0;
}

.comment-input-wrapper {
    background: white;
    border-top: 1px solid #e4e6eb;
    padding: 16px;
}

.comment-input {
    background: #f0f2f5;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
}

.comment-input:focus {
    background: #e4e6eb;
    outline: none;
    box-shadow: none;
}

.modal-post-header {
    border-bottom: 1px solid #e4e6eb;
}

.view-replies-btn {
    color: #65676b;
    background: none;
    border: none;
    font-size: 13px;
    padding: 4px 0;
    text-decoration: none;
}

.view-replies-btn:hover {
    text-decoration: underline;
}

.mention {
    color: #0866ff;
    cursor: pointer;
}

.mention:hover {
    text-decoration: underline;
}

/* Create Post Styles */
.create-post-card {
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.create-post-input {
    background: #f0f2f5;
    border: none;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 15px;
    transition: background 0.2s;
}

.create-post-input:hover {
    background: #e4e6eb;
}

.create-post-action {
    border: none;
    background: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background 0.2s;
    font-weight: 500;
}

.create-post-action:hover {
    background: #f0f2f5;
}

.create-post-action i {
    font-size: 20px;
    margin-right: 8px;
}

/* Modal Styles */
.create-post-modal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.create-post-modal .modal-header {
    border-bottom: 1px solid #e4e6eb;
    padding: 16px 20px;
}

.create-post-modal .modal-title {
    font-weight: 600;
    font-size: 20px;
}

.create-post-modal .form-control {
    border: none;
    font-size: 15px;
}

.create-post-modal .form-control:focus {
    box-shadow: none;
}

.create-post-modal #postTitle {
    font-size: 18px;
    font-weight: 500;
}

.create-post-modal #postContent {
    font-size: 15px;
    resize: none;
}

.image-upload-btn {
    border: 2px dashed #e4e6eb;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
}

.image-upload-btn:hover {
    border-color: #0d6efd;
    background: #f0f8ff;
}

.image-upload-btn i {
    font-size: 32px;
    color: #6c757d;
}

.image-preview-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview-container img {
    width: 100%;
    border-radius: 8px;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.remove-image-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.submit-post-btn {
    background: linear-gradient(119.16deg, #8D4DF3 0%, #0120D4 100%);
    border: none;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 8px;
}

.submit-post-btn:disabled {
    opacity: 0.6;
}

.userC-list {
    /* height: calc(100vh - 100px); */
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.userC-list-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.userC-list-header input {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
}

.userC-list-body {
    overflow-y: auto;
    height: calc(100% - 60px);
}

.userC-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.userC-item:hover {
    background: #f8f9fa;
}

.userC-item.active {
    background: #e3f2fd;
}

.userC-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.userC-item-info {
    flex: 1;
}

.userC-item-info h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.userC-badge {
    width: 20px;
    height: 20px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}


/* Community Members Styles */
.community-members-box {
    max-height: 220px;
    overflow: hidden;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 30px;
}

.community-members-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
    flex-shrink: 0;
}

.community-members-header h6 {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #1c1e21;
    font-size: 15px;
}

.community-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s;
}

.community-search-input:focus {
    outline: none;
    border-color: #5e72e4;
    box-shadow: 0 0 0 2px rgba(94, 114, 228, 0.1);
}

.community-members-list {
    flex: 1;
    overflow-y: auto;
}

.community-member-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s;
}

.community-member-item:hover {
    background: #f8f9fa;
}

.community-member-item.selected {
    background: #e3f2fd;
    border-left: 3px solid #5e72e4;
}

.community-member-item img {
    flex-shrink: 0;
}

.community-member-info {
    flex: 1;
    min-width: 0;
}

.community-member-name {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1c1e21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.community-member-email {
    margin: 0;
    font-size: 12px;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Scrollbar styling for members list */
.community-members-list::-webkit-scrollbar {
    width: 4px;
}

.community-members-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.community-members-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.community-members-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.logo-brand {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}


/* Pinned Post Styles */
.post-card.pinned {
    border: 2px solid #ffc107;
    background: linear-gradient(135deg, #fffbf0 0%, #ffffff 50%);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2);
    position: relative;
}

.post-card.pinned::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
}

.post-card.pinned:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.3);
}

.pinned-badge {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(255, 193, 7, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pinned-badge i {
    font-size: 11px;
    animation: pinPulse 2s ease-in-out infinite;
}

@keyframes pinPulse {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

.post-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.post-menu-btn:hover {
    background: #f0f2f5;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: #f0f2f5;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}


/* Posts Section Headers */
.pinned-posts-header,
.recent-posts-header {
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
    color: #1c1e21;
}

.pinned-posts-header {
    background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
    border-left: 4px solid #ffc107;
}

.pinned-posts-header i {
    font-size: 16px;
}

.recent-posts-header {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.recent-posts-header i {
    font-size: 16px;
}


/* Message Button Styles */
.community-member-item {
    position: relative;
}

.community-member-item .message-btn {
    opacity: 0;
    transition: opacity 0.2s;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.community-member-item:hover .message-btn {
    opacity: 1;
}

.community-member-item .message-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.community-member-item .message-btn i {
    font-size: 14px;
}


/* Message Animation Styles */
.message-new {
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.message {
    animation: none;
}

/* Smooth fade-in for new messages */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Like Button Styles */
.like-post-btn {
    transition: all 0.2s ease;
    font-size: 14px;
    color: #65676b;
}

.like-post-btn:hover {
    color: #0d6efd;
}

.like-post-btn i.bi-hand-thumbs-up-fill {
    color: #0d6efd !important;
}

.like-post-btn .reaction-count {
    font-weight: 500;
}

/* Post Actions */
.post-actions {
    padding-top: 8px;
    border-top: 1px solid #e4e6eb;
}

.post-actions button,
.post-actions span {
    font-size: 14px;
    color: #65676b;
}

.post-actions button:hover {
    color: #0d6efd;
}

/* User Role Badge Styles */
.user-role-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-role-badge.bg-secondary {
    background-color: #6c757d !important;
    color: white;
}

.user-role-badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000;
}

.user-role-badge.bg-danger {
    background-color: #dc3545 !important;
    color: white;
}

/** Current User Role Badge Styles *!*/
.current-user-role-badge {
    display: flex;
    align-items: flex-start;
    margin-top: 2px;
}

.current-user-role-badge .user-role-badge {
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 8px;
    font-weight: 600;
}

/* ==================== IMPROVED THUMBNAIL STYLES ==================== */

/* Thumbnail container cho post card */
.post-thumbnail-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-thumbnail-container::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* Aspect ratio 16:9 */
}

.post-thumbnail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail-container {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.post-card:hover .post-thumbnail-image {
    transform: scale(1.02);
}

/* Thumbnail cho modal */
.post-modal-image-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    max-height: 500px;
}

.post-modal-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    max-height: 500px;
}

/* Alternative style - Square với overlay gradient */
.post-thumbnail-container.style-square::before {
    padding-top: 100%; /* Square 1:1 */
}

.post-thumbnail-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.post-card:hover .post-thumbnail-container::after {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post-thumbnail-container {
        border-radius: 8px;
    }

    .post-modal-image-container {
        border-radius: 8px;
        max-height: 400px;
    }

    .post-modal-image {
        max-height: 400px;
    }
}

/* Loading placeholder cho thumbnail */
.post-thumbnail-container.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Style cho image trong create post modal preview */
#imagePreview .image-preview-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
    margin-top: 12px;
}

#imagePreview .image-preview-container img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

/* Improved remove button */
#imagePreview .remove-image-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid white;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    z-index: 10;
}

#imagePreview .remove-image-btn:hover {
    background: rgba(220, 53, 69, 0.9);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#imagePreview .remove-image-btn i {
    font-size: 16px;
}

/* Cải thiện image upload area */
.image-upload-btn {
    border: 2px dashed #d0d7de;
    border-radius: 12px;
    padding: 48px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f6f8fa;
}

.image-upload-btn:hover {
    border-color: #0d6efd;
    background: #e7f3ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
}

.image-upload-btn i {
    font-size: 48px;
    color: #57606a;
    transition: color 0.3s ease;
}

.image-upload-btn:hover i {
    color: #0d6efd;
}

.image-upload-btn p {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #57606a;
}

/* Post card body spacing adjustments */
.post-card-body {
    padding: 16px;
}

.post-card-body h6 {
    font-size: 16px;
    font-weight: 600;
    color: #1c1e21;
    line-height: 1.4;
    margin-bottom: 8px;
}

.post-card-body p {
    font-size: 14px;
    line-height: 1.5;
    color: #65676b;
}

/* Smooth transitions */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* css forum introduce */
.forum-sidebar {
    position: sticky;
    top: 30px;              /* khoảng cách từ top */
}


.forum-card {
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.forum-cover img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.forum-body {
    padding: 16px 18px 20px;
}

.forum-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.forum-link {
    font-size: 14px;
    color: #6c757d;
    text-decoration: none;
}

.forum-desc {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
}

.stat strong {
    display: block;
    font-size: 16px;
}

.stat span {
    font-size: 12px;
    color: #6c757d;
}

.forum-avatars {
    display: flex;
    margin-top: 14px;
}

.forum-avatars img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -8px;
}
.forum-stats {
    display: flex;
    gap: 120px;
    margin-top: 10px;
}

.forum-stats .stat {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    font-size: 0.9rem;
    color: #555;
}

.forum-stats .stat i {
    margin-bottom: 5px;
    color: #007bff; /* màu xanh icon */
    font-size: 1rem;
}
.forum-stats  .stat > span{
    margin-bottom: 1px;
}