/* Stacked Carousel Styles */
.stacked-carousel-container {
  perspective: 1000px;
  overflow: hidden;
}

.stacked-carousel {
  position: relative;
  width: 300px;
  height: 500px;
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  border-radius: 24px;
  overflow: hidden;
  scroll-snap-type: x mandatory;
}

/* Fade out animation for disappearing slides */
.carousel-slide.fade-out {
  opacity: 0 !important;
  transform: scale(0.8) !important;
  transition: all 0.4s ease-out !important;
}

/* Fade in animation for appearing slides */
.carousel-slide.fade-in {
  opacity: 1 !important;
  transition: all 0.6s ease-out !important;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Stacking positions - 3 visible: left, center, right */
.carousel-slide[data-index="0"] {
  transform: translateX(0) translateZ(0) scale(1);
  z-index: 4;
  opacity: 1;
  visibility: visible;
}

.carousel-slide[data-index="1"] {
  transform: translateX(80px) translateZ(-50px) scale(0.95);
  z-index: 3;
  opacity: 1;
  visibility: visible;
}

.carousel-slide[data-index="2"] {
  transform: translateX(-80px) translateZ(-50px) scale(0.95);
  z-index: 2;
  opacity: 1;
  visibility: hidden;
}

.carousel-slide[data-index="3"] {
  transform: translateX(-80px) translateZ(-50px) scale(0.95);
  z-index: 2;
  opacity: 1;
  visibility: visible;
}

/* Hide other positions */
.carousel-slide[data-index="4"],
.carousel-slide[data-index="-1"] {
  visibility: hidden;
  opacity: 1;
}

/* Navigation dots */
.carousel-dots {
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(79, 70, 229, 0.5);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot:hover {
  background-color: rgba(79, 70, 229, 0.8);
  transform: scale(1.2);
}

.dot.active {
  background-color: rgb(79, 70, 229);
  transform: scale(1.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .stacked-carousel {
    width: 250px;
    height: 400px;
  }
}

/* Touch/swipe support */
.stacked-carousel {
  touch-action: pan-y;
  cursor: grab;
  transition: transform 0.2s ease-out;
}

.stacked-carousel:active {
  cursor: grabbing;
}

.carousel-slide {
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* Enhanced mobile touch targets */
@media (max-width: 768px) {
  .stacked-carousel-container {
    padding: 20px;
  }
  
  .carousel-slide {
    border-radius: 20px;
  }
  
  .carousel-image {
    border-radius: 20px;
  }
  
  /* Larger touch targets for dots on mobile */
  .dot {
    width: 16px;
    height: 16px;
    margin: 0 4px;
  }
}

/* Improved visual feedback */
.stacked-carousel.dragging {
  transition: transform 0.1s ease-out;
}

.stacked-carousel:not(.dragging) {
  transition: transform 0.3s ease-out;
}

.carousel-slide {
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}