/* 
 * Simple Services Component
 * A clean, horizontal services layout with proper icon display
 */

/* Base styles */
:root {
  --primary-color: #3A6351;
  --accent-color: #65B891;
  --light-bg: #F8F6F0;
  --white: #FFFFFF;
  --text-dark: #333333;
  --border-radius: 16px;
  --shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

/* Services container - Cross-browser compatible solution */
.services-container {
  margin-bottom: 30px;
  /* Contain the overflow to prevent affecting content below */
  width: 100%;
  position: relative;
  overflow: hidden;
  /* Isolate the scrolling context */
  contain: layout paint;
  /* Center the container on desktop */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Desktop-specific centering */
@media (min-width: 992px) {
  .services-row {
    justify-content: center;
  }
  
  .service-card {
    width: 240px;
  }
}

/* Staggered entrance animation for cards */
@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-card {
  animation: cardEntrance 0.6s ease forwards;
}

.service-card:nth-child(1) {
  animation-delay: 0.1s;
}

.service-card:nth-child(2) {
  animation-delay: 0.2s;
}

.service-card:nth-child(3) {
  animation-delay: 0.3s;
}

/* Services row - horizontal layout */
.services-row {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 20px;
  padding: 15px 0;
  margin: 0;
  padding-bottom: 25px;
  scroll-behavior: smooth;
  max-width: 100%;
  position: relative;
  z-index: 1;
  padding-right: 20px;
}

/* Hide scrollbar but keep functionality */
.services-row::-webkit-scrollbar {
  height: 8px;
}

.services-row::-webkit-scrollbar-thumb {
  background-color: rgba(58, 99, 81, 0.3);
  border-radius: 20px;
}

.services-row::-webkit-scrollbar-thumb:hover {
  background-color: rgba(58, 99, 81, 0.5);
}

/* Service card - Enhanced visual design */
.service-card {
  flex: 0 0 auto;
  width: 220px;
  min-width: 220px;
  padding: 24px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F6F0 100%);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(58, 99, 81, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  text-align: center;
  scroll-snap-align: start;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(58, 99, 81, 0.1);
}

.service-card.active {
  background: linear-gradient(135deg, rgba(101, 184, 145, 0.15) 0%, rgba(101, 184, 145, 0.05) 100%);
  border-color: var(--accent-color);
  box-shadow: 0 8px 24px rgba(101, 184, 145, 0.2), 0 4px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-4px);
}

.service-card.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 4px 4px 0 0;
}

/* Service icon */
.service-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 12px rgba(101, 184, 145, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-icon i {
  font-size: 28px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Service title */
.service-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--primary-color);
  font-weight: 600;
  transition: color 0.3s ease;
}

/* Tags */
.service-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.tag {
  background-color: rgba(101, 184, 145, 0.12);
  color: var(--primary-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

/* Hover effects for service cards */
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(58, 99, 81, 0.12), 0 6px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-color);
}

.service-card:hover .service-icon {
  transform: rotate(8deg) scale(1.05);
  box-shadow: 0 6px 16px rgba(101, 184, 145, 0.4);
}

.service-card:hover .service-icon i {
  transform: rotate(-8deg);
}

.service-card:hover h3 {
  color: var(--accent-color);
}

.service-card:hover .tag {
  background-color: rgba(101, 184, 145, 0.2);
  border-color: rgba(101, 184, 145, 0.3);
}

/* Service content - Enhanced visual design */
.service-content {
  margin-top: 40px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F8F6F0 100%);
  border-radius: var(--border-radius);
  box-shadow: 0 6px 20px rgba(58, 99, 81, 0.1), 0 3px 10px rgba(0, 0, 0, 0.05);
  padding: 35px;
  position: relative;
  width: 100%;
  overflow: hidden;
  z-index: 1;
  border: 1px solid rgba(58, 99, 81, 0.08);
}

.service-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--primary-color) 100%);
  border-radius: 6px 0 0 6px;
}

.service-content-panel {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(15px);
}

.service-content-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: slideUpFade 0.5s ease forwards;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-content-panel h3 {
  color: var(--primary-color);
  margin-bottom: 12px;
  font-size: 26px;
  font-weight: 600;
}

.service-content-panel p.lead {
  color: var(--text-dark);
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 500;
  line-height: 1.6;
}

/* Content layout */
.content-grid {
  display: flex;
  flex-wrap: wrap;
  margin-top: 25px;
}

.content-col {
  flex: 0 0 100%;
}

@media (min-width: 768px) {
  .content-col {
    flex: 0 0 50%;
  }
  
  .content-col:first-child {
    padding-right: 15px;
  }
  
  .content-col:last-child {
    padding-left: 15px;
  }
}

/* Feature items */
.feature-list {
  margin-top: 20px;
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: rgba(101, 184, 145, 0.05);
  transition: all 0.3s ease;
}

.feature-item:hover {
  background-color: rgba(101, 184, 145, 0.1);
  transform: translateX(4px);
}

.feature-item i {
  color: var(--accent-color);
  margin-right: 12px;
  font-size: 16px;
  flex-shrink: 0;
}

/* Image container */
.image-container {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .service-card {
    width: 180px;
    padding: 20px;
  }
  
  .service-icon {
    width: 70px;
    height: 70px;
  }
  
  .service-content {
    padding: 25px;
  }
  
  .service-content-panel h3 {
    font-size: 22px;
  }
  
  .service-content-panel p.lead {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .service-card {
    width: 160px;
    padding: 18px;
  }
  
  .service-icon {
    width: 65px;
    height: 65px;
  }
  
  .service-icon i {
    font-size: 24px;
  }
  
  .service-card h3 {
    font-size: 18px;
  }
  
  .service-content {
    padding: 20px;
  }
}

/* Ripple effect for card clicks */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(101, 184, 145, 0.3);
  transform: scale(0);
  animation: rippleAnimation 0.6s ease-out;
  pointer-events: none;
}

@keyframes rippleAnimation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Scroll indicator for mobile */
.scroll-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(58, 99, 81, 0.8);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.3s ease, background 0.3s ease;
  z-index: 10;
  pointer-events: none;
}

.scroll-indicator:hover {
  background: rgba(58, 99, 81, 1);
}

/* Keyboard focus styles */
.service-card:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.service-card:focus:not(:focus-visible) {
  outline: none;
}
