/* ===================================
   Carousel Component Styles
   WCAG 2.2 Compliant
   =================================== */

/* Base Carousel Container */
.carousel-container {
  position: relative;
  overflow: hidden;
  padding: 1rem 0;
}

/* Carousel Scroller - Uses CSS Scroll Snap */
.carousel-scroller {
  display: flex;
  gap: 1rem;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.carousel-scroller::-webkit-scrollbar {
  display: none;
}

/* Carousel Items */
.carousel-item {
  flex-shrink: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  width: calc(100% - 2rem);
}

/* Mobile: Full width items */
@media (max-width: 767px) {
  .carousel-item {
    width: calc(100% - 2rem);
  }
}

/* Tablet: 2 items visible */
@media (min-width: 768px) and (max-width: 1023px) {
  .carousel-item {
    width: calc(50% - 1rem);
  }
}

/* Desktop: 3 items visible */
@media (min-width: 1024px) {
  .carousel-item {
    width: calc(33.333% - 1rem);
  }
}

/* Navigation Buttons - WCAG 2.5.5 Target Size (44×44px minimum) */
.carousel-btn-prev,
.carousel-btn-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  min-width: 44px;
  min-height: 44px;
  padding: 12px;
  background: rgba(255, 215, 0, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFD700;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  touch-action: manipulation;
  border: 2px solid transparent;
}

.carousel-btn-prev:hover,
.carousel-btn-next:hover {
  background: #FFD700;
  color: #1A1A1A;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn-prev:focus,
.carousel-btn-next:focus {
  outline: none;
  border-color: #FFD700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

.carousel-btn-prev:disabled,
.carousel-btn-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.carousel-btn-prev {
  left: 1rem;
}

.carousel-btn-next {
  right: 1rem;
}

/* Pagination Indicators - WCAG 2.5.5 Target Size */
.carousel-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 1.5rem;
}

.carousel-indicator {
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
}

.carousel-indicator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.3);
  transition: all 0.3s ease;
}

.carousel-indicator.active::before {
  background: #FFD700;
  width: 16px;
  height: 16px;
}

.carousel-indicator:hover::before {
  background: rgba(255, 215, 0, 0.6);
  width: 14px;
  height: 14px;
}

.carousel-indicator:focus {
  outline: none;
}

.carousel-indicator:focus::before {
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

/* Counter Display */
.carousel-counter {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #AAAAAA;
}

/* Screen Reader Only - WCAG 2.2 */
.sr-only,
.carousel-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus Visible for Keyboard Navigation */
.carousel-container:focus-within .carousel-scroller {
  outline: 2px solid #FFD700;
  outline-offset: 4px;
}

/* Smooth Transitions */
.carousel-item,
.carousel-btn-prev,
.carousel-btn-next,
.carousel-indicator {
  transition: all 0.3s ease;
}

/* Loading State */
.carousel-container.loading .carousel-scroller {
  opacity: 0.5;
  pointer-events: none;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
  .carousel-btn-prev,
  .carousel-btn-next {
    min-width: 40px;
    min-height: 40px;
    padding: 10px;
  }
  
  .carousel-btn-prev {
    left: 0.5rem;
  }
  
  .carousel-btn-next {
    right: 0.5rem;
  }
}
