#loadMorePostsBtn, #loadMoreUsersBtn {
    grid-column: 1 / -1;
}

.posts-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: var(--light-gray);
    position: relative;
}

.posts-search-bar {
    padding: 10px;
    background-color: var(--white);
    border-bottom: 1px solid #e0e0e0;
    display: none; /* Hidden by default */
}

.posts-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
}

.post-item {
    background-color: var(--white);
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.post-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-left: 10px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.post-user-info {
    flex: 1;
}

.post-user-name {
    font-weight: 600;
}

.post-time {
    font-size: 0.8rem;
    color: var(--gray);
}

.post-options-btn {
    cursor: pointer;
    color: var(--gray);
    padding: 5px;
}

.post-options-menu {
    display: none;
    position: absolute;
    left: 15px;
    top: 50px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 10;
    overflow: hidden;
}

.post-options-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--dark-gray);
    text-decoration: none;
}

.post-options-menu a:hover {
    background: var(--light-gray);
}

.post-content {
    padding: 15px;
}

.post-text {
    margin-bottom: 10px;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* --- START: Read More Styles --- */
.post-text.post-text-truncated {
    max-height: 4.5em; /* يحدد ارتفاع النص بما يعادل 3 أسطر تقريبًا */
    overflow: hidden;
    position: relative;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    padding: 5px 0;
    display: block; /* يجعله يظهر في سطر جديد */
    margin-top: 5px;
}
/* --- END: Read More Styles --- */

.post-text.expandable .truncated-content {
    display: inline;
}
.post-text.expandable .read-more-btn {
    display: inline;
    margin-right: 5px;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}
.post-text.expandable .read-more-btn:hover {
    text-decoration: underline;
}
[dir="ltr"] .post-text.expandable .read-more-btn {
    margin-right: 0;
    margin-left: 5px;
}

.post-media {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.post-media img, .post-media video {
    width: 100%;
    display: block;
}

.post-stats {
    display: flex;
    padding: 0 15px;
    border-top: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
    color: var(--gray);
    font-size: 0.9rem;
}

.post-stat {
    margin-left: 15px;
    padding: 8px 0;
}

.post-actions {
    display: flex;
    padding: 0 15px;
}

.post-action {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.3s;
}

.post-action:hover, .post-action.liked {
    color: var(--primary-color);
}

.post-action i {
    margin-left: 5px;
}

.new-post-container {
    padding: 20px;
}

.post-media-preview {
    margin-top: 15px;
    text-align: center;
}

.post-media-preview img, .post-media-preview video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
}

.comments-section {
    padding: 15px;
    background-color: #fafafa;
    border-top: 1px solid #e0e0e0;
    display: none; /* Hidden by default now */
}

.comment-item {
    display: flex;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    margin-left: 10px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    cursor: pointer;
}

.comment-body {
    flex: 1;
    background-color: var(--white);
    border-radius: 8px;
    padding: 10px;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.comment-user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-time {
    font-size: 0.7rem;
    color: var(--gray);
    margin-right: 10px;
}

.comment-text {
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.comment-input-area {
    display: flex;
    margin-top: 10px;
    align-items: center;
    position: relative; /* Added for mention dropdown positioning */
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
}

.send-comment-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    cursor: pointer;
    flex-shrink: 0;
}

.comment-actions {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 8px;
}

.reply-to-comment-btn {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
}

.reply-to-comment-btn:hover {
    color: var(--primary-color);
}

.replies-container {
    margin-right: 40px;
    margin-top: 10px;
    border-right: 2px solid var(--light-gray);
    padding-right: 10px;
    display: none; /* Hidden by default, toggled by "View Replies" */
}

.reply-item {
    display: flex;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.reply-avatar {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    margin-left: 8px;
    flex-shrink: 0;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer; /* Added cursor for clickability */
}

.reply-content {
    flex: 1;
    background-color: var(--light-gray);
    padding: 8px;
    border-radius: 8px;
}

.reply-header {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

.reply-user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.reply-time {
    font-size: 0.7rem;
    color: var(--gray);
    margin-right: 10px;
}

.reply-text {
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.reply-input-area {
    display: none; /* Changed from 'none' to 'flex' on interaction */
    margin-top: 10px;
    margin-right: 40px;
    align-items: center; /* Vertically align items */
    gap: 5px; /* Add some space between input and button */
    position: relative; /* Added for mention dropdown positioning */
}

.reply-input-area .comment-input { /* Re-use existing style */
    width: 100%;
    flex: 1;
}

.reply-input-area .send-reply-btn {
     width: 32px; /* Slightly smaller button */
     height: 32px;
     margin-right: 0; /* Remove right margin */
}

.toggle-replies-btn { /* New style for toggle replies button */
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    margin-top: 5px;
    text-align: left;
    display: block; /* Ensure it takes its own line */
}
.toggle-replies-btn:hover {
    text-decoration: underline;
}

/* أنماط إشعارات المنشورات */
.posts-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 10px 10px;
    background-color: var(--light-gray);
}

.posts-header-bar h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark-gray);
}

.post-notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--dark-gray);
}

.post-notification-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--notification-color);
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1px;
}

.post-notification-badge.active {
    display: flex;
}

#postNotificationsDropdown {
    display: none;
    position: absolute;
    top: 45px;
    left: 10px;
    width: calc(100% - 20px);
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 200;
}

/* New CSS for Comments Modal */
.comments-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none; /* Hidden by default */
}

.comments-modal-content {
    background-color: var(--white);
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    height: 80%; /* Fixed height to enable internal scrolling */
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* Ensure content inside respects border-radius */
}

.comments-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--light-gray);
    background-color: var(--primary-dark);
    color: white;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.comments-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.comments-modal-header .close-modal-btn {
    font-size: 1.2rem;
    cursor: pointer;
    color: white;
}

.comments-modal-body {
    flex: 1;
    overflow-y: auto; /* Make comments scrollable */
    padding: 15px;
    background-color: var(--light-gray);
}

.comments-modal-footer {
    padding: 15px;
    border-top: 1px solid var(--light-gray);
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Re-using existing comment input styles */
.comments-modal-footer .comment-input-area {
    margin-top: 0; /* Override default margin */
}

/* Style for the highlighted comment when coming from a notification */
.highlighted-comment {
    background-color: #d4f3ef; /* A light teal color */
    border: 1px solid var(--primary-color);
    padding: 5px;
    margin: -5px; /* To offset the padding */
    border-radius: 10px;
    transition: background-color 1.5s ease-out;
}

.hashtag {
    color: #1d9bf0; 
    font-weight: bold;
    direction: ltr; 
    display: inline-block;
}