/* Modern Services Section */
.modern-services {
  padding: 80px 0;
  background-color: #f9f9f9;
  position: relative;
  overflow: hidden;
  cursor: default;
  font-family: 'Inter', sans-serif;
}

/* Ensure Font Awesome is loaded properly */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

/* Base styles for SVG icons */
.icon-wrapper {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px; /* Centered margin */
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  border-radius: 4px; /* Slightly rounded corners */
}

.service-card:hover .icon-wrapper {
  transform: translateY(-5px) rotateY(0deg); /* Removed rotation */
}

.service-icon {
  width: 100%;
  height: 100%;
  color: #00325F; /* Using primary color */
  transition: all 0.3s ease;
  stroke-width: 1.75;
  overflow: visible;
  transform-style: preserve-3d;
  backface-visibility: visible;
  stroke: currentColor;
  fill: none;
}

/* Accent color for specific paths */
.service-icon .accent {
  color: #001f3f; /* Navy blue accent */
  opacity: 1; /* Make accent always visible */
  transform-origin: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: currentColor; /* Ensure stroke color is set */
  fill: none; /* Ensure no fill for line icons */
}

/* Maintain icon style (outline/line) on hover, only change color */
.service-card:hover .service-icon {
  background-color: transparent; /* Transparent background */
  border-color: #FDB103; /* Yellow border */
}

/* Base icon hover styles */
.service-card:hover .service-icon i {
  color: #FDB103 !important; /* Yellow color */
}

/* SVG icon container */
.service-card:hover .service-icon svg {
  color: #FDB103 !important;
  fill: transparent !important; /* Ensure no fill */
  stroke: #FDB103 !important; /* Ensure stroke is yellow */
  stroke-width: 2px; /* Ensure consistent stroke width */
}

/* Ensure all icon parts are visible on hover */
.service-card:hover .service-icon path,
.service-card:hover .service-icon circle,
.service-card:hover .service-icon rect,
.service-card:hover .service-icon polygon,
.service-card:hover .service-icon line {
  color: #FDB103 !important;
  fill: transparent !important; /* No fill for outline icons */
  stroke: #FDB103 !important; /* Yellow stroke */
  stroke-width: 2px; /* Consistent stroke width */
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke; /* Maintain stroke width on scale */
}

/* Ensure main icon paths have proper contrast */
.service-icon .main-path {
  stroke: #172B44; /* Navy blue for main icon paths */
  fill: none;
  opacity: 1;
  transition: all 0.3s ease;
}

/* Hover effects */
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 50, 95, 0.1);
}

/* Update icon hover effect to turn whole icon yellow */
.service-card:hover .service-icon,
.service-card:hover .service-icon path,
.service-card:hover .service-icon rect,
.service-card:hover .service-icon circle,
.service-card:hover .service-icon line,
.service-card:hover .service-icon polygon {
  color: #FDB103 !important; /* Yellow color on hover */
  stroke: #FDB103 !important;
  fill: none !important;
  transform: scale(1.1);
  transition: all 0.3s ease;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Stroke animation for main paths */
.service-icon .main-path {
  opacity: 0;
  animation: fadeIn 0.5s ease-out forwards;
  animation-delay: calc(var(--delay, 0) * 0.1s);
}

@keyframes fadeIn {
  to { opacity: 1; }
}

/* Stroke animation */
.service-icon path,
.service-icon line,
.service-icon polyline,
.service-icon rect {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: dash 1.5s ease-in-out forwards;
  opacity: 0;
  transition: opacity 0.3s ease, stroke-dashoffset 1.5s ease-in-out;
}

@keyframes dash {
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

/* Individual icon animations */
.service-card:nth-child(1) .service-icon { animation-delay: 0.1s; }
.service-card:nth-child(2) .service-icon { animation-delay: 0.2s; }
.service-card:nth-child(3) .service-icon { animation-delay: 0.3s; }
.service-card:nth-child(4) .service-icon { animation-delay: 0.4s; }

.modern-services .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: 70px;
  position: relative;
}

.section-header h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #172B44;
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
  line-height: 1.2;
  text-align: center;
  width: 100%;
}

/* Remove underline from section title */
.section-header h2::after {
  display: none;
}

.section-header p {
  color: #666;
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
  font-weight: 400;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 50px auto 0;
  max-width: 1400px;
  padding: 0 20px;
}

