/* ========================================
   CAROUSEL.CSS - Image Carousel Styles
   ======================================== */

.carousel {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--color-bg-dark);
}

/* ===== CAROUSEL SLIDES ===== */
.carousel-slides {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.carousel-slide--active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== CAROUSEL CONTROLS ===== */
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.5);
  border: var(--border-width) solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: var(--color-text);
  font-size: var(--font-size-2xl);
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-control:hover {
  background-color: rgba(74, 198, 255, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.carousel-control:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-control--prev {
  left: var(--spacing-md);
}

.carousel-control--next {
  right: var(--spacing-md);
}

/* ===== CAROUSEL INDICATORS ===== */
.carousel-indicators {
  position: absolute;
  bottom: var(--spacing-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--spacing-sm);
  z-index: 2;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: var(--border-width) solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

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

.carousel-indicator--active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.2);
}

/* ===== PAUSE ON HOVER ===== */
.carousel:hover .carousel-slide--active {
  /* Pause animation on hover - controlled via JS */
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 767px) {
  .carousel-control {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-xl);
  }

  .carousel-control--prev {
    left: var(--spacing-sm);
  }

  .carousel-control--next {
    right: var(--spacing-sm);
  }

  .carousel-indicators {
    bottom: var(--spacing-sm);
  }

  .carousel-indicator {
    width: 10px;
    height: 10px;
  }
}

/* ===== LOADING PLACEHOLDER ===== */
.carousel-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-bg-card) 0%,
    rgba(74, 198, 255, 0.1) 50%,
    var(--color-bg-card) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  z-index: 0;
}

.carousel-slide--active::before {
  display: none;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
