/* Mobile Optimizations CSS */
/* تحسينات الجوال للموقع */

:root {
    --mobile-menu-height: 100vh;
    --mobile-padding: 20px;
    --mobile-font-base: 16px;
}

/* إخفاء قائمة الجوال على شاشات الديسكتوب - مهم جداً */
@media (min-width: 769px) {
    .mobile-nav,
    .mobile-overlay {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* تحسينات الأداء */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* تسريع الرندرينج */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

/* قائمة الجوال المحسنة */
@media (max-width: 768px) {
    /* القائمة المخفية */
    .mobile-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
        z-index: 2000;
        transition: right 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-nav.active {
        right: 0;
    }

    /* خلفية داكنة عند فتح القائمة */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        display: none;
        transition: opacity 0.3s ease;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* محتوى القائمة */
    .mobile-nav-content {
        padding: 80px 30px 30px;
    }

    .mobile-nav-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 20px 30px;
        background: var(--primary-dark);
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-nav-close {
        width: 35px;
        height: 35px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .mobile-nav-close:hover {
        background: var(--accent-gold);
        transform: rotate(90deg);
    }

    .mobile-nav-menu {
        list-style: none;
        padding: 0;
        margin: 30px 0;
    }

    .mobile-nav-menu li {
        margin-bottom: 5px;
    }

    .mobile-nav-menu a {
        display: block;
        padding: 15px 20px;
        color: var(--text-primary);
        text-decoration: none;
        font-size: 18px;
        font-weight: 500;
        border-radius: 10px;
        transition: all 0.3s ease;
        position: relative;
    }

    .mobile-nav-menu a:active {
        transform: scale(0.98);
        background: var(--bg-light);
    }

    .mobile-nav-menu a::after {
        content: '←';
        position: absolute;
        left: 20px;
        opacity: 0;
        transition: all 0.3s ease;
    }

    .mobile-nav-menu a:hover::after {
        left: 10px;
        opacity: 1;
    }

    /* تصميم الأزرار في القائمة المتنقلة - محسّن */
    .mobile-nav-buttons {
        margin-top: 30px;
        padding-top: 20px;
        border-top: 2px solid #f0f0f0;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .mobile-nav-buttons .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 16px 20px;
        text-align: center;
        font-size: 16px;
        font-weight: 600;
        text-decoration: none;
        border-radius: 10px;
        transition: all 0.3s ease;
        border: 2px solid transparent;
        font-family: 'Tajawal', sans-serif;
        cursor: pointer;
    }

    /* زر تسجيل الدخول - outline */
    .mobile-nav-buttons .btn-outline {
        background: transparent;
        color: #1a1a1a;
        border: 2px solid #1a1a1a;
    }

    .mobile-nav-buttons .btn-outline:hover,
    .mobile-nav-buttons .btn-outline:active {
        background: #1a1a1a;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    /* زر ابدأ الآن - primary */
    .mobile-nav-buttons .btn-primary {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        color: white;
        border: 2px solid #1a1a1a;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .mobile-nav-buttons .btn-primary:hover,
    .mobile-nav-buttons .btn-primary:active {
        background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    }

    .mobile-nav-buttons .btn i {
        margin-left: 8px;
        font-size: 18px;
    }

    /* تحسين زر القائمة */
    .menu-toggle {
        display: flex;
        width: 45px;
        height: 45px;
        padding: 10px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
        z-index: 2001;
    }

    .menu-toggle span {
        position: absolute;
        width: 25px;
        height: 3px;
        background: var(--primary-dark);
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    .menu-toggle span:nth-child(1) {
        transform: translateY(-8px);
    }

    .menu-toggle span:nth-child(3) {
        transform: translateY(8px);
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg);
    }

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

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg);
    }

    /* تحسينات الهيدر للجوال */
    .header {
        height: 70px;
    }

    .nav-container {
        height: 70px;
        padding: 0 15px;
    }

    .logo-image {
        height: 38px !important;
    }

    .logo-divider {
        height: 32px !important;
    }

    .nav-menu,
    .cta-buttons {
        display: none !important;
    }

    /* تحسينات النصوص والأزرار */
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 32px !important;
        line-height: 1.3 !important;
    }

    h2 {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }

    h3 {
        font-size: 22px !important;
    }

    p {
        font-size: 16px !important;
        line-height: 1.7 !important;
    }

    /* أزرار صديقة للمس */
    .btn, button, a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn {
        padding: 14px 28px !important;
        font-size: 16px !important;
    }

    /* تحسينات الصفحة الرئيسية */
    .hero {
        margin-top: 70px;
        padding: 40px 15px;
        min-height: auto;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-content h1 {
        font-size: 36px !important;
    }

    .hero-content p {
        font-size: 17px !important;
        margin-bottom: 30px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .hero-buttons .btn {
        width: 100%;
        padding: 16px !important;
    }

    .hero-image {
        margin-top: 20px;
    }

    .hero-image img {
        border-radius: 12px;
    }

    /* تحسينات الإحصائيات */
    .stats {
        padding: 60px 15px;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .stat-item i {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .stat-number {
        font-size: 36px !important;
    }

    .stat-label {
        font-size: 15px !important;
    }

    /* تحسينات الفوتر */
    .footer {
        padding: 60px 15px 30px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-about h3 {
        font-size: 24px !important;
    }

    .footer-links h4 {
        font-size: 18px !important;
        margin-bottom: 15px;
    }

    .footer-links ul {
        margin-bottom: 25px;
    }

    .footer-links li {
        margin-bottom: 10px;
    }

    .footer-social {
        margin-top: 20px;
    }

    /* تحسينات الصفحات الداخلية */
    .page-header {
        margin-top: 70px;
        padding: 80px 15px 50px;
    }

    .page-header h1 {
        font-size: 32px !important;
    }

    .page-header p {
        font-size: 17px !important;
    }

    /* تحسينات البطاقات */
    .service-card,
    .feature-card,
    .value-card,
    .pricing-card,
    .info-card {
        padding: 30px 20px !important;
        margin-bottom: 20px;
    }

    /* تحسينات النماذج */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px !important;
        padding: 14px 16px !important;
    }

    .btn-submit {
        font-size: 17px !important;
        padding: 16px !important;
    }

    /* تحسينات FAQ */
    .faq-question {
        padding: 20px !important;
    }

    .faq-question h3 {
        font-size: 17px !important;
    }

    .faq-answer {
        padding: 15px 20px 20px !important;
    }

    /* تحسينات التمرير */
    section {
        overflow-x: hidden;
    }

    /* إزالة الأنيميشنز الثقيلة على الجوال */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes fadeInRight {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* تحسين سرعة الانتقالات */
    * {
        transition-duration: 0.2s !important;
    }

    /* إلغاء الصور الخلفية الثقيلة */
    .hero::before,
    .page-header::before,
    .cta-section::before {
        display: none !important;
    }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 380px) {
    .logo-text {
        display: none !important;
    }
    
    .hero-content h1 {
        font-size: 28px !important;
    }
    
    .stat-number {
        font-size: 28px !important;
    }
    
    .btn {
        font-size: 15px !important;
        padding: 12px 20px !important;
    }
}

/* تحسين أداء الصور */
img {
    loading: lazy;
    will-change: transform;
}

/* تحسينات الأداء العامة */
.header,
.nav-container,
.hero,
.stats,
.footer {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* منع التكبير غير المرغوب */
input,
select,
textarea {
    font-size: 16px !important;
}
