/* Stuck State Demo - Navbar style */

/* Scroll State Query Version */
.stuck-sticky {
  position: sticky;
  top: 0;
  z-index: 1;
  container-type: scroll-state;
}

.stuck-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  color: white;
  transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.stuck-nav-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.stuck-btn {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.stuck-btn:hover {
  opacity: 0.9;
}

.stuck-btn-light {
  background: white;
  color: #111;
}

.stuck-btn-dark {
  background: #111;
  color: white;
}

@container scroll-state(stuck: top) {
  .stuck-nav {
    background: white;
    color: #111;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
}

/* Scroll Driven Animation Version */
.scroll-driven-container {
  timeline-scope: --scroll-timeline;
}

.scroll-driven-container {
  scroll-timeline: --scroll-timeline y;
}

.scroll-driven-nav {
  color: white;
  background: transparent;
  animation: navbar-bg-fill linear both;
  animation-timeline: --scroll-timeline;
  animation-range: 0px 50px;
}

@keyframes navbar-bg-fill {
  from {
    background: transparent;
    color: white;
    box-shadow: none;
  }
  to {
    background: white;
    color: #111;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
}

/* Snapped State Demo */
.snapped-carousel {
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.snapped-carousel::-webkit-scrollbar {
  display: none;
}

.snapped-carousel-item {
  container-type: scroll-state;
  scroll-snap-align: center;
}

.snapped-card {
  opacity: 0.5;
  transform: scale(0.9);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

@container scroll-state(snapped: x) {
  .snapped-card {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  }
}

/* Scrollable State Demo */
.scrollable-container {
  container-type: scroll-state;
}

.scrollable-shadow-top,
.scrollable-shadow-bottom {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.scrollable-scroll-to-top {
  opacity: 0;
  translate: 0 0.5rem;
  transition: all 0.2s ease;
}

@container scroll-state(scrollable: top) {
  .scrollable-shadow-top {
    opacity: 1;
  }

  .scrollable-scroll-to-top {
    opacity: 1;
    translate: 0 0;
  }
}

@container scroll-state(scrollable: bottom) {
  .scrollable-shadow-bottom {
    opacity: 1;
  }
}
