/* ==============================
   خدمات - Service Cards
   ============================== */
#services .container {
  display: flex;
  justify-content: center;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin: 40px auto;
  max-width: 1100px;
}

.service-item {
  background: #fff;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
  animation: float 4s ease-in-out infinite;
}

.service-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hover interaction */
.service-item:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
  background: #f0f7ed; /* subtle color change */
}

.service-item .service-icon {
  font-size: 3rem;
  color: var(--primary-dark);
  margin-bottom: 15px;
  transition: color 0.3s ease, transform 0.3s ease;
}

.service-item:hover .service-icon {
  color: var(--primary-light);
  transform: rotate(10deg);
}

.service-item h3 {
  color: var(--primary-dark);
  margin: 15px 0 10px;
  font-size: 1.2rem;
}

.service-item p {
  margin: 0 15px 20px;
  color: #555;
  font-size: 1rem;
  line-height: 1.5;
}

/* subtle floating animation */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
  }
}

@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(1, 1fr);
    max-width: 500px;
  }
}

/* حركة ناعمة في أيقونات الخدمات */
@keyframes gentleFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0);
  }
}

.service-icon i {
  animation: gentleFloat 4s ease-in-out infinite;
  animation-delay: calc(var(--d, 0) * 0.5s);
  transition: transform 0.3s ease;
}

/* نخلي كل أيقونة تبدأ في توقيت مختلف */
.service-item:nth-child(1) i {
  --d: 0;
}
.service-item:nth-child(2) i {
  --d: 1;
}
.service-item:nth-child(3) i {
  --d: 2;
}
.service-item:nth-child(4) i {
  --d: 3;
}
.service-item:nth-child(5) i {
  --d: 4;
}
.service-item:nth-child(6) i {
  --d: 5;
}
.service-item:nth-child(7) i {
  --d: 6;
}
.service-item:nth-child(8) i {
  --d: 7;
}
.service-item:nth-child(9) i {
  --d: 8;
}
.service-item:nth-child(10) i {
  --d: 9;
}

/* تأثير لطيف عند المرور */
.service-item:hover .service-icon i {
  transform: scale(1.2) rotate(5deg);
  color: #8aaa0d;
}
/* دخول الكروت يمين ويسار */
.service-item {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition: all 0.6s ease;
}

.service-item.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* نخلي كل كارت يدخل بتأخير بسيط */
.service-item:nth-child(odd).visible {
  transform: translateX(0) translateY(0);
}
.service-item:nth-child(even).visible {
  transform: translateX(0) translateY(0);
}

/* التأثير قبل الظهور */
.service-item:nth-child(odd) {
  transform: translateX(40px) translateY(40px);
}
.service-item:nth-child(even) {
  transform: translateX(-40px) translateY(40px);
}

/* لمعة محترمة على الكارت */
.service-item:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid #cfe8bf;
}

/* Tilt بسيط مع الماوس */
.service-item {
  transform-style: preserve-3d;
  perspective: 800px;
}

.service-item:hover {
  transform: translateY(-10px) scale(1.05) rotateX(3deg) rotateY(3deg);
}
.service-item:hover .service-icon i {
  transform: scale(1.25) rotate(8deg);
  color: #9dca1b;
  text-shadow: 0 0 12px rgba(157, 202, 27, 0.6);
}
