      * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg,rgb(32, 36, 42) 0%,rgb(37, 38, 41) 100%);
            color: #333;
            line-height: 1.6;
            direction: ltr;
            text-align: left;
        }

        .main-container {
            display: flex;
            max-width: 1200px;
            margin: 0 auto;
            gap: 20px;
            padding: 20px;
            min-height: 100vh;
        }
        /* إخفاء الفوتر في الشاشات الكبيرة */
@media (min-width: 769px) {
    .mobile-footer-nav {
        display: none !important;
    }
}
/* تنسيق الفوتر للجوال */
@media (max-width: 768px) {
.mobile-footer-nav {
        display: flex;
        justify-content: space-around;
        align-items: center; /* 💡 توسيط عمودي للأيقونات */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px; /* ارتفاع ثابت ومناسب */
        background: #ffffff;
        border-top: 1px solid #efefef;
        z-index: 2000;
        
        /* ⚠️ تأكد من أن هذه القيم صفر إذا كانت الأيقونات نازلة للأسفل */
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #262626;
        text-decoration: none;
        font-size: 10px;
        flex: 1;
    }

    .nav-item i {
        font-size: 20px;
        margin-bottom: 2px;
    }

    .nav-item.active {
        color: #0095f6;  /* لونك الأخضر المفضل */
    }

    .footer-avatar {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        object-fit: cover;
    }

    /* تنسيق زر الإضافة العائم (اختياري) */
    .add-btn-main .add-inner {
        background : #0095f6; 
        color: white;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 18px;
        box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
        margin-bottom: 5px;
    }
}

        /* الشريط الجانبي الأيسر */
        .sidebar-left {
            width: 250px;
            background: white;
            border-radius: 15px;
            padding: 20px;
            height: fit-content;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            position: sticky;
            top: 20px;
        }

        .sidebar-profile {
            text-align: center;
            margin-bottom: 25px;
            padding-bottom: 20px;
            border-bottom: 2px solid #f0f0f0;
        }

        .sidebar-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            object-fit: cover;
            margin-bottom: 15px;
            border: 4px solid #1da1f2;
            box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
        }

        .sidebar-username {
            font-weight: bold;
            color: #333;
            margin-bottom: 5px;
        }

        .sidebar-menu {
            list-style: none;
        }

        .sidebar-menu li {
            margin-bottom: 8px;
        }

        .sidebar-menu a {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 15px;
            color: #666;
            text-decoration: none;
            border-radius: 10px;
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .sidebar-menu a:hover {
            background: linear-gradient(135deg, #4cadaf 0%, #4cadaf 100%);
            color: white;
            transform: translateX(5px);
            box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
        }

        .sidebar-menu a.active {
            background: linear-gradient(135deg, #4cadaf 0%, #4cadaf 100%);
            color: white;
        }

        /* المحتوى الرئيسي */
        .main-content {
            flex: 1;
            max-width: 600px;
        }

        /* ================================================= */
/* قسم القصص (Story List - الشريط العلوي) */
/* ================================================= */

.stories-section {
    /* أساس القسم الخارجي */
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.stories-container {
    /* حاوية القصص (شريط التمرير الأفقي) */
    display: flex;
    gap: 15px; /* المسافة بين كل قصة */
    overflow-x: auto; /* تفعيل التمرير الأفقي */
    padding: 10px 0;
    /* إخفاء شريط التمرير الأفقي (اختياري) */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
}
.stories-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.story-item {
    flex-shrink: 0; 
    flex-basis: 80px; /* عرض 80 بكسل لكل قصة */
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.story-item:hover {
    transform: scale(1.05);
}

/* ================================================= */
/* أنماط صورة البروفايل في قائمة القصص (Story List) */
/* ================================================= */

.story-avatar {
    /* الصورة الرمزية في القصص */
    width: 60px !important;
    height: 60px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4cadaf; /* حدود خضراء للقصص النشطة */
    margin-bottom: 5px;
}

.story-username {
    font-size: 0.8em;
    color: #666;
    max-width: 75px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* أنماط أيقونة إضافة قصة */
.add-story {
    position: relative;
}
.add-story-icon {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #009cbb;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    font-size: 0.7em; 
}


.nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    padding: 20px 10px;
    cursor: pointer;
    pointer-events: auto; /* يجعل الأزرار قابلة للنقر */
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-btn:disabled {
    opacity: 0.2;
    cursor: default;
}

.nav-btn:hover:not(:disabled) {
    opacity: 1;
}

        /* زر إضافة المنشور */
        .create-post-btn {
            background: linear-gradient(135deg,#4cadaf 0%, #4cadaf 100%);
            color: white;
            border: none;
            padding: 15px 25px;
            border-radius: 25px;
            cursor: pointer;
            font-weight: 600;
            font-size: 1.1em;
            width: 100%;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
        }

        .create-post-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
 
        }
/* تنسيق حاوي الفيديو الخاص بـ FLABTAP */
.flabtap-video-container {
    width: 100%;
    max-height: 550px; /* أقصى ارتفاع مسموح به لكي لا يختفي المنشور تحت الشاشة */
    background-color: #0000; /* خلفية سوداء للمساحات الفارغة إذا كان الفيديو بأبعاد غريبة */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-top: 10px;
    border-radius: 8px; /* اختياري ليتناسب مع حواف الكارد */
}

/* عنصر الفيديو نفسه */
.flabtap-video-element {
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: contain; /* يظهر الفيديو كاملاً دون قصه داخل مربع */
    display: block;
}

        /* منطقة المنشورات */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px; /* 🚨 تعديل: تقليل الـ padding العمودي (من 20px إلى 10px) لتقليل الارتفاع العام */
    border-bottom: 1px solid #f0f0f0;
    /* 💡 الحل الإضافي: فرض أقصى ارتفاع إذا كان الـ padding وحده غير كافٍ، لكن يفضل الاعتماد على الـ padding */
    /* max-height: 80px; */ 
}

.post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #4CAF50;
}

.post-user-info {
    flex: 1;
}

.post-username {
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
}

.post-time {
    color: #666;
    font-size: 0.9em;
}


.post-content {
    padding: 0 20px 20px;
    display: flex;         /* تفعيل نظام الفليكس المحترف للحاوية الأم */
    flex-direction: column;/* ترتيب العناصر عمودياً (نص ثم ميديا) */
    row-gap: 15px;         /* 🚨 هذا هو السحر! يجبر المتصفح على ترك 15px إجبارية بين أي عنصرين */
}

/* تنظيف حاوية النص وجعلها مرنة */
.post-text-container {
    display: block;
    width: 100%;
    margin: 0 !important;  /* إلغاء الهوامش القديمة لمنع التضارب */
    padding: 5px 0;        /* مساحة داخلية خفيفة */
}
.text-normal {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

/* إجبار النصوص القصيرة والطويلة على أخذ مساحتها الكاملة */
.text-short, .text-full, .text-normal {
    font-size: 15px;
    line-height: 1.6;
    color: #333333;
    word-break: break-word;
    display: block;
    width: 100%;
}

/* تحسين المساحة الخاصة بالـ text-normal تحديداً للحماية */
.text-normal {
    padding-top: 10px;     /* دفع النص بعيداً عن الهيدر بأمر داخلي إجباري */
    padding-bottom: 5px;   /* دفع ما بعده لأسفل */
}

/* ضبط الميديا لتبدأ مباشرة بعد الفاصل الزمني */
.post-media {
    margin-top: 0 !important; /* نعتمد الآن على row-gap الذكي لمنع الالتصاق */
    display: block;
    width: 100%;
}


.text-short {
    padding-top: 10px;     /* دفع النص بعيداً عن الهيدر بأمر داخلي إجباري */
    padding-bottom: 5px;   /* دفع ما بعده لأسفل */
}




/* الحاوية الرئيسية مبرمجة عمودياً لتفادي التداخل بالكامل */
.post-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
}

/* سطر الأزرار العلوية */
.post-action-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.post-action {
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.95em;
}

.post-action:hover {
    background: #f5f5f5;
}

.post-action.liked {
    color: #e91e63;
}

/* 🌟 السطر الجديد الذكي: يجمع الإحصائيات مع الـ Boost بشكل متوازي في الشاشات الواسعة */
.post-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-top: 4px;
}

.post-stats {
    color: #666;
    font-size: 0.85em;
    font-weight: 500;
}

/* 📱 شاشة الهاتف المحمول: ترتيب عمودي لمنع أي تداخل بأي شكل */
@media (max-width: 480px) {
    .post-actions {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .post-action-buttons {
        gap: 8px; /* تضييق المسافات قليلاً في الهواتف لتكفي الشاشة */
    }
    
    .post-action {
        padding: 6px 8px;
        font-size: 0.9em;
    }

    /* في الهواتف، نجعل الإحصائيات في سطر والـ Boost في سطر تحتها إذا لزم الأمر، أو نضمن توزيع المساحة */
    .post-meta-row {
        flex-direction: row; /* يظل متوازياً ولكن مع حماية المساحات */
        justify-content: space-between;
        align-items: center;
    }

    .post-stats {
        font-size: 0.8em;
    }
}


/* 💡 تنسيقات الخيارات المنسدلة المصححة (ضرورية لعدم تضخيم الرأس) */
.post-actions-dropdown {
    position: relative; 
    /* 🚨 إضافة: هذا يضمن أن ارتفاع الزر لا يسبب ارتفاعًا إضافيًا */
    align-self: flex-start; 
}

.post-options-btn {
    /* 🚨 إضافة: لتقليل الحجم حول النقاط الثلاث */
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
}

.post-options-menu {
    position: absolute; 
    top: 100%; 
    right: 0;
    
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 10;
    min-width: 150px;
    padding: 5px 0;
}


/* 1. الحاوية: تبقى القيود الأساسية هنا */
.post-video-wrapper {
    /* 🚨 يجب أن نضع الحد الأقصى للارتفاع هنا */
    max-height: 400px; 
    
    /* 🔑 الحل: لا نحتاج إلى overflow: hidden الآن لأننا سنضبط object-fit على وسم الفيديو */
    /* قم بالتأكد من إزالة overflow: hidden; */ 

    position: relative;
    border-radius: 10px;
    margin-bottom: 15px;
    width: 100%; /* للتأكيد */
}

/* 2. وسم الفيديو: يملأ الحاوية ويعرض نفسه بشكل "لائق" (Cover) */
.post-video-element {
    width: 100%;
    height: 100%;
    display: block;
    
    /* 💡 في الوضع العادي: نستخدم cover لملء الإطار (يتم القص من الأعلى والأسفل إذا كان الفيديو أطول) */
    object-fit: cover; 
    
    /* 🚨 هذا يضمن أن ارتفاع الفيديو لا يتجاوز ارتفاع الحاوية */
    max-height: 400px;
}

/* 3. 🔑 التعديل الحاسم: إجبار سلوك ملء الشاشة */
/* عندما يدخل المتصفح في وضع ملء الشاشة، نتجاهل كل القيود ونستخدم object-fit: contain */
.post-video-element:fullscreen {
    width: 100%;
    height: 100%;
    
    /* 🛑 هذا هو مفتاح حل مشكلة "الجزء الظاهر فقط": يجبر المتصفح على عرض الفيديو كاملاً */
    object-fit: contain; 
    
    /* 🛑 إزالة أي قيود ارتفاع سابقة قد تكون موروثة */
    max-height: none; 
}

/* 4. لإعادة ظهور أيقونة ملء الشاشة الأصلية */
.post-video-element::-webkit-media-controls-fullscreen-button {
    display: block !important;
}


      /* للتأكد من أن الإعلان داخل الخلاصة يتجاوب مع عرض المنشور */
.ad-card-in-feed {
    width: 100%;
    /* تأكد من أن أي محتوى داخله لا يتجاوز 100% */
}

.ad-card-in-feed iframe,
.ad-card-in-feed img {
    max-width: 100% !important; 
    height: auto; 
}

        /* الشريط الجانبي الأيمن */
        .sidebar-right {
            width: 300px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .widget {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        }

        .widget-title {
            font-weight: bold;
            margin-bottom: 15px;
            color: #333;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .suggested-user {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .suggested-user:last-child {
            border-bottom: none;
        }

        .suggested-avatar {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            object-fit: cover;
        }

        .suggested-info {
            flex: 1;
        }

        .suggested-username {
            font-weight: 600;
            color: #333;
            margin-bottom: 2px;
        }

        .suggested-mutual {
            color: #666;
            font-size: 0.8em;
        }

        .follow-btn {
            background: #4cadaf;
            color: white;
            border: none;
            padding: 6px 15px;
            border-radius: 15px;
            cursor: pointer;
            font-size: 0.9em;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .follow-btn:hover {
            background: #33c9dde4;
            transform: scale(1.05);
        }

        .follow-btn.following {
            background: #666;
        }

        /* النوافذ المنبثقة */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            justify-content: center;
            align-items: center;
            z-index: 1000;
            backdrop-filter: blur(5px);
        }

        .modal.show {
            display: flex;
        }



        @keyframes modalSlide {
            from {
                opacity: 0;
                transform: translateY(-50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #f0f0f0;
        }

        .modal-title {
            font-size: 1.3em;
            font-weight: bold;
            color: #333;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 1.5em;
            cursor: pointer;
            color: #666;
            padding: 5px;
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .modal-close:hover {
            background: #f0f0f0;
            color: #333;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #333;
        }

        .form-control {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            font-size: 16px;
            transition: all 0.3s ease;
            outline: none;
        }

        .form-control:focus {
            border-color: #4CAF50;
            box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
        }

        textarea.form-control {
            resize: vertical;
            min-height: 100px;
        }

        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            font-weight: 600;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s ease;
            font-size: 0.95em;
        }

        .btn-primary {
            background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
        }

        .btn-outline {
            background: transparent;
            color: #4CAF50;
            border: 2px solid #4CAF50;
        }

        .btn-outline:hover {
            background: #4CAF50;
            color: white;
        }

       /* نافذة التعليقات */
        .comments-modal-content {
            max-width: 800px;
            width: 95%;
        }

        .comments-section {
            max-height: 400px;
            overflow-y: auto;
            margin: 20px 0;
        }

.comment {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    position: relative; /* إضافة هذه الخاصية */
}


        .comment-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }

        .comment-content {
            flex: 1;
        }

        .comment-username {
            font-weight: bold;
            color: #333;
            margin-bottom: 5px;
        }

        .comment-text {
            color: #666;
            line-height: 1.4;
        }

        .add-comment {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }

        .add-comment textarea {
            flex: 1;
            padding: 12px;
            border: 2px solid #e0e0e0;
            border-radius: 20px;
            resize: none;
            outline: none;
            min-height: 40px;
        }

        .add-comment button {
            background: #4CAF50;
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 20px;
            cursor: pointer;
            font-weight: 500;
        }

        /* رسائل التنبيه */
        .alert {
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
            animation: slideDown 0.3s ease-out;
        }

        .alert-success {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }

        .alert-error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* تصميم متجاوب */
        @media (max-width: 768px) {
            .main-container {
                flex-direction: column;
                padding: 10px;
                gap: 15px;
            }

            .sidebar-left {
                width: 100%;
                order: 3;
                position: static;
            }

            .main-content {
                order: 1;
                max-width: 100%;
            }

            .sidebar-right {
                width: 100%;
                order: 2;
            }

            .story-avatar {
                width: 50px;
                height: 50px;
            }

            .post-header {
                padding: 15px;
            }

            .post-content {
                padding: 0 15px 15px;
            }

            .post-actions {
                padding: 12px 15px;
            }

            .post-action-buttons {
                gap: 15px;
            }

            .modal-content {
                width: 95%;
                padding: 20px;
                margin: 10px;
            }

            .sidebar-menu a {
                padding: 10px 12px;
                font-size: 0.9em;
            }

            .sidebar-avatar {
                width: 60px;
                height: 60px;
            }
        }

        @media (max-width: 480px) {
            .main-container {
                padding: 5px;
            }

            .stories-section {
                padding: 15px;
            }

            .post-header {
                padding: 12px;
            }

            .post-content {
                padding: 0 12px 12px;
            }

            .post-actions {
                padding: 10px 12px;
            }

            .post-action-buttons {
                gap: 10px;
            }

            .post-action {
                padding: 6px 10px;
                font-size: 0.9em;
            }

            .create-post-btn {
                padding: 12px 20px;
                font-size: 1em;
            }
        }

        /* تحسينات إضافية */
        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid #f3f3f3;
            border-top: 3px solid #4CAF50;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .no-posts {
            text-align: center;
            padding: 60px 20px;
            color: #666;
        }

        .no-posts i {
            font-size: 4em;
            margin-bottom: 20px;
            color: #ddd;
        }
                /* أنماط جديدة للقصص */


        
        /* زر حذف المنشور */
        .delete-post {
            background:rgb(182, 205, 208);
            color: white;
            border: none;
            padding: 5px 10px;
            border-radius: 5px;
            cursor: pointer;
            margin-left: 10px;
        }
        

        
        /* بروفايل صغير للمستخدم */
        .profile.php {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            background: white;
            border-radius: 10px;
            margin-bottom: 15px;
        }
        
        .mini-profile-img {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
        }
.options-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
}

.options-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.options-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.options-list li:last-child {
    border-bottom: none;
}

.options-list a {
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.options-list a:hover {
    color: #4267B2;
}
/* تنسيقات قائمة خيارات المنشور */
.post-actions-dropdown {
    position: relative;
    margin-left: auto;
}

.post-options-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    font-size: 16px;
    outline: none;
}

.post-options-btn:hover {
    color: #333;
}

.post-options-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000; /* تأكد من أن هذه القيمة أعلى من أي عنصر آخر */
    min-width: 150px;
    overflow: hidden;
}

.delete-post-btn {
    width: 100%;
    padding: 8px 12px;
    text-align: right;
    background: none;
    border: none;
    cursor: pointer;
    color: #ff4444;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-post-btn:hover {
    background: #ffeeee;
}

.delete-post-btn i {
    font-size: 12px;
}
.delete-comment-btn {
    display: inline-block !important;
    color: red;
}
 
        /* زر حذف التعليق */
.delete-comment-btn {
    position: absolute; /* تغيير إلى absolute */
    left: auto; /* إلغاء أي قيمة لـ left */
    right: 12px; /* تحديد المسافة من اليمين */
    top: 12px; /* تحديد المسافة من الأعلى */
    background: none;
    border: none;
    color:rgb(162, 151, 151);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}

.delete-comment-btn:hover {
    color: #cc0000;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

/* ======================================= */
/* 1. تنسيق النافذة ومحتواها (MODAL STRUCTURE) */
/* ======================================= */

/* المودال الأساسي: خلفية داكنة لتسليط الضوء على المحتوى */
.modal {
    background-color: rgba(0, 0, 0, 0.8); /* خلفية سوداء شفافة أنيقة */
    transition: opacity 0.3s ease; /* إضافة حركة سلسة عند الفتح/الإغلاق */
}

/* محتوى المودال: جعله مستديراً وجذاباً */
.modal-content {
    background-color: #ffffff; /* خلفية بيضاء نقية */
    padding: 25px 30px;
    border-radius: 12px; /* حواف مستديرة أكثر */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* ظل ناعم */
    animation: fadeIn 0.3s ease-out; /* حركة ظهور صغيرة */
}

/* حركة ظهور للمودال */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ======================================= */
/* 2. تنسيق العنوان والإغلاق (HEADER & CLOSE) */
/* ======================================= */

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee; /* خط فاصل خفيف */
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: #333; /* لون نص داكن وواضح */
    font-size: 1.5em;
    font-weight: 600; /* خط سميك قليلاً */
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8em;
    color: #aaa; /* لون رمادي فاتح وأنيق */
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #e74c3c; /* لون أحمر خفيف عند التمرير */
}

/* ======================================= */
/* 3. تنسيق النموذج وحقل الملف (FORM & INPUT) */
/* ======================================= */

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #555;
}

/* 💡 تنسيق حقل رفع الملفات ليكون أكثر جمالاً */
.form-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed #ccc; /* حدود متقطعة جذابة */
    border-radius: 8px;
    cursor: pointer;
    color: #555;
    background-color: #f9f9f9;
    transition: all 0.3s;
}

.form-group input[type="file"]:hover {
    border-color: #3498db; /* تغيير اللون عند التمرير */
    background-color: #f0faff;
}

/* ======================================= */
/* 4. تنسيق زر الإرسال (SUBMIT BUTTON) */
/* ======================================= */

.btn-primary {
    display: block;
    width: 100%; /* زر بعرض كامل */
    padding: 12px;
    background-color: #3498db; /* لون أزرق جذاب */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background-color: #2980b9; /* لون أغمق قليلاً عند التمرير */
}

.btn-primary:active {
    transform: scale(0.99); /* تأثير ضغطة بسيطة */
}







/* 1. الحاوية الكبرى المغطية للشاشة */
#story-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000; /* سواد تامل لملء الفراغات */
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
}

