/* --- Services Section --- */
#services {
  padding: 50px 20px;
  background: rgba(249, 249, 249, 0);
  text-align: center;
}

.services-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 48px 24px;
  text-align: center;
}

#services h2 {
  font-size: 2.5rem;
  color: #1f2937;
  margin-bottom: 20px;
}

h2 {
  margin-bottom: 20px;
}

/* Updated sliding card strip to span the full width of the screen */
.services-cards-slider {
  overflow: visible; /* Allow cards to extend outside the container */
  position: relative;
  margin: 0; /* Remove margins to span full width */
  width: 100%; /* Ensure slider fits within the viewport */
}

/* Updated sliding card strip for infinite loop */
.slider-track {
  display: flex;
  gap: 20px;
  transition: transform 0.3s ease-in-out;
  animation: slide-infinite 40s linear infinite; /* Infinite loop animation */
  width: max-content; /* Ensure all cards fit in a single row */
}

.service-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 32px;
  box-shadow: 0 8px 32px rgba(44, 62, 80, 0.1);
  padding: 0 0 32px 0;
  min-width: 340px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #e8e4ec;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  position: relative;
}

.service-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 16px 48px rgba(122, 44, 178, 0.13);
  border-color: #d44a4a;
}

.service-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  margin-bottom: 0;
  background: #eee;
  display: block;
}

.service-icon {
  font-size: 2.5rem;
  margin-top: -36px;
  margin-bottom: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(122, 44, 178, 0.08);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 50%;
  top: 180px;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.service-title {
  font-weight: 700;
  font-size: 1.35rem;
  color: #264653;
  margin: 48px 0 12px 0;
  letter-spacing: 1px;
}

.service-desc {
  font-size: 1.08rem;
  color: #555;
  line-height: 1.5;
  padding: 0 18px;
}

/* Updated card styles for a modern and polished look */
.project-card {
  flex: 0 0 300px; /* Fixed width for each card */
  background: linear-gradient(
    135deg,
    #ffffff,
    #f3f4f6
  ); /* Subtle gradient background */
  border-radius: 20px; /* Softer rounded corners */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); /* Enhanced shadow for depth */
  overflow: hidden;
  text-align: left;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative; /* Ensure proper stacking context */
  z-index: 1; /* Bring hovered card to the front */
}

.project-card:hover {
  z-index: 10; /* Increase stacking order on hover */
  transform: translateY(-10px) scale(1.05); /* Slightly enlarge the card */
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2); /* Add a more prominent shadow */
}

.project-card img {
  width: 100%;
  height: 180px; /* Slightly taller image */
  object-fit: cover;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px; /* Rounded top corners */
}

.project-card-content {
  padding: 20px; /* Increased padding for better spacing */
}

.project-card-content h3 {
  font-size: 1.6rem; /* Slightly larger title */
  color: #1f2937; /* Darker text for better contrast */
  margin-bottom: 12px;
}

.project-card-content p {
  font-size: 1rem;
  color: #6b7280; /* Subtle gray text */
  line-height: 1.6;
}

@media (max-width: 900px) {
  .services-cards {
    flex-direction: column;
    gap: 32px;
    align-items: center;
  }
  .service-card {
    min-width: 0;
    max-width: 98vw;
  }
}

@media screen and (max-width: 768px) {
  #services {
    padding: 30px 15px;
  }

  #services h2 {
    font-size: 2rem;
  }

  .slider-track {
    grid-template-columns: 1fr;
  }

  .project-card {
    flex: 0 0 250px; /* Adjust card width for smaller screens */
  }

  .project-card img {
    height: 120px;
  }

  .project-card-content h3 {
    font-size: 1.2rem;
  }

  .project-card-content p {
    font-size: 0.9rem;
  }
}

.projects-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(44, 62, 80, 0.25);
  align-items: center;
  justify-content: center;
}

.projects-modal.active {
  display: flex;
}

.projects-modal-content {
  background: #fff;
  border-radius: 18px;
  max-width: 900px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(122, 44, 178, 0.13);
  padding: 36px 28px 28px 28px;
  position: relative;
  animation: fadeInUp 0.4s;
}

.close-modal {
  position: absolute;
  top: 18px;
  right: 24px;
  font-size: 2rem;
  color: #d44a4a;
  cursor: pointer;
  font-weight: bold;
}

#modal-title {
  text-align: center;
  color: #7a2cb2;
  margin-bottom: 28px;
  font-size: 1.6rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.project-title {
  font-weight: 700;
  color: #264653;
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.project-desc {
  color: #555;
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.project-location {
  font-size: 0.93rem;
  color: #d44a4a;
  margin-top: auto;
}

/* Slowed down the auto-scrolling animation speed */
@keyframes slide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Updated sliding card strip for infinite loop */
@keyframes slide-infinite {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%); /* Adjust based on content width */
  }
}

/* Fix for extra white space in mobile view */
body {
  overflow-x: hidden; /* Prevent horizontal scrolling */
}
