/* Reset and base styles */
* {
  box-sizing: border-box;
}

.ax-hidden {
  visibility: hidden;
  position: absolute;
}

/* Carousel container with responsive design */
.carousel {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  overflow: hidden;
  position: relative; /* Allow absolute positioning of bottom controls */
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 600px; /* Increased height to accommodate controls at the bottom */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  cursor: grab;
  user-select: none;
}

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

/* Base carousel item styles with consistent sizing */
.carousel-item {
  position: absolute;
  width: 200px; /* Adjusted for consistency */
  height: 200px; /* Adjusted for consistency */
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
  z-index: 0;
}

/* Consistent image styling for all items */
.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4); /* More prominent shadow */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Position 1 - Far left */
.carousel-item-1 {
  left: 12%;
  opacity: 0; /* Start with 0 opacity */
  transform: translateX(-50%) scale(0.7); /* Slightly smaller scale */
  z-index: 1;
  border-radius: 10px;
  pointer-events: none; /* Keep pointer-events none to prevent interaction */
}

/* Position 2 - Left */
.carousel-item-2 {
  left: 14%;
  opacity: 0.7;
  transform: translateX(-50%) scale(0.9);
  width: 334px;
  height: 240px;
  z-index: 2;
  border-radius: 10px;
}

/* Position 3 - Center (featured) */
.carousel-item-3 {
  left: 50%;
  opacity: 1;
  transform: translateX(-50%) scale(1.2);
  width: 640px;
  height: 350px;
  z-index: 3;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  border-radius: 10px;
}

.carousel-item-3 img {
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 10px 20px rgba(0, 0, 0, 0.3); /* Enhanced shadow */
  filter: brightness(1.1) contrast(1.05); /* Slightly adjusted for dark background */
}

/* Position 4 - Right */
.carousel-item-4 {
  left: 86%;
  opacity: 0.7;
  transform: translateX(-50%) scale(0.9);
  width: 334px;
  height: 238px;
  z-index: 2;
  border-radius: 10px;
}

/* Position 5 - Far right */
.carousel-item-5 {
  left: 90%;
  opacity: 0; /* Start with 0 opacity */
  transform: translateX(-50%) scale(0.7); /* Slightly smaller scale */
  z-index: 1;
  pointer-events: none; /* Keep pointer-events none to prevent interaction */
}

/* Modern Navigation Controls */
.carousel-nav {
  position: absolute;
  width: 60px;
  height: 60px;
  /* Glassmorphism style */
  background: rgba(255, 255, 255, 0.18);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.12) 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #f0f0f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.3);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  z-index: 20;
  outline: none;
}

.carousel-nav:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.35);
}

.carousel-nav:active {
  transform: translateY(2px);
}

.carousel-nav:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.6);
}

.carousel-nav-prev {
  left: 50%;
  bottom: 50%;
  transform: translateX(-80px) translateY(50%);
}

.carousel-nav-next {
  left: 50%;
  bottom: 50%;
  transform: translateX(80px) translateY(50%);
}

.carousel-nav svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* Indicator Dots */
.carousel-indicators {
  position: absolute;
  bottom: 20px; /* Position at the bottom inside the container */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 20;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2); /* Subtle background */
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  outline: none;
}

.carousel-indicator:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.2);
}

.carousel-indicator.active {
  background: rgba(255, 255, 255, 0.8); /* More prominent when active */
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); /* Subtle glow */
}

.carousel-indicator:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.6);
}

/* Play button specific positioning */
.carousel-control-play {
  left: 50%;
  transform: translateX(-60px); /* Adjust to center it, further left */
  bottom: 20px; /* Position at the very bottom */
}

/* Add button specific positioning */
.carousel-control-add {
  left: 50%;
  transform: translateX(60px); /* Adjust to center it, further right */
  bottom: 20px; /* Position at the very bottom */
}

/* Play/Pause icon for play button */
.carousel-control-play svg {
  fill: #ccc;
}

/* Bottom Navigation Controls (HTML-based, centered, responsive) */
.carousel-bottom-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 20;
}

