/* Reset & Base Styles */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4361ee;
  --secondary-color: #3a0ca3;
  --accent-color: #7209b7;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --text-color: #333333;
  --text-light: #6c757d;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 12px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Cairo", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--white);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent; /* تحسين تجربة اللمس */
}

/* Header Styles - Transparent & Flow */
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #eee; 
  transition: var(--transition);
  padding: 0 5%;
  overflow: visible;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 30px;
  position: relative;
  z-index: 1001;
  gap: 30px;
}

.logo-box {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  transition: var(--transition);
  z-index: 1002;
}

.logo-box img {
  width: 100%;
  height: 100px;
  object-fit: contain;
}

/* Navigation Styles */
nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 40px;
  margin: 0;
  padding: 0;
}

.nav-list > li {
  position: relative;
}

.nav-list a {
  color: var(--dark-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 0;
  position: relative;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dropdown Menu Styles */
.dropdown {
  position: static;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--white);
  min-width: 250px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1001;
  padding: 20px 0;
  margin-top: 20px;
  list-style: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.dropdown-expansion {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: transparent;
  height: 300px;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition);
}

.dropdown:hover .dropdown-expansion {
  opacity: 1;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
  width: 100%;
}

.dropdown-menu a {
  padding: 12px 30px;
  color: var(--text-color);
  font-size: 0.95rem;
  font-weight: 400;
  display: block;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
  background: rgba(67, 97, 238, 0.05);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  padding-left: 40px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
}

.mobile-menu-btn .bar {
  width: 100%;
  height: 3px;
  background-color: var(--dark-color);
  border-radius: 10px;
  transition: var(--transition);
}

.mobile-menu-btn.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 20px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('image/backgruond.jpg') center/cover no-repeat;
  z-index: 0; 
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 1;
  border-radius: 10px;
  background-color: rgb(255, 255, 255, 0.5);
  animation: slideIn 1s ease-out;
}

#hero-heading {
  color: #000;
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  font-family: "Cairo", sans-serif;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
}

.btn {
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  font-size: 1rem;
  border: none;
  cursor: pointer;
  display: inline-block;
  touch-action: manipulation; /* تحسين الاستجابة لللمس */
}

.btn-primary {
  background: var(--white);
  color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-secondary:hover {
  background: var(--white);
  color: var(--primary-color);
  transform: translateY(-3px);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: bounce 2s infinite;
  color: rgba(87, 85, 85, 0.8);
  font-size: 0.9rem;
}

.scroll-arrow {
  width: 20px;
  height: 35px;
  border: 2px solid rgba(77, 75, 75, 0.8);
  border-radius: 25px;
  position: relative;
}

.scroll-arrow::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 10px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  animation: scroll 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
  40% {transform: translateY(-10px);}
  60% {transform: translateY(-5px);}
}

@keyframes scroll {
  0% {transform: translateX(-50%) translateY(0); opacity: 1;}
  100% {transform: translateX(-50%) translateY(15px); opacity: 0;}
}

/* Section Styles */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 100px 0;
}

h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  color: var(--dark-color);
}

.section-description {
  font-size: 1.1rem;
  color: var(--text-light);
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
  line-height: 1.8;
}

/* About Section */
.about-section {
  background: var(--light-color);
}

.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 60px;
}

.feature {
  background: var(--white);
  padding: 40px 30px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.feature:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.feature h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--dark-color);
}

.feature p {
  color: var(--text-light);
  line-height: 1.7;
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 60px;
}

.service-card {
  background: var(--white);
  padding: 40px 30px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.service-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: var(--dark-color);
}

.service-card p {
  color: var(--text-light);
  line-height: 1.7;
}

/* Contact Section */
.contact-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 25px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  background: var(--light-color);
  -webkit-appearance: none; /* إزالة المظهر الافتراضي في iOS */
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.contact-form .btn {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
}

/* Footer */
footer {
  background: var(--dark-color);
  color: var(--white);
  padding: 80px 0 30px;
  font-family: "Cairo", sans-serif;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 50px;
  margin-bottom: 60px;
}

.footer-logo img {
  width: 60px;
  height: 60px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--white);
  padding: 10px;
}

.footer-links h3,
.footer-contact h3 {
  font-size: 1.3rem;
  margin-bottom: 25px;
  color: var(--white);
}

.footer-links ul {
  list-style: none;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: block;
  margin-bottom: 12px;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--white);
  padding-left: 10px;
}

