/* Services Section Styling to match the image */
.services.parallax-section {
  position: relative;
  padding: 100px 0;
  background: linear-gradient(135deg, #2a1758, #3a1a4a);
  color: #ffffff;
}

.services-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 10, 40, 0.6);
  z-index: -1;
}

/* Services Section General */
.services {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-dark);
  padding: 120px 0;
  margin-bottom: 40px; /* Added margin to prevent scaled cards from overlapping with adjacent sections */
}

/* Services Section Decorative Elements */
.services::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(52, 152, 219, 0.1) 0%,
    rgba(52, 152, 219, 0) 70%
  );
  border-radius: 50%;
  z-index: 0;
}

.services::after {
  content: '';
  position: absolute;
  bottom: 50px;
  left: 50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(231, 76, 60, 0.05) 0%,
    rgba(231, 76, 60, 0) 70%
  );
  border-radius: 50%;
  z-index: 0;
}

/* Services Introduction */
.services-intro {
  max-width: 800px;
  margin: 0 auto 60px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.services-intro p {
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--text-color);
}

.services-intro-tagline {
  font-size: 1.1rem;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
  font-weight: 500;
  display: block;
}

.services-heading {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  margin: 0 0 10px;
  font-weight: 500;
}

.services-subheading {
  font-size: 2.8rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-line {
  height: 3px;
  width: 100px;
  background: #fad02c;
  margin: 0 0 30px;
}

.services-description {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
}

.services-description p {
  flex: 0 0 65%;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
}

.services-cta {
  flex: 0 0 30%;
  text-align: right;
  align-self: flex-end;
}

.view-services-btn {
  display: inline-block;
  padding: 10px 20px;
  border: 2px solid #fad02c;
  color: #fad02c;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.view-services-btn:hover {
  background: #fad02c;
  color: #000;
}

/* Service Categories Navigation */
.service-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 50px;
  position: relative;
  z-index: 1;
}

.category-button {
  background: transparent;
  border: none;
  color: var(--text-color);
  padding: 10px 20px;
  margin: 0 5px 10px;
  cursor: pointer;
  font-size: 1.1rem; /* Slightly larger font size for better visibility with smaller cards */
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
  border-radius: 30px;
  letter-spacing: 0.5px; /* Added for better readability */
}

.category-button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 30px;
  height: 2px;
  background-color: var(--primary-color);
  transition: transform 0.3s ease;
}

.category-button:hover,
.category-button.active {
  color: var(--primary-color);
}

.category-button:hover::after,
.category-button.active::after {
  transform: translateX(-50%) scaleX(1);
}

.category-button.active {
  background: rgba(52, 152, 219, 0.1);
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 40px auto 0;
  position: relative;
  z-index: 1;
  padding: 20px 0; /* Add some padding to prevent clipping of card shadows */
}

/* Service Card Wrapper - Added for scaling effect */
.service-card-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 25px 15px; /* Added padding to create space around scaled cards */
  transition: padding 0.3s ease, transform 0.3s ease, z-index 0.1s; /* Smooth transitions */
  position: relative;
  z-index: 1;
}

/* Enhanced hover effects */
.service-card-wrapper.hover {
  padding: 10px; /* Reduce padding on hover to give more space for the expanded card */
  z-index: 10; /* Ensure hovered card is on top */
}

.service-card-wrapper.sibling-hovered {
  opacity: 0.8; /* Slightly dim other cards when a card is hovered */
  transform: scale(0.95); /* Subtle scale effect for non-hovered cards */
}

/* Modern Service Card */
.service-card {
  background-color: rgba(25, 25, 35, 0.8);
  border-radius: 12px;
  padding: 35px 25px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  transition: all 0.4s ease;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transform: translateY(0);
}

/* Text size adjustments to improve readability at reduced scale */
.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--light-text);
}

.service-card p {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 1;
}

.service-details h4 {
  font-size: 1.25rem; /* Increased from 1.1rem */
}

.service-details li {
  font-size: 1.1rem; /* Increased from 0.95rem */
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(52, 152, 219, 0.1) 0%,
    rgba(26, 188, 156, 0.05) 100%
  );
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-card:hover::before {
  opacity: 1;
}

