/* =======================
   ENHANCED SERVICES SECTION
   ======================= */

/* Modern engineering services section - keep original background */
.feature-section.feature-style-2 {
  position: relative;
  /* Keep original background - no changes */
  overflow: hidden;
  padding-top: 120px !important;
  padding-bottom: 120px !important;
  z-index: 1;
}

.feature-section .container {
  position: relative;
  z-index: 2;
}

/* Enhanced section title */
.feature-section .section-title h3 {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  font-size: 2.5rem !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  margin-bottom: 1.5rem !important;
  position: relative;
  display: inline-block;
}

.feature-section .section-title h3::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(45deg, #3b82f6, #10b981);
  border-radius: 2px;
}

.feature-section .section-title p {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  font-size: 1.1rem !important;
  line-height: 1.8 !important;
  color: #475569 !important;
  margin-bottom: 3rem !important;
}

/* Enhanced service cards */
.single-feature {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 20px !important;
  padding: 2rem !important;
  margin-bottom: 1.5rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.1) !important;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Gradient border animation */
.single-feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(45deg, #3b82f6, #10b981, #8b5cf6, #f59e0b);
  background-size: 300% 100%;
  animation: gradientFlow 4s ease infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.single-feature:hover::before {
  opacity: 1;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.single-feature:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 4px 20px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.95) !important;
}

/* Icon styling */
.icon-badge {
  width: 60px !important;
  height: 60px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 16px !important;
  transition: all 0.3s ease !important;
  flex-shrink: 0;
}