/* 2. جسم الستوري (شكل الهاتف الذكي) */
.story-content-viewer {
    position: relative;
    width: 100%;
    max-width: 420px; 
    height: 100%;
    max-height: 92vh; 
    background-color: #000000;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 📱 ملء الشاشة المطلق على الهواتف */
@media (max-width: 480px) {
    .story-content-viewer {
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* 3. شريط التقدم العلوي */
.story-progress-container {
    position: absolute;
    top: 12px;
    left: 0;
    width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
    display: flex;
    gap: 5px;
    z-index: 20;
}
.story-progress-bar-bg {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}
.story-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: #ffffff;
}

/* 4. معلومات المستخدم (أعلى الستوري) */
.story-user-info {
    position: absolute;
    top: 25px;
    left: 0;
    width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    z-index: 20;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
}
.story-user-info-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}
.story-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #ffffff;
}
.story-username-text {
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.story-close-btn {
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    line-height: 0.8;
}
/* 5. منطقة الميديا (ملء الشاشة الفعلي) */
/* تأكيد ملء الشاشة لمنطقة العرض */
#story-media-display {
    width: 100%;
    height: 100%;
    flex: 1;
    position: relative;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* لمنع أي خروج لأطراف الفيديو */
}

/* العنصر المسؤول عن الصورة أو الفيديو داخل الستوري */
.story-media-content {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover; /* 💡 هذا السطر يجبر الفيديو والصورة على قص الأطراف الزائدة وملء الشاشة بالكامل دون تشويه */
    object-position: center; /* الحفاظ على منتصف الفيديو في مركز الشاشة */
}

