/* شريط التنقل السفلي للهاتف المحمول */
.mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 99999 !important;
    display: none;
    /* مخفي افتراضياً، سيظهر فقط على الهاتف */
    padding: 8px 0 max(8px, env(safe-area-inset-bottom)) 0;
    height: auto;
    min-height: 70px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.mobile-nav-container {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    height: 100%;
    padding: 0 15px;
    position: relative;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    padding: 6px 4px;
    border-radius: 12px;
    min-width: 50px;
    position: relative;
    flex: 1;
    max-width: 65px;
    text-align: center;
}

.mobile-nav-item:hover {
    color: #7d193d;
    text-decoration: none;
}

.mobile-nav-item.active {
    color: #7d193d;
}

.mobile-nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.mobile-nav-item span {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
}

/* زر الإضافة المميز */
.mobile-nav-item.add-btn {
    background: linear-gradient(135deg, #7d193d, #e55683);
    color: white !important;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    margin-top: -15px;
    box-shadow: 0 4px 15px rgba(165, 26, 69, 0.4);
    border: 2px solid #ffffff;
    position: relative;
    z-index: 10;
    flex: 0 0 auto;
    min-width: 56px;
    max-width: 56px;
}

.mobile-nav-item.add-btn:hover {
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(165, 26, 69, 0.5);
    text-decoration: none;
}

.mobile-nav-item.add-btn i {
    font-size: 24px;
    margin-bottom: 0;
    font-weight: bold;
}

.mobile-nav-item.add-btn span {
    display: none;
}

/* النافذة المنبثقة لزر الإضافة */
.add-options-modal {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10510000 !important;
    display: none;
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
}

.add-options-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    position: relative;
    width: 92%;
    max-width: 560px;
    box-shadow: 0 20px 40px rgba(0,0,0,.18);
    border: 1px solid #e2e8f0;
    transform: scale(0.96);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
}

.add-options-modal.show .add-options-content {
    transform: scale(1);
    opacity: 1;
}

.add-options-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.add-options-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close-modal {
    position: absolute;
    top: -5px;
    right: 0;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

.add-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.add-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.add-option:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    text-decoration: none;
    color: #7d193d;
}

.add-option i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #7d193d;
}

.add-option span {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

/* تأثيرات الحركة */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* استجابة للهاتف المحمول */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block !important;
    }

    /* إضافة مساحة سفلية للمحتوى لتجنب تداخل الشريط */
    body {
        padding-bottom: 85px !important;
    }
}

/* تحسينات إضافية للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .mobile-bottom-nav {
        min-height: 65px;
        padding: 6px 0 max(6px, env(safe-area-inset-bottom)) 0;
    }

    .mobile-nav-container {
        padding: 0 10px;
    }

    .mobile-nav-item {
        min-width: 45px;
        max-width: 60px;
        padding: 4px 2px;
    }

    .mobile-nav-item span {
        font-size: 9px;
    }

    .mobile-nav-item i {
        font-size: 18px;
    }

    .mobile-nav-item.add-btn {
        width: 50px;
        height: 50px;
        margin-top: -12px;
        min-width: 50px;
        max-width: 50px;
    }

    .mobile-nav-item.add-btn i {
        font-size: 22px;
    }

    .add-options-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .add-option {
        padding: 12px 8px;
    }

    .add-option i {
        font-size: 20px;
    }

    .add-option span {
        font-size: 11px;
    }

    body {
        padding-bottom: 75px !important;
    }
}

/* تأثير النقر */
.mobile-nav-item:active {
    transform: scale(0.95);
}

.add-option:active {
    transform: scale(0.95);
}

/* إخفاء الشريط عند الطباعة */
@media print {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* تحسينات إضافية للثبات */
.mobile-bottom-nav {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* منع التمرير الأفقي */
.mobile-nav-container {
    /* overflow-x: hidden; */
}

/* تحسين الأداء */
.mobile-nav-item,
.mobile-nav-item.add-btn {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* إصلاح مشاكل iOS Safari */
@supports (-webkit-touch-callout: none) {
    .mobile-bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}
