/* features.css */
.features-title {
  text-align: center;
  margin-top: 4rem;
  margin-bottom: 2rem;
}

.features-title h2 {
  font-size: 4rem;
  font-weight: bold;
  color: white;
}

.features-section {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: 5rem 3.7rem;
  gap: 2rem;
  overflow: hidden;
  z-index: 0;
  background: #0b0c1000;
  height: 500px;
  padding-bottom: 10rem;
}

/* Background floating PNGs */
.bg-float {
  position: absolute;
  width: 100px;
  height: 100px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.07;
  transition: opacity 0.3s ease, filter 0.3s ease;
  z-index: 1;
  pointer-events: auto;
}

.bg-float:hover {
  opacity: 1;
  filter: drop-shadow(0 0 18px var(--glow-color));
}

.bg-float.one {
  background-image: url('../assets/bg1.png');
  --glow-color: #00ff00;
}
.bg-float.two {
  background-image: url('../assets/bg2.png');
  --glow-color: #ff00ff;
}
.bg-float.three {
  background-image: url('../assets/bg3.png');
  --glow-color: #ff0000;
}
.bg-float.four {
  background-image: url('../assets/bg4.png');
  --glow-color: #0000ff;
}

/* Content area */
.features-content-left {
  position: relative;
  flex: 1;
  padding: 0rem;
  z-index: 2;
  background: transparent;
  user-select: none;
  pointer-events: none;
}

.features-content-left h3 {
  font-size: 2.5rem;
  margin-bottom: 0rem;
  font-weight: 700;
  color: #ffffff;
  position: relative;
}

.features-content-left p {
  font-size: 1.2rem;
  line-height: 0.5;
  color: #ffffffa1;
  max-width: 500px;
  position: relative;
}

/* Cards section */
.features-stack-right {
  position: relative;
  width: 36vw;
  height: 10vh;
  z-index: 3;
  user-select: none;
}

.feature-card {
  position: absolute;
  width: 500px;
  height: 150px;
  padding: 0;
  background-color: transparent;
  border-radius: 0.75rem;
  cursor: pointer;
  box-shadow: 0 6px 15px #3aafa938;
  border: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform, box-shadow;
  z-index: 3;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

/* When visible */
.feature-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.animate-scroll {
  opacity: 0;
  animation-name: slideUpFadeIn;
  animation-duration: 0.8s;
  animation-timing-function: ease-out;
  animation-delay: var(--animation-delay, 0s); /* Uses JS-defined delay */
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.feature-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0.75rem;
  pointer-events: none;
}

/* Card positions */
.feature-card:nth-child(1) { top: 0; left: 0; z-index: 3; }
.feature-card:nth-child(2) { top: 50px; left: -20px; z-index: 4; }
.feature-card:nth-child(3) { top: 100px; left: -40px; z-index: 5; }

/* Hover effects */
.feature-card:hover {
  z-index: 999;
  transform: scale(1.05);
  box-shadow: 0 15px 35px #3aafa9e0;
}

/* ========== MEDIA QUERIES ========== */
@media (max-width: 1200px) {
  .features-section {
    flex-direction: column;
    height: auto;
    padding-bottom: 6rem;
  }
  
  .features-stack-right {
    width: 100%;
    height: auto;
    margin-top: 3rem;
  }
  
  .feature-card {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
    top: auto !important;
    left: auto !important;
  }
}

@media (max-width: 992px) {
  .features-title h1 {
    font-size: 3.5rem;
  }
  
  .features-content-left h3 {
    font-size: 2.2rem;
  }
  
  .features-content-left p {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .features-section {
    padding: 4rem 2rem;
  }
  
  .features-title h1 {
    font-size: 3rem;
    margin-top: 2rem;
  }
  
  .features-content-left {
    padding: 1rem;
  }
  
  .feature-card {
    height: 130px;
  }
}

@media (max-width: 576px) {
  .features-title h1 {
    font-size: 2.5rem;
  }
  
  .features-content-left h3 {
    font-size: 2rem;
  }
  
  .features-content-left p {
    font-size: 1rem;
    max-width: 100%;
  }
  
  .feature-card {
    height: 110px;
  }
  
  .bg-float {
    width: 80px;
    height: 80px;
  }
}

@media (max-width: 400px) {
  .features-title h1 {
    font-size: 2.2rem;
  }
  
  .features-content-left h3 {
    font-size: 1.8rem;
  }
  
  .feature-card {
    height: 100px;
  }
}