.service-header {
  padding: 30px 30px 20px;
  position: relative;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.service-icon {
  position: relative;
  font-size: 36px;
  width: 90px;
  height: 90px;
  margin: 0 auto 25px;
  background: radial-gradient(
    circle,
    rgba(52, 152, 219, 0.2),
    rgba(52, 152, 219, 0.05)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  position: relative;
  z-index: 1;
  transition: all 0.4s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-card:hover .service-icon {
  transform: scale(1.1);
  color: #fff;
  background: var(--accent-color);
  box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
}

.service-card h3 {
  color: var(--light-text);
  font-size: 1.5rem;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.service-card:hover h3 {
  transform: translateX(5px);
}

.service-summary {
  padding: 0 30px 15px;
  flex: 1;
}

.service-card p {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 1;
}

.service-details {
  padding: 0 30px 30px;
  overflow: hidden;
  max-height: 0;
  transition: all 0.5s ease;
  opacity: 0;
}

.service-card:hover .service-details {
  max-height: 300px;
  opacity: 1;
}

.service-details h4 {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 15px;
  position: relative;
  padding-left: 20px;
}

.service-details h4::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 2px;
  background-color: var(--primary-color);
}

.service-details ul {
  padding-left: 20px;
  list-style-type: none;
}

.service-details li {
  position: relative;
  padding: 6px 0 6px 20px;
  font-size: 0.95rem;
  color: var(--text-color);
}

.service-details li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 6px;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.service-footer {
  padding: 15px 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-action {
  position: relative;
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-right: 25px;
  transition: all 0.3s ease;
}

.service-action::after {
  content: '→';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

.service-action:hover::after {
  transform: translate(5px, -50%);
}

/* Service Details Images */
.service-image {
  border-radius: 10px;
  overflow: hidden;
  margin: 20px 0;
}

.service-image img {
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
}

.service-card:hover .service-image img {
  transform: scale(1.05);
}

/* Animation for service cards on scroll */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px) scale(0.8); /* Include scale in initial state */
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0) scale(0.8); /* Maintain scale when visible */
}

/* Service Stats */
.service-stats {
  margin: 100px 0 60px; /* Increased top margin to accommodate the scaled cards */
  text-align: center;
  position: relative;
  z-index: 1;
  transform: scale(
    0.9
  ); /* Slightly reduce the stats section to match the service cards aesthetic */
  transform-origin: center top;
}

.stat-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  background: linear-gradient(
    135deg,
    rgba(52, 152, 219, 0.1) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  border-radius: 15px;
  padding: 40px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.service-stat {
  padding: 20px;
  margin: 10px;
  flex-basis: 200px;
  position: relative;
}

.service-stat::after {
  content: '';
  position: absolute;
  width: 1px;
  height: 60%;
  background: rgba(255, 255, 255, 0.1);
  right: 0;
  top: 20%;
}

.service-stat:last-child::after {
  display: none;
}

.service-stat .stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 10px;
  display: inline-block;
  position: relative;
}

.service-stat .stat-number::after {
  content: '+';
  font-size: 1.5rem;
  position: absolute;
  top: 0;
  right: -15px;
}

.service-stat .stat-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-color);
}

/* Services CTA */
.services-cta {
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(52, 152, 219, 0.2) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  padding: 60px 20px;
  border-radius: 15px;
  margin: 40px 0 0;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.services-cta::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(52, 152, 219, 0.2) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  z-index: -1;
}

.services-cta h3 {
  font-size: 2rem;
  color: var(--light-text);
  margin-bottom: 20px;
}

.services-cta p {
  font-size: 1.1rem;
  color: var(--text-color);
  max-width: 600px;
  margin: 0 auto 30px;
}

.services-cta .btn {
  padding: 12px 30px;
  font-size: 1.1rem;
  letter-spacing: 1px;
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* Responsive design */
@media screen and (max-width: 1200px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    padding: 0 20px;
  }
}

@media screen and (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Adjusted service card scaling for mobile */
  .service-card-wrapper {
    margin: 10px 0;
    padding: 20px 5px; /* Less horizontal padding on mobile */
  }

  /* Slightly larger scale on mobile for better readability */
  .service-card {
    transform: scale(0.85); /* 85% scale on mobile instead of 80% */
  }

  /* Adjust hover scale on mobile */
  .service-card:hover {
    transform: translateY(-10px) scale(0.9); /* Less dramatic effect on mobile */
  }

  /* Adjust animations for mobile */
  .fade-in-up {
    transform: translateY(20px) scale(0.85); /* Match the mobile card scale */
  }

  .fade-in-up.visible {
    transform: translateY(0) scale(0.85); /* Match the mobile card scale */
  }

  .service-header,
  .service-summary,
  .service-details,
  .service-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .service-categories {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 10px;
  }

  .category-button {
    white-space: nowrap;
  }
}

@media screen and (max-width: 576px) {
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 350px;
    margin: 30px auto 0;
  }

  .service-card {
    padding: 30px 20px;
  }
}
