/* ============================================
   متغيرات اللون
   ============================================ */
:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-lighter: #818cf8;
    --primary-dark: #4338ca;
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --dark: #111827;
    --dark-light: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
}

/* ============================================
   تنسيق شريط التنقل السفلي
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;

    /* خلفية زجاجية */
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);

    /* التخطيط */
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;

    /* الحدود */
    border-radius: 24px 24px 0 0;
    padding: 0 16px;

    /* التحريك */
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   عناصر التنقل الفردية
   ============================================ */
.nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    padding: 12px;
    position: relative;
    height: 64px;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item:hover {
    color: var(--primary-light);
    transform: translateY(-3px);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    opacity: 1;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    animation: expandWidth 0.3s ease-out;
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 32px;
    }
}

/* ============================================
   أيقونات التنقل
   ============================================ */
.nav-icon {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: transparent;
    position: relative;
    z-index: 1;
}

.nav-item:hover .nav-icon {
    background: rgba(79, 70, 229, 0.1);
    transform: scale(1.05);
}

.nav-item.active .nav-icon {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary);
}

.nav-icon i {
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-icon i {
    transform: scale(1.1);
}

.nav-item.active .nav-icon i {
    animation: bounceIcon 0.4s ease;
}

@keyframes bounceIcon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ============================================
   نصوص التنقل
   ============================================ */
.nav-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    text-transform: capitalize;
    position: absolute;
    bottom: 8px;
    opacity: 0;
    transform: translateY(5px);
}

.nav-item:hover .nav-label,
.nav-item.active .nav-label {
    opacity: 1;
    transform: translateY(0);
}

.nav-item.active .nav-label {
    font-weight: 600;
    color: var(--primary);
}

/* ============================================
   تأثيرات إضافية
   ============================================ */
.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: radial-gradient(circle at 30% 30%, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.nav-item:hover::after {
    opacity: 1;
}

/* ============================================
   استجابة الشاشات الصغيرة
   ============================================ */
@media (max-width: 640px) {
    .bottom-nav {
        height: 70px;
        padding: 0 8px;
    }

    .nav-item {
        padding: 8px;
        height: 56px;
    }

    .nav-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .nav-label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .bottom-nav {
        height: 64px;
        border-radius: 20px 20px 0 0;
    }

    .nav-item {
        padding: 6px;
        height: 52px;
    }

    .nav-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .nav-label {
        font-size: 9px;
    }
}

/* ============================================
   دعم الوضع الداكن
   ============================================ */
@media (prefers-color-scheme: dark) {
    .bottom-nav {
        background: rgba(17, 24, 39, 0.9);
        border-top-color: rgba(255, 255, 255, 0.05);
    }
}

/* ============================================
   تحسين الأداء والسلاسة
   ============================================ */
.bottom-nav,
.nav-item,
.nav-icon,
.nav-label {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    will-change: transform;
}

/* تقليل المسافة من الأسفل للمحتوى */
body {
    padding-bottom: 80px;
}

@media (max-width: 640px) {
    body {
        padding-bottom: 70px;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 64px;
    }
}
