/* Mobile Contact Section Title Fix - إصلاح عنوان قسم تواصل معنا على الهاتف */
/* FORCE REMOVE WHITE SPACE - حل المشكلة بالقوة */

@media (max-width: 768px) {
  /* Force body background */
  body {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Force contact section to cover everything */
  #contact {
    position: relative !important;
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
    margin: 0 !important;
    margin-bottom: -50px !important;
    padding-top: 60px !important;
    padding-bottom: 120px !important;
    z-index: 10 !important;
    overflow: visible !important;
    min-height: 120vh !important;
  }
  
  /* Make footer blend with contact section */
  .footer {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
    margin: 0 !important;
    margin-top: -30px !important;
    padding: 40px 15px !important;
    position: relative !important;
    z-index: 5 !important;
  }
  
  .footer p {
    color: #ffffff !important;
    opacity: 0.8 !important;
    margin: 0 !important;
  }
  
  /* Remove any gaps between elements */
  #contact + .footer,
  .footer + script,
  script + body,
  #contact ~ * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  
  /* Contact section title positioning */
  #contact .section-title,
  #contact .contact-3d-title,
  #contact h2,
  #contact h1 {
    position: relative !important;
    z-index: 10 !important;
    margin-top: 20px !important;
    margin-bottom: 30px !important;
    padding-top: 20px !important;
    background: transparent !important;
    color: #ffffff !important;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
  }
  
  /* Contact header positioning */
  #contact .contact-header {
    position: relative !important;
    z-index: 10 !important;
    margin-top: 30px !important;
    padding-top: 20px !important;
  }
  
  /* Contact wrapper positioning */
  #contact .contact-wrapper {
    position: relative !important;
    z-index: 5 !important;
    margin-top: 20px !important;
  }
  
  /* Ensure section content is above background */
  #contact .section-intro,
  #contact .contact-info,
  #contact .contact-details,
  #contact .contact-grid {
    position: relative !important;
    z-index: 5 !important;
  }
  
  /* Fix any overlapping elements */
  #contact::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
    z-index: -1 !important;
  }
  
  /* Ensure proper scroll margin */
  #contact {
    scroll-margin-top: 0 !important;
  }
  
  /* Override any conflicting styles */
  #contact.section.alt {
    margin-top: 0 !important;
    padding-top: 60px !important;
    position: relative !important;
    z-index: 1 !important;
  }
  
  /* Mobile specific adjustments - FORCE SOLUTION */
  @media (max-width: 480px) {
    body {
      background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
      margin: 0 !important;
      padding: 0 !important;
    }
    
    #contact {
      padding-top: 50px !important;
      padding-bottom: 100px !important;
      margin-bottom: -40px !important;
      min-height: 120vh !important;
    }
    
    .footer {
      background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
      margin: 0 !important;
      margin-top: -25px !important;
      padding: 30px 15px !important;
      position: relative !important;
      z-index: 5 !important;
    }
    
    .footer p {
      color: #ffffff !important;
      opacity: 0.8 !important;
      margin: 0 !important;
    }
    
    /* Force remove all gaps */
    * {
      margin-bottom: 0 !important;
    }
    
    #contact ~ * {
      margin-top: -20px !important;
    }
    
    #contact .section-title,
    #contact .contact-3d-title,
    #contact h2,
    #contact h1 {
      margin-top: 15px !important;
      padding-top: 15px !important;
      font-size: 1.8rem !important;
    }
    
    #contact .contact-header {
      margin-top: 20px !important;
      padding-top: 15px !important;
    }
  }
  
  /* Small mobile adjustments - ULTIMATE FORCE */
  @media (max-width: 360px) {
    body {
      background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
      margin: 0 !important;
      padding: 0 !important;
    }
    
    #contact {
      padding-top: 40px !important;
      padding-bottom: 90px !important;
      margin-bottom: -30px !important;
      min-height: 120vh !important;
    }
    
    .footer {
      background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
      margin: 0 !important;
      margin-top: -20px !important;
      padding: 25px 15px !important;
      position: relative !important;
      z-index: 5 !important;
    }
    
    .footer p {
      color: #ffffff !important;
      opacity: 0.8 !important;
      margin: 0 !important;
      font-size: 0.8rem !important;
    }
    
    /* Ultimate force removal */
    html, body {
      margin: 0 !important;
      padding: 0 !important;
      background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
    }
    
    #contact ~ *, .footer ~ * {
      margin-top: -30px !important;
      padding-top: 0 !important;
    }
    
    *:not(#contact):not(.footer):not(.footer *) {
      margin-bottom: 0 !important;
    }
    
    #contact .section-title,
    #contact .contact-3d-title,
    #contact h2,
    #contact h1 {
      margin-top: 10px !important;
      padding-top: 10px !important;
      font-size: 1.6rem !important;
    }
  }
}

/* RTL support for Arabic */
[dir="rtl"] #contact {
  direction: rtl !important;
}

[dir="rtl"] #contact .section-title,
[dir="rtl"] #contact .contact-3d-title,
[dir="rtl"] #contact h2,
[dir="rtl"] #contact h1 {
  text-align: center !important;
  direction: rtl !important;
}

/* LTR support for English */
[dir="ltr"] #contact {
  direction: ltr !important;
}

[dir="ltr"] #contact .section-title,
[dir="ltr"] #contact .contact-3d-title,
[dir="ltr"] #contact h2,
[dir="ltr"] #contact h1 {
  text-align: center !important;
  direction: ltr !important;
}
