/* أنماط صفحة المجتمع - تصميم يشبه الفيس بوك */

/* تنسيق عام */
body.community-page {
    background-color: #f0f2f5;
}

.community-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* الشريط العلوي */
.community-header {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #e4e6eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.community-header .nav-link {
    color: #65676b;
    border: none;
    padding: 10px 15px;
    font-weight: 500;
    position: relative;
    margin-right: 5px;
    border-radius: 0;
    transition: all 0.2s ease;
}

.community-header .nav-link.active {
    color: #03a7d3;
    background-color: transparent;
    border-bottom: 3px solid #03a7d3;
}

.community-header .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #03a7d3;
}

.fa-icon {
    font-size: 1.2rem;
}

/* القائمة الجانبية */
.community-sidebar {
    position: sticky;
    top: 80px;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 5px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    justify-content: space-between;
}

.sidebar-menu-item:hover {
    background-color: #f0f2f5;
    color: #03a7d3;
    text-decoration: none;
}

.sidebar-menu-item i {
    width: 24px;
    margin-left: 10px;
    text-align: center;
    color: #03a7d3;
}

.sidebar-menu-item span:first-of-type {
    flex-grow: 1;
}

.saved-posts-count {
    font-size: 0.75rem;
}

.sidebar-menu-item.active {
    background-color: #e7f3ff;
    color: #03a7d3;
}

/* أنماط قسم المنشورات المحفوظة */
#saved-posts-container {
    transition: all 0.3s ease;
}

#saved-posts-list .saved-post-item {
    padding: 10px;
    border-bottom: 1px solid #f0f2f5;
    transition: all 0.2s;
}

#saved-posts-list .saved-post-item:last-child {
    border-bottom: none;
}

#saved-posts-list .saved-post-item:hover {
    background-color: #f8f9fa;
}

#saved-posts-list .saved-post-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
    display: block;
}

#saved-posts-list .saved-post-info {
    font-size: 0.75rem;
    color: #65676b;
}

#saved-posts-list .saved-post-user {
    font-weight: 600;
}

.empty-saved-posts {
    padding: 20px 0;
    font-weight: 500;
}

