/**
 * Stats Carousel - EXACT copy from gradientslider-main/styles.css
 */

:root {
  --bg: #010101;
  --fg: #f0f0f0;
  --perspective: 1800px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stage */
.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  perspective: var(--perspective);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Loader overlay */
.loader {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #010101;
  transition: opacity 0.2s var(--ease), visibility 0.2s linear;
}
.loader--hide {
  opacity: 0;
  visibility: hidden;
}
.loader__content {
  display: grid;
  gap: 12px;
  justify-items: center;
  min-width: 220px;
}
.loader__ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #ddd;
  border-top-color: #333;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Background canvas (moving gradient) */
#bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* Reduced blur for better performance */
  filter: blur(12px);
  pointer-events: none;
}

/* Full blur only on capable devices */
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  #bg {
    filter: blur(24px) saturate(1.05);
  }
}

/* Section title */
.stage__title {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-family: 'Fira Sans', var(--font-primary), sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 600;
  color: #fff;
  text-align: center;
  margin: 0;
  padding: 0 1rem;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Only block native scrolling/gestures in carousel mode */
.stage.carousel-mode {
  touch-action: none;
  cursor: grab;
}
.stage.carousel-mode.dragging {
  cursor: grabbing;
}

/* Cards container */
.cards {
  position: absolute;
  inset: 0;
  z-index: 10;
  transform-style: preserve-3d;
}

/* Card */
.card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(26vw, 360px);
  aspect-ratio: 4/5;
  isolation: isolate;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, filter;
  transform-origin: 90% center;
  contain: layout paint;
}

.card__img {
  border-radius: 15px;
  opacity: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* Card content overlay */
.card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  border-radius: 0 0 15px 15px;
  pointer-events: none;
  z-index: 2;
}

.card__title {
  font-family: 'Fira Sans', var(--font-primary), sans-serif;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.25rem;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card__subtitle {
  font-family: 'Fira Sans', var(--font-primary), sans-serif;
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Tablet */
@media (max-width: 1024px) {
  .card {
    width: min(32vw, 340px);
  }
}

@media (max-width: 900px) {
  .card {
    width: min(40vw, 300px);
  }

  .stage__title {
    font-size: clamp(1.25rem, 4vw, 2rem);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .stage__title {
    top: 10%;
    font-size: clamp(1.25rem, 5vw, 2rem);
    white-space: normal;
    max-width: 90%;
  }

  .card {
    width: min(55vw, 280px);
  }

  .card__content {
    padding: 1rem;
  }

  .card__title {
    font-size: clamp(0.9rem, 3.5vw, 1.2rem);
  }

  .card__subtitle {
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  }
}

@media (max-width: 480px) {
  .card {
    width: min(65vw, 250px);
  }

  .stage__title {
    top: 8%;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none !important;
    animation: none !important;
  }
}