/* حاوية الفيديو المزدوج */
.video-story-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

/* 1. الفيديو الخلفي المموه */
.story-video-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) brightness(0.6); /* تضبيب قوي وتقليل الإضاءة */
    transform: scale(1.1); /* إخفاء الحواف البيضاء الناتجة عن التضبيب */
    z-index: 1;
}

/* 2. الفيديو الأمامي الرئيسي النظيف */
.story-video-main {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain; /* 💡 يضمن ظهور الفيديو بالكامل دون قص أي جزء منه */
    z-index: 2;
}

/* حاوية الصورة المزدوجة (تأثير الضباب الخلفي) */
.image-story-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

/* 1. الصورة الخلفية المموهة */
.story-image-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) brightness(0.6); /* تضبيب وتقليل الإضاءة */
    transform: scale(1.1); /* إخفاء الحواف البيضاء الناتجة عن التضبيب */
    z-index: 1;
}

/* 2. الصورة الأمامية الرئيسية النظيفة كاملة الأبعاد */
.story-image-main {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain; /* 💡 يضمن ظهور الصورة بالكامل دون قص أي حرف منها */
    z-index: 2;
}

/* مناطق اللمس الجانبية */
.story-touch-area {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20%;
    z-index: 15;
}
.story-touch-left { left: 0; }
.story-touch-right { right: 0; width: 80%; }

