/* ============================================
   SCROLL-BASED NAVIGATION CAROUSEL
   Version: 1.0.0
   Standalone CSS for scroll-based carousel
   ============================================ */

/* CSS Variables */
:root {
  --carousel-bg: #000;
  --carousel-text: #f5f5f7;
  --carousel-text-secondary: #a1a1a6;
  --dot-inactive: rgba(255, 255, 255, 0.3);
  --dot-active: #fff;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   CAROUSEL BASE STRUCTURE
   ============================================ */

.carousel {
  width: 100%;
  max-width: 1920px;
  position: relative;
  padding: 40px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  gap: 48px 20px;
}

.carousel-viewport {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  overflow: hidden;
  position: relative;
  margin-bottom: 0;
}

.carousel-track {
  display: flex;
  align-items: center;
  transition: transform 0.7s var(--transition-smooth);
  will-change: transform;
  list-style: none;
  margin: 0;
  padding: 0;
}

.carousel-slide {
  flex-shrink: 0;
  opacity: 1;
  transition: opacity 0.4s var(--transition-smooth), transform 0.4s var(--transition-smooth);
}

/* ============================================
   SLIDE CONTAINER
   ============================================ */

.slide-container {
  border-radius: var(--border-radius, 24px);
  padding: 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Caption styles */
.slide-caption {
  margin-bottom: 20px;
}

.caption-title {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
  color: var(--carousel-text);
}

.caption-subtitle {
  font-size: clamp(14px, 1.5vw, 18px);
  color: var(--carousel-text-secondary);
  line-height: 1.4;
}

/* Media container */
.slide-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  border-radius: 12px;
  overflow: hidden;
}

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

/* Navigation and arrows row - use grid positioning */
.carousel-nav {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 8px 12px 8px 16px;
  border-radius: 50px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  min-height: 36px;
  width: fit-content;
  z-index: 100;
}

/* Navigation dots - wrapper for dots only */
.nav-dots {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  order: 1;
}

.nav-dot {
  width: 8px;
  min-width: 8px;
  height: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  transition:
    width 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    min-width 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    min-height 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
    border-radius 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  border: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-dot:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: scale(1.2) translateZ(0);
}

.nav-dot.active {
  width: 32px;
  min-width: 32px;
  height: 8px;
  min-height: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.nav-dot.active:hover {
  background: rgba(0, 0, 0, 0.25);
  transform: scaleY(1.15) translateZ(0);
}

/* Progress pill */
.pill-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  transition: width 0.1s linear;
  opacity: 0;
}

.nav-dot.active .pill-progress {
  width: 100%;
  opacity: 1;
}

.nav-dot.animating .pill-progress {
  transition: width linear;
  width: 100%;
  opacity: 1;
}

/* Play/Pause Button */
.play-pause-btn {
  width: 36px;
  min-width: 36px;
  max-width: 36px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 4px;
  order: 999;
}

.play-pause-btn:hover {
  background: rgba(0, 0, 0, 0.25);
  transform: scale(1.05) translateZ(0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.play-pause-btn:active {
  transform: scale(0.95) translateZ(0);
  background: rgba(0, 0, 0, 0.1);
}

.play-pause-btn:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 4px;
}

.play-pause-btn svg {
  width: 14px;
  height: 14px;
  color: rgba(0, 0, 0, 0.75);
}

/* ============================================
   ARROW CONTROLS
   ============================================ */

.carousel-arrows {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  align-self: center;
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  z-index: 50;
  margin-right: 40px;
}

.arrow-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(60, 60, 60, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--transition-smooth);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  padding: 0;
}

.arrow-btn:hover {
  background: rgba(80, 80, 80, 0.95);
  transform: scale(1.05);
}

.arrow-btn:active {
  transform: scale(0.95);
}

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

.arrow-btn:disabled:hover {
  background: rgba(60, 60, 60, 0.9);
  transform: scale(1);
}

.arrow-btn:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 4px;
}

.arrow-btn svg {
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1068px) {
  .carousel-controls-wrapper {
    margin-top: 24px;
    gap: 16px;
  }

  .carousel-arrows {
    gap: 8px;
  }

  .arrow-btn {
    width: 40px;
    height: 40px;
  }

  .arrow-btn svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 734px) {
  .page-wrapper {
    padding: 20px 10px;
  }

  .page-header {
    margin-bottom: 40px;
  }

  .carousel {
    padding: 20px 0;
  }

  .slide-container {
    padding: 2px;
  }

  .slide-media {
    min-height: 200px;
  }

  .carousel-controls-wrapper {
    margin-top: 20px;
    flex-direction: column;
    gap: 12px;
  }

  .carousel-nav {
    padding: 10px 16px;
    gap: 12px;
  }

  .carousel-arrows {
    margin-left: 0;
    gap: 6px;
  }

  .arrow-btn {
    width: 36px;
    height: 36px;
  }

  .arrow-btn svg {
    width: 16px;
    height: 16px;
  }
}

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

/* Focus styles */
*:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 2px;
}

/* Carousel slide height adjustments - flexible for any content */
    .carousel .slide-container {
      height: 100%;
      min-height: 500px;
      max-height: none;
      display: flex;
      flex-direction: column;
    }

    .carousel .slide-media {
      min-height: 400px;
      max-height: 450px;
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .carousel .slide-media img,
    .carousel .slide-media video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 12px;
    }

    /* Allow content to grow if needed (for cards with more text) */
    .carousel .slide-caption {
      flex-shrink: 0;
    }

    /* Responsive adjustments */
    @media (max-width: 1068px) {
      .carousel .slide-media {
        min-height: 350px;
        max-height: 400px;
      }

      .carousel .slide-container {
        min-height: 450px;
      }
    }

    @media (max-width: 734px) {
      .carousel .slide-media {
        min-height: 300px;
        max-height: 350px;
      }

      .carousel .slide-container {
        min-height: 400px;
      }
    }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .nav-dot {
    border: 2px solid currentColor;
  }

  .arrow-btn {
    border: 2px solid currentColor;
  }
}