.single-feature:hover .icon-badge {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.icon-badge i {
  font-size: 32px !important;
  transition: all 0.3s ease;
}

.single-feature:hover .icon-badge i {
  transform: scale(1.1);
}

/* Enhanced typography */
.single-feature h5 {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  line-height: 1.4 !important;
  margin-bottom: 1rem !important;
  flex-grow: 0;
}

.single-feature p {
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  font-size: 0.95rem !important;
  line-height: 1.7 !important;
  color: #64748b !important;
  margin-bottom: 0 !important;
  flex-grow: 1;
}

/* Card content layout */
.single-feature .d-flex {
  margin-bottom: 1rem !important;
  align-items: flex-start !important;
}

/* Restored background image with original visibility */
.feature-img-left {
  position: relative;
  z-index: 0;
  overflow: hidden;
}

.feature-img-left img {
  /* Restore original background image visibility */
  opacity: 1 !important;
  border-radius: inherit !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
  position: relative;
  z-index: 0;
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
}

.feature-img-left:hover img {
  /* Subtle hover effect */
  transform: scale(1.02);
  box-shadow: none !important;
}

/* Responsive design */
@media (max-width: 991px) {
  .feature-section.feature-style-2 {
    padding-top: 80px !important;
    padding-bottom: 80px !important;
  }
  
  .feature-section .section-title h3 {
    font-size: 2rem !important;
    text-align: center !important;
  }
  
  .feature-section .section-title p {
    text-align: center !important;
  }
  
  .single-feature {
    padding: 1.5rem !important;
    margin-bottom: 2rem !important;
  }
  
  .icon-badge {
    width: 50px !important;
    height: 50px !important;
  }
  
  .icon-badge i {
    font-size: 28px !important;
  }
  
  .single-feature h5 {
    font-size: 1.1rem !important;
  }
  
  .single-feature p {
    font-size: 0.9rem !important;
  }
  
  /* Stack content vertically on tablet */
  .feature-section .row.align-items-center {
    flex-direction: column-reverse !important;
  }
  
  .feature-section .col-12.col-lg-4 {
    margin-bottom: 2rem !important;
  }
}

@media (max-width: 767px) {
  .feature-section.feature-style-2 {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }
  
  .feature-section .section-title h3 {
    font-size: 1.75rem !important;
    margin-bottom: 1rem !important;
  }
  
  .feature-section .section-title p {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
  }
  
  .single-feature {
    padding: 1.25rem !important;
    border-radius: 16px !important;
  }
  
  .icon-badge {
    width: 45px !important;
    height: 45px !important;
    border-radius: 12px !important;
  }
  
  .icon-badge i {
    font-size: 24px !important;
  }
  
  .single-feature h5 {
    font-size: 1rem !important;
    line-height: 1.3 !important;
  }
  
  .single-feature p {
    font-size: 0.85rem !important;
    line-height: 1.6 !important;
  }
}

@media (max-width: 576px) {
  .feature-section .section-title h3 {
    font-size: 1.5rem !important;
  }
  
  .feature-section .section-title p {
    font-size: 0.95rem !important;
    padding: 0 1rem !important;
  }
  
  .single-feature {
    padding: 1rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  .single-feature .d-flex {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    gap: 1rem !important;
  }
  
  .single-feature h5 {
    text-align: center !important;
    font-size: 0.95rem !important;
  }
  
  .single-feature p {
    text-align: center !important;
    font-size: 0.8rem !important;
  }
  
  .icon-badge {
    margin: 0 auto 0.5rem auto !important;
  }
  
  /* Remove hover effects on mobile */
  .single-feature:hover {
    transform: none !important;
  }
  
  /* Better container padding */
  .feature-section .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Ensure proper grid on mobile */
  .feature-section .row.row-cols-1 {
    margin: 0 !important;
  }
  
  .feature-section .row.row-cols-1 .col {
    padding: 0 0.5rem !important;
    margin-bottom: 1rem !important;
  }
}

/* Loading animations */
.single-feature {
  opacity: 0;
  animation: serviceCardFadeIn 0.8s ease forwards;
}

.single-feature:nth-child(1) { animation-delay: 0.1s; }
.single-feature:nth-child(2) { animation-delay: 0.2s; }
.single-feature:nth-child(3) { animation-delay: 0.3s; }
.single-feature:nth-child(4) { animation-delay: 0.4s; }

@keyframes serviceCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtle floating animation */
.single-feature {
  animation: serviceFloat 8s ease-in-out infinite;
}

.single-feature:nth-child(even) {
  animation-delay: -4s;
}

@keyframes serviceFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.single-feature:hover {
  animation-play-state: paused;
}

/* Enhanced equal height cards */
.feature-section .row[class*="row-cols"] .col {
  display: flex;
}

.feature-section .single-feature {
  min-height: 220px;
}

/* Professional color scheme enhancements */
.single-feature:nth-child(1) .icon-badge {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
}

.single-feature:nth-child(1) .icon-badge i {
  color: #2563eb !important;
}

.single-feature:nth-child(2) .icon-badge {
  background: linear-gradient(135deg, #f3e8ff, #e9d5ff) !important;
}

.single-feature:nth-child(2) .icon-badge i {
  color: #9333ea !important;
}

.single-feature:nth-child(3) .icon-badge {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
}

.single-feature:nth-child(3) .icon-badge i {
  color: #059669 !important;
}

.single-feature:nth-child(4) .icon-badge {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
}

.single-feature:nth-child(4) .icon-badge i {
  color: #d97706 !important;
}

/* Mobile-specific overrides to fix layout conflicts */
@media (max-width: 576px) {
  /* Override any conflicting styles */
  .feature-section.feature-style-2 .container {
    max-width: 100% !important;
    padding: 0 1rem !important;
  }
  
  .feature-section .row {
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
  }
  
  .feature-section .col {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  
  /* Ensure proper card spacing */
  .single-feature {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 1rem 0 !important;
  }
  
  /* Fix any text alignment issues */
  .feature-section .section-title {
    text-align: center !important;
    margin-bottom: 2rem !important;
  }
  
  /* Override inline styles that might conflict */
  .feature-section[style*="direction"] {
    direction: rtl !important;
  }
  
  .feature-section .section-title h3[style] {
    text-align: center !important;
  }
  
  .feature-section .section-title p[style] {
    text-align: center !important;
  }
}