/* 6. شريط التفاعل السفلي الموحد المساحة */
.story-footer-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75px; /* تثبيت الارتفاع لتوحيد الهيكل */
    padding: 0 16px;
    box-sizing: border-box;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 40%, transparent);
    z-index: 20;
    display: flex;
    align-items: center;
}

/* واجهة المشاهد (الرد + القلب) */
.viewer-footer-layout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}
.story-reply-area {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 10px 16px;
}
.story-reply-area input {
    flex: 1;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
}
.story-reply-area input::placeholder { color: rgba(255, 255, 255, 0.6); }
.story-reply-send-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.05rem;
}

/* واجهة صاحب الستوري (الاحصائيات الأنيقة) */
.owner-footer-layout {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.owner-stats-group {
    display: flex;
    gap: 20px;
}
.owner-stat-button {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.owner-stat-button:hover { background: rgba(255, 255, 255, 0.25); }
.owner-delete-button {
    background: none;
    border: none;
    color: #ff3b30;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
}

/* زر القلب للمشاهد */
.story-heart-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.7rem;
    cursor: pointer;
    padding: 0;
}

/* 7. القائمة المنبثقة السفلى للمشاهدين (الـ Slider السفلي اللطيف للهواتف) */
.story-views-slider {
    position: absolute;
    bottom: -100%; /* مخفي في البداية */
    left: 0;
    width: 100%;
    height: 50%; /* يشغل نصف طول الستوري عند فتحه */
    background: #1c1c1e;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    z-index: 30;
    transition: bottom 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
    display: flex;
    flex-direction: column;
}
.story-views-slider.active { bottom: 0; } /* يرتفع للأعلى عند التفعيل */

.slider-header {
    padding: 14px;
    text-align: center;
    color: #ffffff;
    font-weight: bold;
    border-bottom: 1px solid #2c2c2e;
    position: relative;
}
.slider-close {
    position: absolute;
    right: 16px;
    top: 14px;
    color: #aeaeae;
    cursor: pointer;
}
.slider-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
}
.viewer-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-decoration: none;
    color: #ffffff;
}
.viewer-list-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.viewer-list-item span { font-size: 0.95rem; font-weight: 500; }



