/* =========================================
   تحسينات الاستجابة للموبايل - Mobile Responsive
   Creative PS - تم إعادة كتابة الملف بالكامل
========================================= */

/* =========================================
   شاشات كبيرة جداً (أقل من 1400px)
========================================= */
@media (max-width: 1400px) {
    .container {
        max-width: 100%;
        padding: 0 24px;
    }
}

/* =========================================
   شاشات متوسطة-كبيرة (أقل من 1200px)
========================================= */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 32px;
    }

    .hero-title {
        font-size: clamp(28px, 5vw, 48px) !important;
    }

    .title-line {
        font-size: 36px !important;
    }

    .section-title {
        font-size: 42px !important;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 48px !important;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 32px !important;
    }
}

/* =========================================
   تابلت عمودي (أقل من 992px)
========================================= */
@media (max-width: 992px) {
    .hero .container {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
        text-align: center;
    }

    .hero-content {
        order: 1;
    }

    .hero-visual {
        order: 2;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    .about-content {
        grid-template-columns: 1fr !important;
        gap: 48px !important;
    }

    .mission-vision-cards {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }

    .contact-wrapper {
        grid-template-columns: 1fr !important;
        gap: 48px !important;
        padding: 32px !important;
    }

    .advanced-contact-form .form-row {
        grid-template-columns: 1fr !important;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .testimonials-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    /* تقليل الpadding للأقسام */
    .hero {
        padding: 140px 0 80px !important;
    }

    .about-section,
    .services-section,
    .projects-section,
    .testimonials-section,
    .blog-section,
    .contact-section,
    .partners-section {
        padding: 80px 0 !important;
    }

    /* Dashboard preview أصغر */
    .dashboard-preview {
        transform: scale(0.85);
    }

    .hero-visual {
        max-width: 500px;
        margin: 0 auto;
    }
}

/* =========================================
   تابلت صغير / موبايل كبير (أقل من 768px)
========================================= */
@media (max-width: 768px) {
    :root {
        --section-py: 64px !important;
        --section-header-mb: 36px !important;
        --grid-gap: 16px !important;
    }

    .container {
        padding: 0 20px !important;
    }

    /* ===== Header ===== */
    .header {
        padding: 12px 0 !important;
    }

    .language-bar {
        padding: 8px 0 !important;
    }

    .language-bar .container {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: center !important;
    }

    .top-contact-info {
        display: none !important;
    }

    /* تحسين القائمة الجانبية للموبايل */
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 85% !important;
        max-width: 360px !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: rgba(2, 6, 23, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        flex-direction: column !important;
        padding: 80px 24px 32px !important;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
        z-index: 1002 !important;
        overflow-y: auto !important;
        gap: 4px !important;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5) !important;
    }

    body.light-theme .nav-menu {
        background: rgba(255, 255, 255, 0.98) !important;
        border-left: 1px solid var(--day-border) !important;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1) !important;
    }

    .nav-menu.active {
        right: 0 !important;
    }

    /* Overlay خلف القائمة */
    .nav-menu.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: -100vw;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    .nav-link {
        padding: 14px 16px !important;
        font-size: 16px !important;
        width: 100% !important;
        border-radius: 12px !important;
    }

    .hamburger {
        display: flex !important;
        z-index: 1003 !important;
    }

    /* تحسين dropdown للموبايل */
    .dropdown-content {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 0 0 0 16px !important;
        min-width: auto !important;
        display: none !important;
        backdrop-filter: none !important;
    }

    .dropdown.active .dropdown-content,
    .dropdown:hover .dropdown-content {
        display: block !important;
    }

    .dropdown-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    .dropdown-column h4 {
        margin-top: 12px !important;
        margin-bottom: 8px !important;
        font-size: 12px !important;
    }

    .dropdown-item {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }

    /* تحسين الشعار للموبايل */
    .logo-icon--img {
        width: 44px !important;
        height: 44px !important;
    }

    .logo-icon--img .logo-img {
        width: 44px !important;
        height: 44px !important;
    }

    .logo-text {
        font-size: 24px !important;
    }

    .nav-actions {
        gap: 12px !important;
    }

    .nav-actions .btn {
        padding: 10px 18px !important;
        font-size: 14px !important;
    }

    /* ===== Hero Section ===== */
    .hero {
        padding: 120px 0 60px !important;
        min-height: auto !important;
    }

    .hero-title {
        font-size: 32px !important;
    }

    .title-line {
        font-size: 26px !important;
    }

    .hero-description {
        font-size: 16px !important;
        line-height: 1.7 !important;
    }

    .hero-badge {
        font-size: 12px !important;
        padding: 8px 16px !important;
    }

    /* إخفاء العناصر العائمة على الموبايل لتوفير الأداء */
    .floating-elements {
        display: none !important;
    }

    /* إخفاء Dashboard preview على الموبايل */
    .hero-visual {
        display: none !important;
    }

    .hero-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .hero-actions .btn {
        justify-content: center !important;
    }

    .hero-actions .btn-lg {
        padding: 14px 24px !important;
        font-size: 16px !important;
    }

    /* Scroll indicator مخفي على الموبايل */
    .scroll-indicator {
        display: none !important;
    }

    /* ===== About Section ===== */
    .about-section {
        padding: 60px 0 !important;
    }

    .mission-vision-cards {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .mission-card, .vision-card {
        padding: 24px !important;
    }

    .about-details .timeline {
        padding-right: 20px !important;
    }

    .timeline-item {
        padding-right: 30px !important;
    }

    .timeline-year {
        font-size: 14px !important;
        padding: 4px 12px !important;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
    }

    .feature-item {
        padding: 16px !important;
        text-align: center !important;
    }

    .feature-item i {
        font-size: 24px !important;
    }

    .feature-item h4 {
        font-size: 14px !important;
    }

    /* ===== Services Section ===== */
    .services-section {
        padding: 60px 0 !important;
    }

    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .service-card {
        padding: 24px !important;
    }

    .service-features {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .service-features span {
        font-size: 12px !important;
        padding: 4px 10px !important;
    }

    /* ===== Projects Section ===== */
    .projects-section {
        padding: 60px 0 !important;
    }

    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .projects-filter {
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
    }

    .filter-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }

    /* ===== Testimonials ===== */
    .testimonials-section {
        padding: 60px 0 !important;
    }

    .testimonials-track {
        gap: 16px !important;
    }

    .testimonial-card {
        min-width: 280px !important;
        padding: 24px !important;
    }

    .testimonials-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    /* ===== Blog ===== */
    .blog-section {
        padding: 60px 0 !important;
    }

    .blog-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .blog-image {
        height: 180px !important;
    }

    /* ===== Partners ===== */
    .partners-slider {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 20px !important;
    }

    .partner-logo {
        width: 80px !important;
        height: 80px !important;
    }

    /* ===== Contact ===== */
    .contact-section {
        padding: 60px 0 !important;
    }

    .contact-wrapper {
        padding: 24px 16px !important;
    }

    .contact-info {
        padding: 24px !important;
    }

    .contact-form-container {
        padding: 24px !important;
    }

    .social-icons {
        flex-wrap: wrap !important;
    }

    /* ===== Footer ===== */
    .footer {
        padding: 48px 0 24px !important;
    }

    .footer-links {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        gap: 12px !important;
        text-align: center !important;
    }

    .footer-newsletter {
        margin-top: 16px !important;
    }

    .newsletter-form {
        flex-direction: column !important;
    }

    .newsletter-form input {
        width: 100% !important;
    }

    /* ===== Chat Widget ===== */
    .chat-toggle {
        bottom: 16px !important;
        right: 16px !important;
        width: 48px !important;
        height: 48px !important;
    }

    .chat-widget {
        right: 8px !important;
        bottom: 76px !important;
        width: calc(100vw - 16px) !important;
        max-height: 70vh !important;
    }

    /* WhatsApp float */
    .float-whatsapp {
        bottom: 16px !important;
        left: 16px !important;
        width: 48px !important;
        height: 48px !important;
        font-size: 22px !important;
    }

    .scroll-top {
        bottom: 76px !important;
        right: 16px !important;
        width: 40px !important;
        height: 40px !important;
    }

    /* ===== Buttons - أصغر على الموبايل ===== */
    .btn {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }

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

    /* ===== CTA Section ===== */
    .services-cta {
        flex-direction: column !important;
        text-align: center !important;
        padding: 32px 20px !important;
    }

    .services-cta .cta-content {
        margin-bottom: 16px !important;
    }

    .services-cta .cta-actions {
        flex-direction: column !important;
        width: 100% !important;
    }

    .services-cta .cta-actions .btn {
        width: 100% !important;
    }

    /* ===== Section Headers ===== */
    .section-title {
        font-size: 28px !important;
    }

    .section-subtitle {
        font-size: 15px !important;
    }

    .section-badge {
        font-size: 12px !important;
        padding: 6px 14px !important;
    }

    /* ===== Loader - خفيف على الموبايل ===== */
    .advanced-loader {
        display: none !important;
    }

    .loader-icon {
        width: 64px !important;
        height: 64px !important;
    }

    .loader-icon i {
        font-size: 28px !important;
    }

    .loader-text {
        font-size: 32px !important;
    }

    /* ===== Particles - إخفاء على الموبايل ===== */
    .particles-bg {
        display: none !important;
    }

    /* تعطيل التأثيرات الثقيلة */
    .card-3d {
        transform: none !important;
    }

    .parallax-layer {
        display: none !important;
    }

    /* ===== Notifications ===== */
    .notification {
        width: calc(100vw - 32px) !important;
        right: 16px !important;
    }

    /* تحسين body - إزالة التأثيرات الثقيلة على الموبايل */
    body::before {
        display: none !important;
    }

    /* تحسين شريط التمرير */
    ::-webkit-scrollbar {
        width: 4px !important;
    }
}

/* =========================================
   موبايل صغير (أقل من 480px)
========================================= */
@media (max-width: 480px) {
    :root {
        --section-py: 48px !important;
        --section-header-mb: 28px !important;
    }

    .container {
        padding: 0 16px !important;
    }

    .hero {
        padding: 100px 0 48px !important;
    }

    .hero-title {
        font-size: 26px !important;
    }

    .title-line {
        font-size: 22px !important;
    }

    .hero-description {
        font-size: 14px !important;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .stat-card {
        padding: 14px !important;
        flex-direction: column !important;
        text-align: center !important;
    }

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

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

    .section-title {
        font-size: 24px !important;
    }

    .section-subtitle {
        font-size: 14px !important;
    }

    .service-card {
        padding: 20px !important;
    }

    .service-icon {
        width: 48px !important;
        height: 48px !important;
    }

    .service-icon i {
        font-size: 22px !important;
    }

    .services-cta {
        padding: 24px 16px !important;
    }

    .cta-content h3 {
        font-size: 20px !important;
    }

    .contact-wrapper {
        padding: 20px 12px !important;
    }

    .contact-info {
        padding: 20px !important;
    }

    .contact-form-container {
        padding: 20px !important;
    }

    .testimonial-card {
        min-width: 260px !important;
        padding: 20px !important;
    }

    .features-grid {
        grid-template-columns: 1fr !important;
    }

    /* تحسين الفورم للموبايل الصغير */
    input, textarea, select {
        font-size: 16px !important; /* منع zoom على iOS */
    }
}

/* =========================================
   تحسينات خاصة بـ iOS Safari
========================================= */
@supports (-webkit-touch-callout: none) {
    /* إصلاح مشكلة 100vh في Safari */
    .hero {
        min-height: -webkit-fill-available !important;
    }

    .nav-menu {
        height: -webkit-fill-available !important;
    }

    /* تحسين smooth scrolling في Safari */
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* =========================================
   تحسينات لشاشات الحركة المفضلة (prefers-reduced-motion)
========================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .floating-elements,
    .particles-bg {
        display: none !important;
    }

    .advanced-loader {
        display: none !important;
    }
}

/* =========================================
   تحسينات الطباعة
========================================= */
@media print {
    .advanced-loader,
    .language-bar,
    .header,
    .hero-actions,
    .floating-elements,
    .scroll-indicator,
    .testimonials-slider,
    .chat-toggle,
    .chat-widget,
    .float-whatsapp,
    .scroll-top,
    .btn,
    .social-links,
    .particles-bg {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    section {
        padding: 40px 0 !important;
        break-inside: avoid;
    }

    .hero {
        padding: 60px 0 !important;
        min-height: auto !important;
    }

    .gradient-text {
        background: none !important;
        color: black !important;
    }

    a {
        color: black !important;
        text-decoration: underline;
    }
}