.service-card {
  background: #fff;
  border-radius: 12px;
  height: 320px; /* Reduced height */
  display: flex;
  flex-direction: column;
  text-align: left; /* Left align text */
  padding: 25px;
  padding: 35px 20px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(23, 43, 68, 0.08);
  position: relative;
  overflow: visible;
  z-index: 1;
  border: 1px solid rgba(23, 43, 68, 0.1);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  perspective: 1000px;
  background-color: #ffffff;
  min-height: 380px;
  transition: all 0.3s ease;
  transform-style: preserve-3d;
  backface-visibility: visible;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #001f3f, #003366);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.service-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(23, 43, 68, 0.15);
  border-color: rgba(23, 43, 68, 0.2);
  z-index: 10;
}

.service-card h3 {
  color: #172B44; /* Navy blue for headings */
  margin: 20px 0 15px;
  transition: color 0.3s ease;
  text-align: center; /* Center align headings */
}

.service-card:hover h3 {
  color: #F9C80E; /* Yellow on hover */
}

.service-card p {
  color: #4A5568; /* Dark gray for better readability */
  margin-bottom: 20px;
  transition: color 0.3s ease;
}

.service-link {
  color: #172B44;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  margin-top: auto;
}

.service-link i {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.service-card:hover .service-link {
  color: #F9C80E;
}

.service-card:hover .service-link i {
  transform: translateX(4px);
}

.service-card:hover .service-icon {
  color: #172B44; /* Darker color on hover */
  transform: scale(1.1);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #001f3f, #003366);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 1;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.03);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.icon-wrapper {
  width: 90px;
  height: 90px;
  margin: 0 auto 30px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}

.service-icon {
  font-size: 48px;
  color: #001f3f; /* Navy blue */
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
  display: flex; /* Changed to flex for centering */
  align-items: center; /* Vertically center icon */
  justify-content: center; /* Horizontally center icon */
  width: 80px;
  height: 80px;
  margin: 0 auto 20px; /* Center aligned margin */
  background: transparent; /* Removed background */
  border-radius: 0; /* Removed border-radius */
  border: none; /* Removed border */
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: color 0.3s ease;
  width: 100%;
}

.service-card p {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
  text-align: center; /* Center align paragraphs */
  font-weight: 400;
}

.service-link {
  display: inline-flex;
  align-items: center;
  color: #00325F;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: auto;
  align-self: center; /* Center align the link */
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 2px;
}

.service-link:after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: #FDB103;
  transition: width 0.3s ease;
}

.service-link:hover {
  color: #FDB103;
}

.service-link:hover:after {
  width: 100%;
}

.service-link i {
  margin-left: 5px;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.service-link:hover i {
  transform: translateX(3px);
}

.service-card:hover .service-icon {
  animation: pulse 1s ease-out forwards;
  border-color: transparent; /* Changed border color to transparent */
  color: #FDB103 !important; /* Force yellow color with !important */
  background-color: transparent; /* Changed background to transparent */
  transform: scale(1.1) rotateY(180deg); /* Added flip effect */
}

/* Ensure consistent icon appearance on hover */
.service-card:hover .service-icon svg,
.service-card:hover .service-icon i {
  color: #FDB103 !important;
  fill: transparent !important;
  stroke: #FDB103 !important;
  stroke-width: 2px;
}

/* Icon wrapper hover state */
.service-card:hover .icon-wrapper {
  color: #FDB103 !important;
}

/* Force outline style for all icons on hover */
.service-card:hover .service-icon svg *,
.service-card:hover .service-icon i::before {
  fill: transparent !important;
  stroke: #FDB103 !important;
  stroke-width: 2px !important;
}

/* Special handling for Font Awesome icons */
.service-card:hover .service-icon i.fas,
.service-card:hover .service-icon i.far,
.service-card:hover .service-icon i.fal {
  -webkit-text-stroke: 1px #001f3f; /* Outline for solid icons */
  text-stroke: 1px #001f3f; /* Outline for solid icons */
  color: #FDB103 !important;
}

@keyframes flip {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0); }
}

/* Ensure icon wrapper is properly sized */
.icon-wrapper {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
  perspective: 1000px;
}

@media (max-width: 1200px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .service-card {
    height: 300px;
  }
}

@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .service-card {
    padding: 20px;
    height: 300px;
  }
  
  .section-header h2 {
    font-size: 2.2rem;
  }
  
  .icon-wrapper {
    width: 60px;
    height: 60px;
    /* padding: 12px; */ /* Removed padding */
  }
}

@media (max-width: 768px) {
  .modern-services {
    padding: 50px 0;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 15px;
  }
  
  .section-header {
    margin-bottom: 30px;
    padding: 0 15px;
  }
  
  .service-icon {
    font-size: 36px;
    margin: 0 auto 15px; /* Adjust margin for smaller screens */
  }
}

@media (max-width: 480px) {
  .section-header h2 {
    font-size: 1.8rem;
  }
  
  .service-card h3 {
    font-size: 1.3rem;
  }
  
  .service-card p {
    font-size: 0.95rem;
  }
}