/* Container for the shared post inside the story */
.post-share-story-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1c1c1e; /* Dark elegant background */
    z-index: 10;
}

/* The actual post card block */
.story-post-card {
    width: 85%;
    max-width: 340px;
    background: #2c2c2e; /* Light dark background for contrast */
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid #3a3a3c;
    box-sizing: border-box;
}

.story-post-card:hover {
    transform: scale(1.02);
}

/* Header inside the card (Avatar + Username) */
.story-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #3a3a3c;
    padding-bottom: 8px;
}

.story-card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #0095f6; /* Beautiful tech blue border */
}

.story-card-username {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Image inside the card if present */
.story-card-image {
    width: 100%;
    max-height: 220px;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 12px;
    display: block;
}

/* Footer note to guide users */
.story-card-footer-note {
    font-size: 12px;
    text-align: center;
    color: #0095f6;
    font-weight: bold;
    margin-top: 8px;
    font-family: sans-serif;
    letter-spacing: 0.5px;
}


/* 1. الحاوية الكبرى التي تجمع الأيقونات والستوريات */
.stories-section {
    padding-top: 0 !important;   /* إزالة أي مسافة علوية في القسم بالكامل */
    margin-top: 0 !important;
}

/* 2. شريط الأيقونات العلوي */
.mobile-top-bar {
    display: flex;
    width: 100%;
    padding: 10px 15px 0 15px; /* قللنا المسافة السفلية (الرقم الثالث 0) */
    margin-bottom: 0 !important; /* التأكد من عدم وجود هامش سفلي */
    background: transparent;
    box-sizing: border-box;
}

/* 3. حاوية الستوريات نفسها */

/* دفع الأيقونات لليمين (كما فعلنا سابقاً) */
.top-actions {
    display: flex;
    gap: 20px;
    margin-left: auto;
    align-items: center;
}

/* نقل الإحصائيات والقلب للأسفل */
.story-footer-actions {
    position: absolute;
    bottom: 80px; /* فوق حقل الرد */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    z-index: 10;
}


.story-interactions {
    position: absolute;
    bottom: 15px; /* رفعناه قليلاً ليكون بمحاذاة حقل الرد */
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 1010;
    pointer-events: all; /* التأكد من أن الأزرار قابلة للضغط */
}

/* 3. إصلاح تموضع أيقونة الزائد (+) لتظهر دائماً */
.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.add-story-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #0095f6; /* لون أزرق */
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    border: 2px solid white;
    cursor: pointer;
    z-index: 10;
}

/* 4. تمييز أفتار المستخدم الحالي إذا كان لديه ستوري */
.active-story .story-avatar {
    border: 2px solid #e91e63;
    padding: 2px;
}


/* تنسيق الحاوية العلوية داخل قسم الستوري */
.mobile-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: transparent; /* لكي يندمج مع خلفية الستوري */
}

/* حاوية الأيقونات في اليمين */
.top-actions {
    display: flex;
    gap: 20px; /* مسافة بين القلب والرسائل */
    align-items: center;
}

/* تنسيق الأيقونات الفردية */
.action-icon {
    text-decoration: none;
    color: #262626; /* أو white إذا كنت تستخدم الوضع المظلم */
    transition: transform 0.2s ease;
}

.action-icon i {
    font-size: 24px; /* تكبير الحجم */
}

/* تأثير عند الضغط */
.action-icon:active {
    transform: scale(0.9);
    opacity: 0.8;
}

/* لمسة جمالية لأيقونة الرسائل */
.messenger-icon i {
    /* لون متدرج خفيف أو لون مميز إذا أردت */
    color: #0095f6; 
}

/* لضمان اختفاء هذا الترتيب في الشاشات الكبيرة إذا كنت لا تريده */
@media (min-width: 769px) {
    .mobile-header-top {
        display: none;
    }
}

/* الحاوية الرئيسية للهيدر العلوي */
/* الحاوية العلوية */
.mobile-top-bar {
    display: flex;
    width: 100%;
    padding: 15px 15px 15px 15px; /* مسافة من الحواف */
    background: transparent;
    box-sizing: border-box; /* لضمان عدم خروج العناصر عن الشاشة */
}

/* دفع مجموعة الأيقونات لليمين تماماً */
.top-actions {
    display: flex;
    gap: 20px; /* المسافة بين القلب والرسائل */
    margin-left: auto; /* 💡 هذا السطر هو السر، يدفع العناصر لليمين */
    align-items: center;
}

/* تنسيق الأيقونات */
.action-icon i {
    font-size: 24px;
    color: #262626; /* لون إنستغرام المعتاد */
    display: block;
}

/* لون أيقونة المسنجر (اختياري) */
.messenger-icon i {
    color: #0095f6; 
}

/* الشاشات الكبيرة */
@media (min-width: 769px) {
    .mobile-top-bar {
        display: none;
    }
}
.notification-badge-red {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: #ff3b30; /* لون أحمر صارخ مثل إنستجرام */
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    border: 2px solid white; /* ليفصل الشارة عن الخلفية */
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
/* تنسيق الشارة الحمراء للهواتف */
.notification-badge-mobile {
    position: absolute;
    top: -5px;      /* لرفع الدائرة للأعلى قليلاً */
    right: -5px;    /* لتحريك الدائرة لليمين قليلاً */
    background-color: #ff3b30; /* اللون الأحمر الرسمي للإشعارات */
    color: white;
    font-size: 10px; /* حجم الخط صغير ليناسب الهاتف */
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 50%; /* لجعلها دائرية */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 2px solid white; /* إطار أبيض ليفصلها عن أيقونة القلب */
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    line-height: 1;
}

/* لضمان أن الأيقونة الأب لا تخرج عن الحدود */


@keyframes slideIn {

    from { transform: translateY(20px); opacity: 0; }

    to { transform: translateY(0); opacity: 1; }

}



/* رأس النافذة */

.modal-header {

    padding: 15px 20px;

    border-bottom: 1px solid #eee;

    display: flex;

    justify-content: space-between;

    align-items: center;

}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}
.close-modal {

    font-size: 24px;

    cursor: pointer;

    color: #888;

    transition: 0.3s;
}



.close-modal:hover {

    color: #ff4d4d;

}



/* قائمة الأصدقاء داخل النافذة */

#friendsListContainer {

    max-height: 400px;

    overflow-y: auto;

    padding: 10px;

}



.friend-item {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 12px 15px;

    border-radius: 10px;

    transition: background 0.2s;

}



.friend-item:hover {

    background-color: #f9f9f9;

}



