/* CSS محسن خصيصاً للجوال - إصلاح خاص للآيفون */

/* إصلاح فوري للشاشة البيضاء على الآيفون */
html, body {
    background: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* إصلاحات خاصة للآيفون */
@supports (-webkit-touch-callout: none) {
    html, body {
        -webkit-transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        -webkit-perspective: 1000;
        -webkit-overflow-scrolling: touch;
    }
}

/* تحسينات عامة للأداء - منع الشاشة البيضاء خاصة للآيفون */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    min-height: 100vh;
    background-color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    /* إصلاحات خاصة للآيفون */
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    background-color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    /* إصلاحات خاصة للآيفون */
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000;
    -webkit-overflow-scrolling: touch;
}

/* تحسينات للجوال فقط */
@media (max-width: 768px) {
    
    /* منع الشاشة البيضاء */
    html, body {
        background-color: #ffffff !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
    }
    
    /* استخدام صورة عالية الجودة حتى للجوال - بدون ضغط */
    .hero {
        background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('../images/building-logo.jpg') !important;
        background-color: #1e3a8a !important;
        background-size: cover !important;
        background-position: center !important;
        background-attachment: scroll !important;
        background-repeat: no-repeat !important;
        /* تحسينات إضافية للوضوح */
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: crisp-edges !important;
    }
    
    /* إزالة جميع الانيميشن المعقدة */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* تحسين الهيدر للجوال */
    .header {
        padding: 5px 0 !important;
        height: auto !important;
        min-height: 60px !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }
    
    .header-logo {
        height: 50px !important;
        width: auto !important;
        max-width: 200px !important;
    }
    
    /* تحسين الهيرو للجوال */
    .hero {
        height: 60vh !important;
        background-attachment: scroll !important;
        background-size: cover !important;
        padding: 1rem !important;
        margin-top: 60px !important;
    }
    
    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
    }
    
    /* تحسين التنقل للجوال */
    .side-nav {
        left: 10px !important;
        bottom: 20px !important;
        top: auto !important;
        transform: none !important;
        padding: 8px !important;
        border-radius: 10px !important;
    }
    
    .side-menu {
        flex-direction: row !important;
        gap: 5px !important;
        flex-wrap: wrap !important;
    }
    
    .nav-text {
        min-width: 50px !important;
        font-size: 0.7rem !important;
        padding: 6px 8px !important;
        margin: 0 !important;
        border-radius: 8px !important;
    }
    
    /* تحسين الأقسام للجوال */
    section {
        padding: 2rem 1rem !important;
    }
    
    .section-header h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* تحسين السلايدر للجوال */
    .slider-container {
        height: 300px !important;
        margin: 1rem 0 !important;
    }
    
    .slide {
        padding: 1rem !important;
        text-align: center !important;
    }
    
    .slide-circle {
        width: 120px !important;
        height: 120px !important;
        margin: 0 auto 1rem !important;
    }
    
    .slide-circle img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .slide h3 {
        font-size: 1.1rem !important;
        margin: 0.5rem 0 !important;
    }
    
    .slide p {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
    
    /* تحسين قسم العملاء للجوال */
    .clients-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        padding: 1rem !important;
    }
    
    .client-item {
        padding: 0.5rem !important;
        border-radius: 8px !important;
    }
    
    .client-item img {
        max-width: 100px !important;
        height: 60px !important;
        object-fit: contain !important;
    }
    
    /* تحسين نموذج الاتصال للجوال */
    .contact-form {
        padding: 1rem !important;
    }
    
    .contact-form input,
    .contact-form textarea {
        font-size: 16px !important; /* منع التكبير في iOS */
        padding: 0.8rem !important;
        margin-bottom: 1rem !important;
    }
    
    .contact-form button {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
    }
    
    /* إخفاء العناصر غير المهمة للجوال */
    .scroll-progress {
        display: none !important;
    }
    
    /* تحسين الخطوط للجوال */
    body {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.2 !important;
    }
    
    /* تحسين الأزرار للجوال */
    .btn {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.9rem !important;
        border-radius: 6px !important;
    }
    
    /* تحسين الصور للجوال */
    img {
        max-width: 100% !important;
        height: auto !important;
        loading: lazy !important;
    }
    
    /* تحسين الجداول للجوال */
    table {
        font-size: 0.8rem !important;
    }
    
    /* تحسين النصوص للجوال */
    p {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1rem !important;
    }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .hero {
        height: 60vh !important;
        padding: 0.5rem !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.8rem !important;
    }
    
    .sidebar {
        width: 180px !important;
    }
    
    .clients-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .client-item img {
        max-width: 40px !important;
    }
}

/* تحسين الأداء العام */
.hero {
    will-change: auto !important;
}

.slide {
    will-change: auto !important;
}

/* تحسين التمرير */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
