/* ========================================
   MOBILE NAVIGATION - PUIUX
   Navigation محسّن للموبايل - FIXED VERSION
   ======================================== */

/* ========================================
   MOBILE HEADER - يعمل على جميع الأحجام
   ======================================== */

.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #000;
    padding: 12px 16px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.mobile-header .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.mobile-header .logo svg {
    width: 40px;
    height: 40px;
}

.mobile-header .logo img {
    height: 42px;
    width: auto;
    filter: invert(1);
}

.mobile-header .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-header .whatsapp-btn {
    background: #25D366;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.mobile-header .whatsapp-btn:active {
    transform: scale(0.95);
}

.mobile-header .whatsapp-btn svg {
    width: 24px;
    height: 24px;
}

.mobile-header .menu-btn {
    background: transparent;
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
}

.mobile-header .menu-btn span {
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-header .menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-header .menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-header .menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-content {
    padding-top: 60px;
    padding-bottom: 80px;
}

/* ========================================
   BOTTOM NAVIGATION BAR
   ======================================== */

.bottom-nav {
    position: fixed;
    top: unset;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    display: none; /* مخفي افتراضياً */
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    padding: 0 8px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    text-decoration: none;
    color: #e9e9e9;
    min-width: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    position: relative;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bottom-nav-item .icon svg {
    width: 100%;
    height: 100%;
}

.bottom-nav-item .label {
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.bottom-nav-item.active {
    color: #25D366;
}

.bottom-nav-item.active .icon {
    transform: translateY(-2px);
}

.bottom-nav-item.home.active {
    color: #667eea;
}

.bottom-nav-item.phone.active {
    color: #3b82f6;
}

.bottom-nav-item.whatsapp.active {
    color: #25D366;
}

.bottom-nav-item.email.active {
    color: #ef4444;
}

.bottom-nav-item.portfolio.active {
    color: #f59e0b;
}

.bottom-nav-item.whatsapp {
    background: #25D366;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.bottom-nav-item.whatsapp .icon svg {
    filter: brightness(0) invert(1);
}

.bottom-nav-item.whatsapp:active {
    background: #20bd5a;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

.bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.bottom-nav-item:active::before {
    width: 100px;
    height: 100px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* MOBILE ONLY (تحت 768px) */
@media (max-width: 767px) {
    /* إظهار mobile-header */
    .mobile-header {
        display: flex !important;
    }
    
    /* إظهار bottom-nav وإصلاح الموضع */
    .bottom-nav {
        display: block !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 999 !important;
        animation: slideUp 0.4s ease-out;
        transform: translateZ(0);
        will-change: transform;
        background: rgb(0 0 0 / 10%);
        backdrop-filter: blur(10px);
    }
    
    .bottom-nav-item.active .icon {
        animation: bounce 0.5s ease;
    }
    
    /* إخفاء navbar العادي */
    .navbar {
        display: none !important;
    }
    
    /* إضافة مساحة للمحتوى */
    body {
        padding-top: 60px !important;
        padding-bottom: 80px !important;
    }
    
    main {
        padding-bottom: 80px !important;
    }
    
    /* منع تداخل المحتوى */
    .hero,
    section {
        margin-bottom: 20px !important;
    }
    
    /* إخفاء أيقونات إضافية */
    .mobile-header .phone-icon,
    .mobile-header .email-icon {
        display: none !important;
    }
}

/* TABLET (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .mobile-header {
        display: none !important;
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    .navbar {
        display: block !important;
    }
    
    .mobile-content {
        padding-bottom: 20px;
    }
}

/* DESKTOP (فوق 1024px) */
@media (min-width: 1025px) {
    .mobile-header {
        display: none !important;
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    .navbar {
        display: block !important;
    }
    
    .mobile-content {
        padding-bottom: 20px;
    }
}

/* ========================================
   DARK MODE
   ======================================== */

@media (prefers-color-scheme: dark) {
    .bottom-nav {
        background: #1f2937;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }

    .bottom-nav-item {
        color: #9ca3af;
    }

    .bottom-nav-item.active {
        color: #25D366;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.bottom-nav-item:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .bottom-nav-item,
    .bottom-nav-item .icon,
    .bottom-nav {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================================
   PRINT
   ======================================== */

@media print {
    .mobile-header,
    .bottom-nav {
        display: none !important;
    }
    
    .mobile-content {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}