.friend-info {

    display: flex;

    align-items: center;

    gap: 12px;

}



.friend-info img {

    width: 40px;

    height: 40px;

    border-radius: 50%;

    object-fit: cover;

}



.friend-name {

    font-weight: 600;

    color: #262626;

}



/* زر الإرسال */

.btn-send-share {

    background-color: #4e54c8;

    color: white;

    border: none;

    padding: 8px 16px;

    border-radius: 8px;

    cursor: pointer;

    font-weight: 500;

    transition: background 0.3s;

}



.btn-send-share:hover {

    background-color: #3d4199;

}



.btn-send-share.sent {

    background-color: #28a745; /* أخضر عند النجاح */

}



/* تصميم شريط البحث عن صديق (اختياري لكنه احترافي) */

.share-search {

    padding: 10px 15px;

}



.share-search input {

    width: 100%;

    padding: 10px;

    border: 1px solid #ddd;

    border-radius: 8px;

    background-color: #efefef;

}

.external-options {

    display: flex;

    gap: 10px;

    justify-content: center;

    padding-bottom: 10px;

}
.share-option-btn {
    background: #f0f2f5;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}
.share-option-btn:hover {

    background: #e4e6eb;

}
.friend-info img {

    width: 45px; /* حجم صورة البروفايل */
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
   border: 1px solid #ddd;

} 
.story-nav-star {
    position: absolute;
    right: 15px; /* مسافة من الحافة اليمنى */
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px; /* حجم النجمة الصغيرة */
    color: rgba(255, 255, 255, 0.5); /* شفافة قليلاً */
    cursor: pointer;
    z-index: 2000;
    transition: all 0.3s ease;
    padding: 10px;
}

.story-nav-star:hover {
    color: #1c99a4; /* تتحول للذهبي عند الحوم فوقها */
    text-shadow: 0 0 10px #1c8881;
    transform: translateY(-50%) scale(1.3);
}

/* إخفاء النجمة في الهواتف لأن المستخدم سيستخدم Swipe */
@media (max-width: 768px) {
    .story-nav-star {
        display: none;
    }
}
/* 7. تسيود وتبييض السايدبار (الأيمن والأيسر) والقصص والويدجت */
body.dark-mode .sidebar-left,
body.dark-mode .sidebar-right,
body.dark-mode .stories-section,
body.dark-mode .widget,
body.dark-mode .modal-content,
body.dark-mode .post-options-menu {
    background-color: #1e1e1e !important;
    background: #1e1e1e !important;
    color: #ffffff !important;
    border-color: #333 !important;
}

/* 8. تبييض روابط القوائم الجانبية وأسمائها */
body.dark-mode .sidebar-username,
body.dark-mode .sidebar-menu a {
    color: #ffffff !important;
}

body.dark-mode .sidebar-profile {
    border-bottom-color: #333 !important;
}

/* 9. الحل النهائي للفوتر (Mobile Footer) - إجباره على السواد */
body.dark-mode footer,
body.dark-mode .mobile-footer,
body.dark-mode .footer-mobile,
body.dark-mode .bottom-nav {
    background-color: #1e1e1e !important;
    background: #1e1e1e !important;
    border-top: 1px solid #333 !important;
}

/* تبييض أيقونات ونصوص الفوتر */
body.dark-mode footer i,
body.dark-mode .mobile-footer i,
body.dark-mode .bottom-nav i,
body.dark-mode .mobile-footer span {
    color: #ffffff !important;
}

/* 10. تبييض التعليقات ومنطقة الكتابة */
body.dark-mode .comment {
    background: #2a2a2a !important;
    color: #ffffff !important;
}

body.dark-mode .add-comment textarea {
    background: #2a2a2a !important;
    color: #ffffff !important;
    border-color: #444 !important;
}

/* 11. إخفاء البياض المزعج في المودل */
body.dark-mode .modal-header {
    border-bottom-color: #333 !important;
}


.insta-slider-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
}

/* غلاف الصور مع خاصية التمرير الناعم */
.slider-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory; /* تجعل الصورة تقف في مكانها */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* تمرير ناعم للموبايل */
}

/* منع ظهور شريط التمرير (Scrollbar) */
.slider-wrapper::-webkit-scrollbar {
    display: none;
}

.slide-item {
    min-width: 100%; /* كل صورة تأخذ كامل عرض الحاوية */
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9f9f9;
}

.post-img {
    width: 100%;
    height: auto;
    max-height: 500px; /* تحديد أقصى ارتفاع لكي لا تكون ضخمة */
    object-fit: contain; /* للحفاظ على أبعاد الصورة دون قصها */
}

/* أسهم التنقل (تظهر في الحاسوب فقط) */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: none; /* مخفية افتراضياً */
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* إظهار الأسهم فقط في الشاشات الكبيرة */
@media (min-width: 768px) {
    .slider-btn { display: flex; }
}

.btn-prev { left: 10px; }
.btn-next { right: 10px; }

/* النقاط (Dots) */
.slider-dots {
    text-align: center;
    padding: 10px 0;
}
.dot {
    height: 8px;
    width: 8px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    margin: 0 3px;
    transition: background-color 0.3s;
}
.dot.active { background-color: #4CAF50; }

/* التنسيق الأساسي لزر اقرأ المزيد */
.read-more-btn {
    background: none;
    border: none;
    color: #19c4eb; /* لون أخضر متناسق مع شعار موقعك */
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 0;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    position: relative;
}

/* إضافة خط تحت الزر يظهر عند الحوّم (Hover) */
.read-more-btn::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #61bdff;
    transition: width 0.3s ease;
}

.read-more-btn:hover {
    color: #38638e; /* لون أغمق قليلاً عند المرور عليه */
    letter-spacing: 0.5px; /* حركة بسيطة للنص */
}

.read-more-btn:hover::after {
    width: 100%;
}

/* تنسيق النص المقطوع ليكون مريحاً للعين */
.text-short, .text-normal {
    color: #444;
    line-height: 1.7;
    font-size: 15px;
    white-space: pre-line;
}

.text-full {
    color: #444;
    line-height: 1.7;
    font-size: 15px;
    animation: fadeIn 0.4s ease; /* حركة ظهور ناعمة للنص الكامل */
    white-space: pre-line;

}
/* تقليل المسافة الناتجة عن أسطر النص */
.text-short, .text-full, .text-normal {
    line-height: 1.4; /* تقليل ارتفاع السطر (الافتراضي عادة 1.6 أو أكثر) */
}

