/* ============================================
   FEATURES SECTION COMPONENT
   ============================================ */

.features {
  padding: var(--space-4xl) 0;
  background: rgba(245, 243, 255, 0.85);
  position: relative;
  z-index: 1;
  overflow: visible; /* Allow glow effects to show */
}

[data-theme="dark"] .features {
  background: rgba(13, 13, 26, 0.8);
}

.features .container {
  position: relative;
  z-index: 1;
  overflow: visible; /* Allow glow effects to show */
}

.features__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.features__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--space-md);
  color: rgba(13, 22, 41, 0.95); /* Dark text on light background */
  font-weight: 800;
  letter-spacing: 0; /* Remove negative spacing for accessibility */
  line-height: 1.2; /* Improved line height */
}

[data-theme="dark"] .features__title {
  color: var(--color-text); /* White text on dark background */
}

.features__subtitle {
  font-size: clamp(1.125rem, 2vw, 1.25rem); /* Minimum 18px */
  color: rgba(13, 22, 41, 0.9); /* Dark text on light background */
  max-width: 650px;
  margin-inline: auto;
  font-weight: 400;
  line-height: 1.8; /* Improved line height */
}

[data-theme="dark"] .features__subtitle {
  color: var(--color-text-secondary); /* White text on dark background */
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-xl);
  overflow: visible; /* Allow card hover effects and glows to extend beyond */
  padding: var(--space-md); /* Extra space for glow effects */
  margin: calc(var(--space-md) * -1); /* Negative margin to compensate for padding */
}

/* Consistent layout - all cards same size */
.feature-card:nth-child(1),
.feature-card:nth-child(2),
.feature-card:nth-child(3) {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.feature-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(35, 58, 117, 0.15);
  box-shadow: 0 8px 32px rgba(35, 58, 117, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 968px) {
  .features__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding: 0;
    margin: 0;
  }
  
  .feature-card:nth-child(1),
  .feature-card:nth-child(2),
  .feature-card:nth-child(3) {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .feature-card:nth-child(3) .feature-card__icon {
    margin-bottom: var(--space-lg);
  }
}

[data-theme="dark"] .feature-card {
  background: rgba(255, 255, 255, 0.95); /* Light background in dark theme too */
  box-shadow: 0 8px 32px rgba(35, 58, 117, 0.15);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #233A75, #5AB6A0);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 1;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(35, 58, 117, 0.12);
  border-color: rgba(90, 182, 160, 0.4);
}

[data-theme="dark"] .feature-card:hover {
  box-shadow: 0 12px 40px rgba(35, 58, 117, 0.2);
  border-color: rgba(90, 182, 160, 0.4);
}

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

.feature-card__icon {
  width: 70px;
  height: 70px;
  background: transparent;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-lg);
  position: relative;
  transition: transform 0.3s ease;
}

.feature-card__icon svg {
  stroke: url(#icon-gradient);
  width: 48px;
  height: 48px;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.feature-card:hover .feature-card__icon {
  transform: scale(1.05);
}

.feature-card__illustration {
  width: 100%;
  max-width: 280px;
  height: 200px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s ease;
}

.feature-card__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.feature-card:hover .feature-card__illustration {
  transform: scale(1.05);
}

.feature-card:hover .feature-card__link {
  gap: var(--space-sm);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.5;
  }
}

.feature-card__title {
  font-size: clamp(1.5rem, 2.5vw, 2rem); /* Minimum 24px */
  margin-bottom: var(--space-md);
  margin-left: auto;
  margin-right: auto;
  color: rgba(13, 22, 41, 0.95); /* High contrast for accessibility */
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  width: 100%;
}

[data-theme="dark"] .feature-card__title {
  color: rgba(13, 22, 41, 0.95); /* Keep high contrast */
}

.feature-card__description {
  font-size: clamp(1rem, 1.5vw, 1.125rem); /* Minimum 16px */
  color: rgba(13, 22, 41, 0.95); /* Higher contrast for accessibility */
  line-height: 1.8; /* Improved line height */
  margin-bottom: 0;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
  text-align: center;
  width: 100%;
  flex-grow: 1;
}

[data-theme="dark"] .feature-card__description {
  color: rgba(13, 22, 41, 0.95); /* Keep high contrast */
}

.feature-card__link {
  color: var(--color-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  transition: gap var(--transition-fast);
  pointer-events: none;
  margin-left: auto;
  margin-right: auto;
  margin-top: var(--space-xl);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .features {
    padding: var(--space-2xl) 0;
  }
  
  .features__header {
    margin-bottom: var(--space-xl);
    padding: 0 var(--space-sm);
  }
  
  .features__grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: 0 var(--space-sm);
    margin: 0;
  }
  
  .feature-card {
    padding: var(--space-lg);
    width: 100%;
    max-width: 100%;
  }
  
  .feature-card__icon {
    width: 60px;
    height: 60px;
    margin-bottom: var(--space-sm);
  }
  
  .feature-card__icon svg {
    width: 40px;
    height: 40px;
  }
  
  .feature-card__title {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    margin-bottom: var(--space-xs);
  }
  
  .feature-card__description {
    font-size: clamp(0.9375rem, 3vw, 1rem);
    margin-bottom: var(--space-sm);
    line-height: 1.7;
  }
  
  .feature-card__link {
    font-size: clamp(0.9375rem, 3vw, 1rem);
  }
}

