/*
    مصدر واحد لتنسيق قائمة الإشعارات وشريط التنقل السفلي، يُحمَّل في كل الصفحات
    (بما فيها الصفحات المستقلة التي تستخدم Layout = null ولا تقرأ تنسيقات _Layout).
    وجوده كملف مشترك يمنع تكرار نفس القواعد في أربع صفحات مختلفة.
*/

/* ===== شارة عدد الإشعارات غير المقروءة ===== */
.notification-badge-count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    background-color: #ef4444;
    color: #ffffff;
    border: 2px solid #ffffff;
    line-height: 1.1;
    text-align: center;
}

/* ===== قائمة الإشعارات — نمط فيسبوك على الديسكتوب ===== */
.notifications-dropdown-menu {
    width: 360px !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 480px !important;
    padding: 0 !important;
    border-radius: 16px !important;
    border: 1px solid #eee8e0 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16) !important;
    background-color: #ffffff !important;
    z-index: 2000 !important;
    /* التخطيط عمودي: رأس ثابت + قائمة تتمرر بذاتها */
    display: none;
    flex-direction: column;
    overflow: hidden !important;
}

    .notifications-dropdown-menu.show {
        display: flex !important;
    }

/* رأس القائمة (ثابت لا يتمرر) */
.notifications-panel-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f0ece6;
    background: #ffffff;
}

    .notifications-panel-header .notifications-panel-title {
        font-weight: 800;
        font-size: 1.05rem;
        color: #1f1f1f;
    }

/* ===== شريط تبويبات الإشعارات (ثابت بين الرأس والقائمة، لا يتمرر) ===== */
.notifications-tabs {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f0ece6;
    background: #fdfbf8;
    overflow-x: auto;
    scrollbar-width: none;
}

    .notifications-tabs::-webkit-scrollbar {
        display: none;
    }

.notifications-tab {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    border: 1px solid transparent;
    background: transparent;
    color: #7a7069;
    font-weight: 700;
    font-size: 0.74rem;
    line-height: 1.2;
    border-radius: 999px;
    padding: 0.35rem 0.5rem;
    transition: all 0.18s ease;
}

    .notifications-tab i {
        font-size: 0.85rem;
    }

    .notifications-tab:hover {
        background: #f5efe6;
        color: var(--primary-brown, #9e7943);
    }

    .notifications-tab.is-active {
        background: var(--primary-brown, #9e7943);
        border-color: var(--primary-brown, #9e7943);
        color: #ffffff;
    }

.notifications-tab-count {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    border-radius: 999px;
    padding: 0.12rem 0.32rem;
    flex-shrink: 0;
}

.notifications-tab.is-active .notifications-tab-count {
    background: #ffffff;
    color: var(--primary-brown, #9e7943);
}

/* لوحة كل تبويب: المخفية لا تُعرض إطلاقاً فلا تُسهم في ارتفاع التمرير */
.notifications-tab-panel {
    display: none;
}

    .notifications-tab-panel.is-active {
        display: block;
    }

/* جسم القائمة — هو وحده الذي يتمرر */
.notifications-dropdown-menu .notification-list {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none !important;
    padding: 0.35rem;
}

.notification-item {
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    transition: background 0.2s ease;
    white-space: normal !important;
}

    .notification-item:hover {
        background: #fbf9f6;
    }

/*
    أحجام محتوى الإشعار. كانت مكتوبة inline على العناصر في _NotificationsDropdown.cshtml،
    فنُقلت إلى فئات صريحة بنفس القيم بالضبط (لا تغيير في مظهر الديسكتوب) حتى يتمكّن
    mobile-typography.css من تكبيرها على الهاتف — لا شيء يتغلّب على style="" غير !important.
*/
.notification-title {
    font-size: 0.85rem;
}

.notification-time {
    font-size: 0.68rem;
    color: var(--primary-brown, #9e7943) !important;
}

.notification-text {
    font-size: 0.75rem;
}

.notification-count-badge {
    font-size: 0.7rem;
}

/*
    تذييل الصفحة المشترك بين _Layout و Pages/Index و Pages/Properties/Index —
    نُقل الحجم من style="" إلى هذه الفئة لنفس السبب أعلاه.
*/
.site-footer-note {
    font-size: 0.72rem;
}

/* ===== الموبايل: القائمة تملأ الشاشة لكن محصورة بين الهيدر والشريط السفلي ===== */
@media (max-width: 991px) {
    .notifications-dropdown-menu {
        /* إلغاء تموضع Popper بالكامل حتى تُحترم القيم الثابتة أدناه */
        position: fixed !important;
        inset: auto !important;
        top: var(--notif-panel-top, 68px) !important;
        bottom: var(--notif-panel-bottom, 68px) !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        transform: none !important;
        border-radius: 18px !important;
    }

    .notifications-panel-header .notifications-panel-title {
        font-size: 1.15rem;
    }

    .notification-item {
        padding: 0.75rem 0.85rem;
    }

    /* على الموبايل تتسع المساحة قليلاً فيكبر التبويب ويبقى النص ظاهراً */
    .notifications-tabs {
        padding: 0.5rem 0.55rem;
        gap: 5px;
    }

    .notifications-tab {
        font-size: 0.78rem;
        padding: 0.42rem 0.55rem;
    }
}

/*
    حارس التجاوز الأفقي (الذي يحمي ثبات هذا الشريط) انتقل إلى ملف مستقل:
        wwwroot/css/mobile-layout-guard.css
    لا تُعِد كتابته هنا — مصدر واحد فقط. الملف يشرح السبب الجذري بالتفصيل،
    ويُربط في _Layout.cshtml وفي كل صفحة تضع Layout = null.
*/

/* ===== شريط التنقل السفلي — ثابت دائماً في كل الصفحات ===== */
.mobile-bottom-taskbar {
    display: none;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    height: 60px;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
    z-index: 1050;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.5rem;
    overflow: visible !important;
}

.mobile-taskbar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex: 1;
    color: #71717a;
    text-decoration: none;
    border: none;
    background: transparent;
    padding: 0;
    transition: color 0.2s ease;
    position: relative;
}

    .mobile-taskbar-item i {
        font-size: 1.45rem;
    }

    .mobile-taskbar-item.active,
    .mobile-taskbar-item:hover {
        color: var(--primary-brown, #9e7943);
    }

.mobile-taskbar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-brown, #9e7943);
}

@media (max-width: 991px) {
    .mobile-bottom-taskbar {
        display: flex !important;
    }

    /* مساحة سفلية حتى لا يغطي الشريط الثابت آخر محتوى الصفحة */
    body.has-mobile-taskbar {
        padding-bottom: 76px !important;
    }
}

/* لا يظهر شريط التنقل ولا قائمة الإشعارات عند الطباعة (صفحة التقارير قابلة للطباعة) */
@media print {
    .mobile-bottom-taskbar,
    .notifications-dropdown-menu {
        display: none !important;
    }

    body.has-mobile-taskbar {
        padding-bottom: 0 !important;
    }
}