/* إذا كنت تستخدم nl2br، يمكنك التحكم في المسافة بين الأسطر المكسورة */
.text-short br, .text-full br {
    content: "";
    display: block;
    margin-bottom: 5px; /* تحكم في هذا الرقم لتقليل أو زيادة المسافة بين الفقرات */
}
/* أنيميشن بسيط لظهور النص */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Frontpage Boost & Promotion Styles --- */

/* Promoted Badge for Visitors */
.promoted-badge {
    background: rgba(0, 149, 246, 0.1);
    color: #0095f6;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(0, 149, 246, 0.2);
    text-transform: uppercase;
}

/* Boosted Status for Owner */
.owner-boosted-status {
    color: #2cc771;
    font-size: 12px;
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Boost Action Button */
.btn-boost-action {
    background: #0095f6;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-boost-action:hover {
    background: #0077c5;
}

.btn-boost-action:active {
    transform: scale(0.95);
}

/* Promotion Modal Buttons Grid */
.promo-plan-btn {
    width: 100%;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.promo-plan-btn:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
    transform: translateY(-1px);
}

/* Popular Plan Highlight (7 Days) */
.promo-plan-btn.popular {
    border: 2px solid #0095f6;
    background: #f0f9ff;
}

.promo-plan-btn.popular:hover {
    background: #e0f2fe;
}

.promo-plan-btn strong {
    color: #1e293b;
    font-size: 15px;
}

.promo-plan-btn .plan-price {
    color: #0095f6;
    font-weight: 700;
    font-size: 15px;
}
/* تأثير أنيميشن خفيف لظهور النافذة بشكل سلس */
@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Container for Toast Messages */
#toastBox {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 100000005 !important; /* لتقف فوق المودال والشاشة السوداء */
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Individual Toast Style */
.toast-msg {
    min-width: 280px;
    max-width: 360px;
    background: #ffffff;
    color: #1e293b;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    animation: slideInToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
}

/* Status Colors & Borders */
.toast-msg.success {
    border-left: 5px solid #2cc771;
}
.toast-msg.success i {
    color: #2cc771;
}

.toast-msg.error {
    border-left: 5px solid #ea4335;
}
.toast-msg.error i {
    color: #ea4335;
}

.toast-msg.info {
    border-left: 5px solid #0095f6;
}
.toast-msg.info i {
    color: #0095f6;
}

/* Animations */
@keyframes slideInToast {
    from { transform: translateX(-120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutToast {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.9); opacity: 0; }
}
/* الكتلة الهندسية الأساسية للزر (مثل كبسولة ريديت) */
.flabtap-upvote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* المسافة بين السهم العريض والرقم */
    padding: 6px 16px;
    background-color: #f1f3f4; /* خلفية هندسية رمادية خفيفة ومحايدة */
    border: none;
    border-radius: 999px; /* شكل كبسولة بيضاوية هندسية مثالية */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    user-select: none;
}

/* غلاف الأيقونة لضبط حجم السهم المكتنز */
.upvote-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

/* السهم العريض ثنائي الأبعاد (رسمة SVG المكتنزة) */
.upvote-svg {
    width: 100%;
    height: 100%;
    fill: #878a8c; /* لون السهم الافتراضي النظيف */
    transition: fill 0.2s ease, transform 0.2s ease;
}

/* خط العداد/الرقم بجانب السهم */
.upvote-count {
    font-size: 13px;
    font-weight: 700; /* خط عريض ليتناسق مع وزن السهم */
    color: #1a1a1b;
    font-family: sans-serif;
    transition: color 0.2s ease;
}

/* 🟢 الحالة السحرية عند الضغط (Upvoted Active State) */
.flabtap-upvote-btn.upvoted {
    background-color: #e6f4ea; /* خلفية هندسية خضراء هادئة ونقية */
}

/* تحول السهم العريض للون الأخضر النقي عند التفعيل */
.flabtap-upvote-btn.upvoted .upvote-svg {
    fill: #00875a; /* اللون الأخضر النقي والراقي */
    transform: translateY(-2px); /* حركة صعود خفيفة جداً تعطي متعة بصرية عند الضغط */
}

/* تحول الرقم للون الأخضر النقي عند التفعيل */
.flabtap-upvote-btn.upvoted .upvote-count {
    color: #00875a;
}

/* تأثير خفيف عند تمرير الماوس (Hover) قبل الضغط */
.flabtap-upvote-btn:hover:not(.upvoted) {
    background-color: #e8eaed;
}
.flabtap-upvote-btn:hover:not(.upvoted) .upvote-svg {
    fill: #1a1a1b; /* يغمق السهم قليلاً كتنبيه للتفاعل */
}

/* تأثير ضغط الإصبع أو الماوس (Click Feedback) */
.flabtap-upvote-btn:active {
    transform: scale(0.95); /* تأثير ارتدادي هندسي ممتع */
}
/* --- تنسيقات زر التحكم في التصويت (Toggle Button) --- */
.poll-toggle-btn {
    transition: transform 0.2s ease, color 0.2s ease;
}

.poll-toggle-btn:hover {
    transform: scale(1.1);
    color: #0056b3 !important;
}

.poll-toggle-btn.active {
    color: #007bff !important;
}

/* --- صندوق التصويت الأساسي --- */
.post-poll-box {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border-color: #eef0f2;
    animation: fadeInSlide 0.3s ease-out;
}

/* --- خيارات التصويت (Items) --- */
.poll-option-item {
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* تأثير عند تمرير الماوس فوق الخيار */
.poll-option-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.08);
}

/* خلفية شريط التقدم المتحرك للمؤشرات */
.poll-bg-progress {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background-color: rgba(0, 123, 255, 0.08); /* لون أزرق خفيف وشفاف خلف النص */
    width: 0%; /* يتم التحكم به ديناميكياً عبر الجافا سكريبت */
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تمييز الخيار الذي قام المستخدم بالتصويت له */
.poll-option-item.voted-choice {
    border-color: #007bff !important;
    background-color: rgba(0, 123, 255, 0.02);
    font-weight: bold;
}

.poll-option-item.voted-choice::before {
    content: "✓ ";
    color: #007bff;
    margin-right: 4px;
}

/* نصوص النسب المئوية */
.poll-pct-text {
    color: #495057;
    font-variant-numeric: tabular-nums; /* تضمن ثبات حجم الأرقام عند التغير */
}

.voted-choice .poll-pct-text {
    color: #007bff;
    font-weight: bold;
}

/* --- أنيميشن سلس لظهور الصندوق --- */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ==========================================================================
   تنسيقات مخصصة وجذرية لنافذة إنشاء المنشور فقط (#create-post-modal)
   لضمان عدم تأثر النوافذ الأخرى (Share / Story)
   ========================================================================== */

/* 1. ضبط المودال الأساسي ليكون مرناً وقابلاً للتمرير */
#create-post-modal {
    display: none; /* مخفي افتراضياً ويظهر بكلاس .show */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    background-color: rgba(0, 0, 0, 0.65); /* خلفية سوداء ضبابية سينمائية */
    backdrop-filter: blur(4px); /* تأثير زجاجي عصري للمتصفحات الحديثة */
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto; /* يسمح بالتمرير للشاشة كاملة إذا كبر المحتوى */
    padding: 20px;
}

/* عندما يفتح المودال ويأخذ كلاس .show */
#create-post-modal.show {
    display: flex;
    animation: fadeInBackground 0.2s ease;
}

