/**
 * Infinite Scroll Component Styles
 * Base styles for the infinite horizontal scrolling component
 */

/* Base infinite scroll container */
.infinite-scroll {
  display: block;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: auto;
}

/* Common styling for scroll items */
.infinite-scroll img,
.infinite-scroll .scroll-item {
  display: block;
  flex-shrink: 0;
  height: auto;
  max-height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* Prevent interaction during scroll */
}

/* Ensure images maintain aspect ratio */
.infinite-scroll img {
  object-fit: cover;
}

/* Optional: Add hover pause functionality */
.infinite-scroll.pausable:hover .infinite-scroll-wrapper {
  animation-play-state: paused;
}

/* Predefined height variants */
.infinite-scroll.h-16 {
  height: 4rem;
}

.infinite-scroll.h-20 {
  height: 5rem;
}

.infinite-scroll.h-24 {
  height: 6rem;
}

.infinite-scroll.h-32 {
  height: 8rem;
}

.infinite-scroll.h-40 {
  height: 10rem;
}

.infinite-scroll.h-48 {
  height: 12rem;
}

.infinite-scroll.h-56 {
  height: 14rem;
}

.infinite-scroll.h-64 {
  height: 16rem;
}

/* Speed variants via CSS custom properties (optional - can be overridden by JS) */
.infinite-scroll.speed-slow {
  --scroll-speed: 30;
}

.infinite-scroll.speed-normal {
  --scroll-speed: 50;
}

.infinite-scroll.speed-fast {
  --scroll-speed: 80;
}

.infinite-scroll.speed-very-fast {
  --scroll-speed: 120;
}

/* Direction helpers */
.infinite-scroll.direction-right {
  --scroll-direction: right;
}

.infinite-scroll.direction-left {
  --scroll-direction: left;
}

/* Spacing variants */
.infinite-scroll.gap-sm {
  --scroll-gap: 10;
}

.infinite-scroll.gap-md {
  --scroll-gap: 20;
}

.infinite-scroll.gap-lg {
  --scroll-gap: 30;
}

.infinite-scroll.gap-xl {
  --scroll-gap: 40;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .infinite-scroll {
    height: auto;
    min-height: 3rem;
  }

  .infinite-scroll img {
    max-height: 3rem;
  }
}

@media (max-width: 480px) {
  .infinite-scroll {
    min-height: 2.5rem;
  }

  .infinite-scroll img {
    max-height: 2.5rem;
  }
}

/* Loading state */
.infinite-scroll.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 2s infinite;
}

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

/* Dark mode support */
.dark .infinite-scroll.loading {
  background: linear-gradient(90deg, #2a2a2a 25%, #1a1a1a 50%, #2a2a2a 75%);
  background-size: 200% 100%;
}

/* Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .infinite-scroll,
  .infinite-scroll * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .infinite-scroll {
    overflow: visible;
    height: auto;
  }

  .infinite-scroll .infinite-scroll-wrapper {
    transform: none !important;
    animation: none !important;
  }
}
