/**
 * Apple-Style Horizontal Scroll
 * Stunning horizontal scroll for Elite Seven indicators
 */

/* ============================================
   HORIZONTAL SCROLL CONTAINER
   ============================================ */

.horizontal-scroll-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 2rem 0 3rem;
  margin: 2rem 0;
}

.horizontal-scroll-track {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;

  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */

  /* Padding for scroll area - left-align first card, extra space on right */
  padding: 0 4rem 0 2rem;
}

.horizontal-scroll-track::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Product cards in horizontal scroll */
.horizontal-scroll-track .card.product {
  flex: 0 0 350px;
  min-width: 350px;
  max-width: 350px;
  scroll-snap-align: center;
  scroll-snap-stop: always;

  /* Simple opacity transition only */
  transition: opacity 0.25s ease-out;

  /* Slightly dimmed by default */
  opacity: 0.7;
}

/* Active/centered card */
.horizontal-scroll-track .card.product.active {
  opacity: 1;
}

/* ============================================
   NAVIGATION CONTROLS
   ============================================ */

.horizontal-scroll-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0 1rem;
}

/* Arrow buttons */
.scroll-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(91, 138, 255, 0.3);
  background: rgba(15, 20, 35, 0.9);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.scroll-arrow svg {
  width: 20px;
  height: 20px;
}

.scroll-arrow:hover:not(:disabled) {
  background: rgba(91, 138, 255, 0.2);
  border-color: rgba(91, 138, 255, 0.6);
}

.scroll-arrow:active:not(:disabled) {
  background: rgba(91, 138, 255, 0.3);
}

.scroll-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Scroll dots indicator */
.scroll-dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.scroll-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(91, 138, 255, 0.2);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.scroll-dot:hover {
  background: rgba(91, 138, 255, 0.4);
  transform: scale(1.2);
}

.scroll-dot.active {
  width: 24px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-color: rgba(91, 138, 255, 0.3);
}

/* ============================================
   PROGRESS BAR (Optional)
   ============================================ */

.scroll-progress {
  position: relative;
  width: 200px;
  height: 3px;
  background: rgba(91, 138, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto 1rem;
}

.scroll-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   PARALLAX EFFECT - REMOVED FOR PERFORMANCE
   Using simple opacity/scale instead of 3D transforms
   ============================================ */

/* ============================================
   ENTRANCE ANIMATIONS - REMOVED FOR PERFORMANCE
   Cards now just appear via scroll-reveal on container
   ============================================ */

/* ============================================
   TOUCH HINTS
   ============================================ */

.scroll-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1rem;
  opacity: 0.7;
  animation: fade-pulse 2s ease-in-out infinite;
}

@keyframes fade-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.9; }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .horizontal-scroll-track {
    padding: 0 1rem 0 1.5rem;
    gap: 1.5rem;
  }

  .horizontal-scroll-track .card.product {
    flex: 0 0 min(320px, 85vw);
    min-width: min(320px, 85vw);
    max-width: min(320px, 85vw);
  }

  /* Simplify on mobile - no parallax */
  .horizontal-scroll-track .card.product.parallax-left,
  .horizontal-scroll-track .card.product.parallax-right {
    transform: scale(0.95);
    opacity: 0.6;
  }

  /* Hide arrows on mobile, show dots only */
  .scroll-arrow {
    display: none;
  }

  .horizontal-scroll-nav {
    margin: 1rem 0;
  }
}

@media (max-width: 480px) {
  .horizontal-scroll-track .card.product {
    flex: 0 0 min(280px, 90vw);
    min-width: min(280px, 90vw);
    max-width: min(280px, 90vw);
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .horizontal-scroll-track {
    scroll-behavior: auto;
  }

  .horizontal-scroll-track .card.product,
  .scroll-arrow,
  .scroll-dot {
    animation: none !important;
    transition: opacity 0.2s ease;
  }

  .horizontal-scroll-track .card.product.parallax-left,
  .horizontal-scroll-track .card.product.parallax-right {
    transform: none;
  }
}

/* Focus styles for keyboard navigation */
.scroll-arrow:focus-visible,
.scroll-dot:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

.horizontal-scroll-track {
  -webkit-overflow-scrolling: touch;
  contain: layout style;
}

.horizontal-scroll-track .card.product {
  contain: layout style paint;
}