/* 2. التحكم الشامل في حاوية المحتوى (لتصبح في السنتر تماماً وليست بعرض الشاشة كله) */
#create-post-modal .modal-content {
    background-color: #ffffff;
    width: 100%;
    max-width: 550px; /* الحجم المثالي العالمي لنوافذ النشر مثل تويتر وفيسبوك */
    margin: auto; /* يضمن التوسط العمودي والأفقي */
    max-height: calc(100vh - 40px); /* يمنع النافذة من الخروج عن حدود الشاشة */
    display: flex;
    flex-direction: column;
    border-radius: 16px; /* حواف دائرية ناعمة جداً واحترافية */
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); /* ظل عميق يبرز النافذة */
    animation: slideUpModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* أنيميشن مرن احترافي */
    overflow: hidden;
}

/* 3. ترتيب هيكل الفورم الداخلي ليكون قابل للتمرير بشكل منفصل */
#create-post-modal #create-post-form {
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* هنا السحر! إذا فتحت حقول التصويت، سيظهر سكول ناعم داخل النافذة نفسها */
    padding: 20px 25px;
    max-height: calc(100vh - 160px); 
}

/* 4. رأس النافذة (العنوان وزر الإغلاق) */
#create-post-modal .modal-header {
    padding: 15px 25px;
    border-bottom: 1px solid #edf2f7; /* خط فاصل ناعم ورمادي خفيف جداً */
    margin-bottom: 0; /* ألغينا المارجن لضبط السكول */
}

#create-post-modal .modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #1a202c;
    letter-spacing: -0.3px;
}

#create-post-modal .modal-close {
    font-size: 24px;
    color: #718096;
    background: #f7fafc;
    width: 32px;
    height: 32px;
    border-radius: 50%; /* زر إغلاق دائري عصري */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#create-post-modal .modal-close:hover {
    background: #fed7d7;
    color: #e53e3e;
}

/* 5. تحسين حقول التكست والمدخلات */
#create-post-modal .form-control {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #f8fafc;
}

#create-post-modal .form-control:focus {
    border-color: #007bff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
    outline: none;
}

/* 6. تحسين شكل أزرار رفع الميديا (الصور والفيديو) */
#create-post-modal input[type="file"] {
    border: 2px dashed #cbd5e0;
    background-color: #f7fafc;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
}

#create-post-modal input[type="file"]:hover {
    border-color: #007bff;
    background-color: #f0f7ff;
}
#create-post-modal #post_text {
    min-height: 120px; /* الارتفاع الافتراضي الأنيق في البداية */
    max-height: 250px; /* أقصى ارتفاع مسموح به للحقل لكي لا يختفي باقي الفورم */
    resize: none;      /* إلغاء مثلث السحب اليدوي المقزز في زاوية الحقل لجمالية التصميم */
    overflow-y: auto;  /* إذا تجاوز النص 250 بكسل يظهر سكول داخلي صغير جداً وناعم */
    transition: background-color 0.2s ease, border-color 0.2s ease; /* حركة ناعمة */
}
/* ==========================================================================
   الأنيميشن والتحركات السلسة
   ========================================================================== */
@keyframes fadeInBackground {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
/* ==========================================================================
   تحسينات التجاوب مع الهواتف (Mobile Responsiveness) لـ #create-post-modal
   ========================================================================== */

@media (max-width: 576px) {
    /* 1. تقليل المسافات حول المودال في الهواتف ليستغل الشاشة */
    #create-post-modal {
        padding: 8px; /* تقليل الهامش الخارجي جداً لجلب مساحة إضافية */
    }

    /* 2. جعل حاوية المحتوى تتسع لتأخذ العرض كاملاً تقريباً */
    #create-post-modal .modal-content {
        max-width: 100%; /* جعلها تمتد بكامل عرض الشاشة المتوفر */
        border-radius: 12px; /* حواف دائرية أنعم تناسب الهواتف */
        max-height: calc(100vh - 16px); /* استغلال الارتفاع الأقصى المتاح */
    }

    /* 3. توسيع الفورم الداخلي وتقليل الحواف لزيادة مساحة الكتابة */
    #create-post-modal #create-post-form {
        padding: 15px 15px; /* تقليل الـ Padding الجانبي ليتسع النص والحقول */
        max-height: calc(100vh - 120px); 
    }

    /* 4. ضبط رأس النافذة في الهاتف */
    #create-post-modal .modal-header {
        padding: 12px 15px;
    }

    #create-post-modal .modal-title {
        font-size: 17px; /* تصغير الخط قليلاً ليناسب شاشات الموبايل */
    }

    /* 5. جعل حقل النص (TextArea) يبدو واسعاً ومريحاً للكتابة الأصبعية */
    #create-post-modal .form-control {
        padding: 10px;
        font-size: 15px; /* حجم خط مثالي للكتابة من الهاتف */
    }

    /* 6. توسيع أزرار رفع الملفات وحقول التصويت */
    #create-post-modal input[type="file"] {
        padding: 12px;
    }

    #poll-fields-container {
        padding: 12px; /* مساحة داخلية متسعة ومريحة لحقول التصويت في الموبايل */
    }
    #create-post-modal .post-toolbar {
        flex-direction: column; /* جعل الكلمة والأيقونات تحت بعضهما في الموبايل */
        align-items: flex-start !important; /* محاذاة العناصر لليسار أو اليمين بشكل متناسق */
        gap: 12px; /* ترك مسافة مريحة بين السطرين */
        padding: 12px 5px !important;
    }
    
    #create-post-modal .post-toolbar div {
        width: 100%;
        justify-content: flex-end; /* جعل الأيقونات تذهب لأقصى اليمين/اليسار لتوازن المظهر */
        gap: 25px !important; /* زيادة المسافة بين الأيقونات في الهاتف لمنع النقرات الخاطئة */
    }
}