.carousel-bottom-btn {
  position: relative;
  width: 52px;
  height: 52px;
  /* Glassmorphism style */
  background: rgba(255, 255, 255, 0.18);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.12) 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #f0f0f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.3);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  outline: none;
}

.carousel-bottom-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.35);
}

.carousel-bottom-btn:active {
  transform: translateY(2px);
}

.carousel-bottom-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.6);
}

.carousel-bottom-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.5;
}

.carousel-control-play.playing svg {
  /* Pause icon - two vertical bars */
  content: '';
  width: 16px;
  height: 16px;
  background-color: #ccc;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.carousel-control-play.playing svg::before,
.carousel-control-play.playing svg::after {
  content: '';
  display: block;
  width: 6px;
  height: 16px;
  background-color: #ccc;
}

/* Add icon for add button */
.carousel-control-add svg {
  fill: #ccc;
}

/* Responsive design */
@media (max-width: 1024px) {
  .carousel-container {
    height: 450px;
    padding: 30px 15px;
  }
  
  .carousel-item {
    width: 300px;
    height: 150px;
  }
  
  .carousel-item-2,
  .carousel-item-4 {
    width: 320px;
    height: 160px;
  }
  
  .carousel-item-3 {
    width: 540px;
    height: 330px;
  }

  .carousel-nav {
    bottom: -70px;
  }

  .carousel-indicators {
    bottom: -70px;
  }

  .carousel-control-play,
  .carousel-control-add {
    bottom: -120px;
  }

  .carousel-bottom-controls {
    bottom: 16px;
    gap: 14px;
  }

  .carousel-bottom-btn {
    width: 46px;
    height: 46px;
  }
}

@media (max-width: 768px) {
  .carousel {
    padding: 15px;
  }
  
  .carousel-container {
    height: 350px;
    padding: 20px 10px;
  }
  
  .carousel-item {
    width: 120px;
    height: 120px;
  }
  
  .carousel-item-1 {
    left: 5%;
  }
  
  .carousel-item-2 {
    left: 14%;
    width: 140px;
    height: 140px;
  }
  
  .carousel-item-3 {
    width: 380px;
    height: 232px;
  }
  
  .carousel-item-4 {
    left: 86%;
    width: 140px;
    height: 140px;
  }
  
  .carousel-item-5 {
    left: 95%;
  }

  .carousel-nav {
    width: 40px;
    height: 40px;
    bottom: -60px;
  }
  
  .carousel-nav-prev {
    left: 50%;
    transform: translateX(-60px);
  }
  
  .carousel-nav-next {
    right: 50%;
    transform: translateX(60px);
  }
  
  .carousel-indicators {
    bottom: -60px;
    gap: 10px;
  }
  
  .carousel-indicator {
    width: 10px;
    height: 10px;
  }

  .carousel-control-play,
  .carousel-control-add {
    bottom: -100px;
  }
}

@media (max-width: 480px) {
  .carousel-container {
    height: 300px;
    padding: 15px 5px;
  }
  
  .carousel-item {
    width: 100px;
    height: 100px;
  }
  
  .carousel-item-1 {
    left: 2%;
    opacity: 0.2;
  }
  
  .carousel-item-2 {
    left: 15%;
    width: 120px;
    height: 120px;
  }
  
  .carousel-item-3 {
    width: 305px;
    height: 186px;
  }
  
  .carousel-item-4 {
    left: 85%;
    width: 120px;
    height: 120px;
  }
  
  .carousel-item-5 {
    left: 98%;
    opacity: 0.2;
  }
  
  .carousel-nav {
    width: 35px;
    height: 35px;
    bottom: -50px;
  }
  
  .carousel-nav-prev {
    left: 50%;
    transform: translateX(-50px);
  }
  
  .carousel-nav-next {
    right: 50%;
    transform: translateX(50px);
  }
  
  .carousel-indicators {
    bottom: -50px;
    gap: 8px;
  }
  
  .carousel-indicator {
    width: 8px;
    height: 8px;
  }

  .carousel-control-play,
  .carousel-control-add {
    bottom: -80px;
  }

  .carousel-bottom-controls {
    bottom: 12px;
    gap: 12px;
  }

  .carousel-bottom-btn {
    width: 40px;
    height: 40px;
  }
}