.footer-contact p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-contact i {
  width: 20px;
  color: var(--primary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.footer-bottom p {
  margin-bottom: 10px;
}

@keyframes slideIn {
  from {
      transform: translateX(-100%);
      opacity: 0;
  }
  to {
      transform: translateX(0);
      opacity: 1;
  }
}

/* =========================================== */
/* Mobile-Specific Optimizations - Start Here */
/* =========================================== */

/* Base mobile optimizations */
@media (max-width: 768px) {
  /* تحسينات الأداء */
  html {
    font-size: 14px; /* حجم خط أصغر للجوال */
  }
  
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* تحسين الهيدر للجوال */
  #main-header {
    padding: 0 15px;
    background-color: rgba(238, 238, 238, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 60px;
  }
  
  .header-container {
    height: 60px;
    justify-content: space-between;
    padding: 0;
  }
  
  .logo-box {
    width: 40px;
    height: 40px;
  }
  
  /* تحسين قائمة الجوال */
  .mobile-menu-btn {
    display: flex;
    position: relative;
    z-index: 1003;
  }
  
  nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--white);
    padding: 80px 20px 20px;
    transform: translateX(-100%);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Scroll سلس على iOS */
    z-index: 1002;
  }
  
  nav.active {
    transform: translateX(0);
  }
  
  .nav-list {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }
  
  .nav-list > li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .nav-list a {
    padding: 16px 0;
    font-size: 1.1rem;
    color: var(--dark-color);
    border-bottom: none;
    justify-content: space-between;
  }
  
  /* Dropdown تحسينات للجوال */
  .dropdown {
    position: relative;
  }
  
  .dropdown > a::after {
    content: '▸';
    font-size: 0.9em;
    transition: transform 0.3s ease;
  }
  
  .dropdown.active > a::after {
    content: '▾';
    transform: rotate(90deg);
  }
  
  .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    display: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 20px;
    margin: 0;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }
  
  .dropdown.active .dropdown-menu {
    display: block;
    max-height: 500px;
    transition: max-height 0.5s ease-in;
  }
  
  .dropdown-menu a {
    padding: 14px 15px;
    font-size: 1rem;
    color: var(--text-light);
    border-left: 3px solid transparent;
  }
  
  .dropdown-menu a:active {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
  }
  
  .dropdown-expansion {
    display: none;
  }
  
  /* تحسين القسم البطولي للجوال */
  .hero {
    padding: 100px 15px 60px;
    min-height: 90vh;
  }
  
  #hero-heading {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
  }
  
  .hero-content {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 25px;
    border-radius: 15px;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
    padding: 16px 24px;
    font-size: 1rem;
  }
  
  .btn:active {
    transform: scale(0.98);
  }
  
  .hero-scroll-indicator {
    bottom: 30px;
    font-size: 0.8rem;
  }
  
  /* تحسين الأقسام */
  section {
    padding: 60px 0;
  }
  
  h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }
  
  .section-description {
    font-size: 1rem;
    margin-bottom: 40px;
    padding: 0 10px;
  }
  
  /* تحسين About Section */
  .about-features {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
  }
  
  .feature {
    padding: 25px 20px;
    margin: 0 10px;
  }
  
  .feature:active {
    transform: scale(0.98);
  }
  
  /* تحسين Services Section */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
  }
  
  .service-card {
    padding: 25px 20px;
    margin: 0 10px;
  }
  
  .service-card:active {
    transform: scale(0.98);
  }
  
  /* تحسين Contact Section */
  .contact-form {
    padding: 25px 20px;
    margin: 0 15px;
  }
  
  .form-group input,
  .form-group textarea {
    padding: 14px;
    font-size: 16px; /* منع Zoom في iOS */
  }
  
  /* تحسين Footer للجوال */
  footer {
    padding: 50px 0 20px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
  }
  
  .footer-links ul,
  .footer-contact p {
    font-size: 0.9rem;
  }
  
  /* تحسينات الأداء والتفاعل */
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  a, button {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
  }
  
  /* تحسين التمرير على iOS */
  .container,
  .hero-content,
  .contact-form {
    -webkit-overflow-scrolling: touch;
  }
  
  /* تحسين الظلال للجوال */
  .feature,
  .service-card,
  .contact-form {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  }
}

/* تحسينات للأجهزة اللوحية الصغيرة */
@media (max-width: 480px) {
  .header-container {
    padding: 0 10px;
  }
  
  #hero-heading {
    font-size: 1.8rem;
  }
  
  .hero-subtitle {
    font-size: 0.9rem;
  }
  
  .hero-buttons .btn {
    max-width: 100%;
  }
  
  .contact-form {
    padding: 20px 15px;
    margin: 0 10px;
  }
  
  h2 {
    font-size: 1.6rem;
  }
}

/* تحسينات للأجهزة ذات الشاشات الصغيرة جداً */
@media (max-width: 360px) {
  html {
    font-size: 13px;
  }
  
  .hero {
    padding: 80px 10px 40px;
  }
  
  .hero-content {
    padding: 20px 15px;
  }
  
  .feature,
  .service-card {
    padding: 20px 15px;
  }
}

/* تحسينات للأجهزة التي تدعم اللمس فقط */
@media (hover: none) and (pointer: coarse) {
  .dropdown:hover .dropdown-menu {
    display: none;
  }
  
  .dropdown.active .dropdown-menu {
    display: block;
  }
  
  .service-card:hover,
  .feature:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .btn-primary:hover {
    transform: none;
  }
  
  .btn-secondary:hover {
    transform: none;
  }
  
  /* تحسينات التفاعل باللمس */
  .dropdown > a,
  .service-card,
  .feature,
  .btn {
    transition: transform 0.1s ease, background-color 0.1s ease;
  }
  
  .dropdown > a:active,
  .service-card:active,
  .feature:active,
  .btn:active {
    transform: scale(0.98);
  }
}

/* تحسينات التحميل والأداء */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* دعم وضع التمرير اللاصق على iOS */
@supports (-webkit-overflow-scrolling: touch) {
  html {
    height: 100%;
    overflow: hidden;
  }
  
  body {
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}