/* صندوق إنشاء منشور */
.create-post-card {
    border-radius: 8px;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.create-post-input {
    border-radius: 20px;
    background-color: #f0f2f5;
    border: none;
    padding: 8px 12px;
}

.create-post-input:focus {
    background-color: #f0f2f5;
    box-shadow: none;
}

.create-post-actions {
    border-top: 1px solid #e4e6eb;
    padding-top: 8px;
}

.create-post-btn {
    border-radius: 20px;
    padding: 8px 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
    background-color: transparent;
    transition: all 0.2s;
}

.create-post-btn:hover {
    background-color: #f0f2f5;
}

.create-post-btn i {
    margin-left: 8px;
}

/* بطاقة المنشور */
.post-card {
    border-radius: 8px;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

.post-header {
    padding: 12px 16px;
}

.post-user-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.post-user-name {
    font-weight: 600;
    color: #050505;
    text-decoration: none;
}

.post-time {
    color: #65676b;
    font-size: 0.8rem;
}

.post-options-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
    background-color: transparent;
    transition: all 0.2s;
}

.post-options-btn:hover {
    background-color: #f0f2f5;
}

.post-content {
    padding: 0 16px 16px;
}

.post-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.post-text {
    color: #050505;
    margin-bottom: 12px;
}

.post-image {
    margin: 0 -16px;
    max-height: 500px;
    object-fit: cover;
}

.post-footer {
    border-top: 1px solid #e4e6eb;
    padding: 8px 16px;
}

.post-stats {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: #65676b;
    font-size: 0.9rem;
}

.post-action-btn {
    flex: 1;
    border-radius: 4px;
    padding: 6px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #65676b;
    background-color: transparent;
    transition: all 0.2s;
}

.post-action-btn:hover {
    background-color: #f0f2f5;
}

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

.post-action-btn.liked {
    color: #1877f2;
}

/* قسم التعليقات */
.comment-section {
    padding: 8px 16px;
    border-top: 1px solid #e4e6eb;
}

.comment-input-container {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.comment-input {
    border-radius: 20px;
    background-color: #f0f2f5;
    border: none;
    padding: 8px 12px;
    flex-grow: 1;
    margin-right: 8px;
}

.comment-input:focus {
    background-color: #f0f2f5;
    box-shadow: none;
}

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

.comment-content {
    background-color: #f0f2f5;
    border-radius: 18px;
    padding: 8px 12px;
    margin-right: 8px;
}

.comment-user {
    font-weight: 600;
    color: #050505;
    text-decoration: none;
}

.comment-text {
    color: #050505;
}

.comment-actions {
    display: flex;
    margin-right: 50px;
    font-size: 0.8rem;
}

.comment-action {
    color: #65676b;
    font-weight: 500;
    margin-left: 12px;
    text-decoration: none;
}

.comment-action:hover {
    text-decoration: underline;
}

/* قسم المستخدمين المقترحين */
.suggested-users-card {
    border-radius: 8px;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.suggested-user-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.suggested-user-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 10px;
}

.suggested-user-name {
    font-weight: 500;
    color: #050505;
    text-decoration: none;
}

.suggested-user-info {
    color: #65676b;
    font-size: 0.8rem;
}

.follow-btn {
    background-color: #e7f3ff;
    color: #1877f2;
    border-radius: 4px;
    padding: 4px 8px;
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
    transition: all 0.2s;
}

.follow-btn:hover {
    background-color: #dbe7f2;
}

/* تأثيرات حركية */
.post-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* تنسيق متجاوب */
@media (max-width: 992px) {
    .community-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .community-header .nav-link span {
        display: none;
    }
    
    .community-header .nav-link {
        padding: 8px;
    }
    
    .post-action-btn span {
        font-size: 0.8rem;
    }
}

/* أنماط رسائل التوست */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* أنماط أزرار المنشور */
.post-actions {
    display: flex;
    align-items: center;
}

/* تغيير لون الأيقونات في صفحة المجتمع */
.fa-icon, 
.fas, 
.far, 
.fab, 
.fa {
    color: #03a7d3;
}

/* استثناءات للأيقونات */
.text-danger i,
.btn-danger i,
.text-danger .fas,
.text-danger .far,
.text-danger .fa {
    color: #e41e3f;
}

.post-action-link {
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #65676b;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.post-action-link:hover {
    background-color: #f0f2f5;
    color: #03a7d3;
}

.post-action-link.text-danger:hover {
    background-color: #fff2f5;
    color: #e41e3f;
}

.post-options-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: auto;
    right: 0;
    z-index: 1000;
    min-width: 200px;
    padding: 8px 0;
    margin: 2px 0 0;
    font-size: 0.875rem;
    color: #212529;
    text-align: right;
    background-color: #fff;
    background-clip: padding-box;
    border: none;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    transform-origin: top right;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    width: auto;
    max-width: 250px;
}

.post-options-dropdown .dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}

.post-options-dropdown .dropdown-menu:not(.show) {
    display: none;
    opacity: 0;
    transform: scale(0.95);
    visibility: hidden;
}

.post-header {
    position: relative;
    overflow: visible;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    color: #050505;
    text-decoration: none;
    white-space: normal;
    background-color: transparent;
    border: 0;
    clear: both;
    font-weight: 400;
    text-align: right;
    width: 100%;
}

.dropdown-item:hover, .dropdown-item:focus {
    color: #16181b;
    text-decoration: none;
    background-color: #f0f2f5;
}

.dropdown-item i {
    margin-left: 8px;
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    margin: 4px 0;
    overflow: hidden;
    background-color: #e9ecef;
}

/* تصحيح مشكلة عرض القائمة المنسدلة */
.post-options-dropdown .list-unstyled {
    padding: 0;
    margin: 0;
    list-style: none;
    width: 100%;
}
