/**
 * Swipe-to-action sliders — style @code_candy
 * pour · fuse · gravity · pop · ink · neon
 */

.lgk-swipe {
  --lgk-swipe-track: #141820;
  --lgk-swipe-ink: #e8edf5;
  --lgk-swipe-muted: rgba(232, 237, 245, 0.45);
  --lgk-swipe-accent: #22d3ee;
  --lgk-swipe-p: 0;
  --lgk-swipe-x: 0px;
  position: relative;
  width: 100%;
  max-width: 22rem;
  height: 3.35rem;
  border-radius: 999px;
  background: var(--lgk-swipe-track);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 28px rgba(0, 0, 0, 0.35);
  user-select: none;
  touch-action: none;
  overflow: hidden;
  isolation: isolate;
}

.lgk-swipe.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.lgk-swipe.is-done {
  border-color: color-mix(in srgb, var(--lgk-swipe-accent) 55%, transparent);
}

.lgk-swipe__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lgk-swipe-muted);
  pointer-events: none;
  transition: color 0.25s ease, opacity 0.25s ease, text-shadow 0.25s ease;
}

.lgk-swipe.is-dragging .lgk-swipe__label,
.lgk-swipe.is-done .lgk-swipe__label {
  color: var(--lgk-swipe-ink);
}

.lgk-swipe__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--lgk-swipe-p) * 100%);
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
}

.lgk-swipe__thumb {
  position: absolute;
  top: 50%;
  left: 0.28rem;
  z-index: 4;
  width: 2.7rem;
  height: 2.7rem;
  margin-top: -1.35rem;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: grab;
  background: #f8fafc;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transform: translate3d(var(--lgk-swipe-x), 0, 0);
  display: grid;
  place-items: center;
  transition: box-shadow 0.2s ease;
}

.lgk-swipe.is-dragging .lgk-swipe__thumb {
  cursor: grabbing;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.lgk-swipe__grip {
  display: flex;
  gap: 3px;
}

.lgk-swipe__grip i {
  width: 2px;
  height: 0.85rem;
  border-radius: 2px;
  background: #64748b;
}

/* ——— POUR (liquid) ——— */
.lgk-swipe--pour {
  --lgk-swipe-accent: #22d3ee;
}

.lgk-swipe--pour .lgk-swipe__fill {
  background: linear-gradient(90deg, #0891b2, #22d3ee 55%, #67e8f9);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 6px),
    96% 100%,
    90% calc(100% - 8px),
    84% 100%,
    78% calc(100% - 6px),
    72% 100%,
    66% calc(100% - 8px),
    60% 100%,
    54% calc(100% - 5px),
    48% 100%,
    42% calc(100% - 7px),
    36% 100%,
    30% calc(100% - 5px),
    24% 100%,
    18% calc(100% - 8px),
    12% 100%,
    6% calc(100% - 5px),
    0 100%
  );
  animation: lgk-swipe-wave 1.2s ease-in-out infinite;
}

@keyframes lgk-swipe-wave {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

/* ——— FUSE (ember trail) ——— */
.lgk-swipe--fuse {
  --lgk-swipe-accent: #f97316;
}

.lgk-swipe--fuse .lgk-swipe__fill {
  background: linear-gradient(90deg, #7c2d12, #ea580c 40%, #fbbf24);
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.45);
}

.lgk-swipe--fuse .lgk-swipe__thumb {
  background: radial-gradient(circle at 35% 30%, #fdba74, #ea580c 55%, #9a3412);
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.75), 0 6px 18px rgba(0, 0, 0, 0.35);
}

.lgk-swipe--fuse .lgk-swipe__grip i {
  background: rgba(255, 255, 255, 0.75);
}

.lgk-swipe--fuse::after {
  content: "";
  position: absolute;
  left: calc(var(--lgk-swipe-x) + 1.2rem);
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: -0.28rem;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow:
    -10px 0 8px #f97316,
    -18px 2px 10px #ea580c,
    -26px -1px 12px #fb923c;
  opacity: calc(var(--lgk-swipe-p) * 0.95);
  pointer-events: none;
  z-index: 3;
}

/* ——— GRAVITY (drain particles) ——— */
.lgk-swipe--gravity {
  --lgk-swipe-accent: #a855f7;
}

.lgk-swipe--gravity .lgk-swipe__fill {
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.15));
}

.lgk-swipe--gravity .lgk-swipe__drain {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  width: 1.55rem;
  height: 1.55rem;
  margin-top: -0.775rem;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #1e1030, #000 70%);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.35), 0 0 18px rgba(168, 85, 247, 0.45);
  z-index: 3;
  pointer-events: none;
}

.lgk-swipe--gravity .lgk-swipe__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: calc(0.25 + var(--lgk-swipe-p) * 0.75);
}

.lgk-swipe--gravity .lgk-swipe__particles span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 8px #a855f7;
  right: 1.1rem;
  top: 50%;
  animation: lgk-swipe-drain 1.1s ease-in infinite;
}

.lgk-swipe--gravity .lgk-swipe__particles span:nth-child(2) {
  animation-delay: 0.15s;
  width: 4px;
  height: 4px;
}
.lgk-swipe--gravity .lgk-swipe__particles span:nth-child(3) {
  animation-delay: 0.3s;
}
.lgk-swipe--gravity .lgk-swipe__particles span:nth-child(4) {
  animation-delay: 0.45s;
  width: 3px;
  height: 3px;
}
.lgk-swipe--gravity .lgk-swipe__particles span:nth-child(5) {
  animation-delay: 0.6s;
}

@keyframes lgk-swipe-drain {
  0% {
    transform: translate(-4.5rem, -8px) scale(1);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    transform: translate(0, 0) scale(0.2);
    opacity: 0;
  }
}

/* ——— POP (cork / fizz) ——— */
.lgk-swipe--pop {
  --lgk-swipe-accent: #f8fafc;
}

.lgk-swipe--pop .lgk-swipe__fill {
  background: linear-gradient(90deg, rgba(253, 224, 71, 0.15), rgba(255, 255, 255, 0.2));
}

.lgk-swipe--pop .lgk-swipe__cork {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  z-index: 3;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.5, 0.64, 1), opacity 0.25s ease;
}

.lgk-swipe--pop.is-done .lgk-swipe__cork {
  transform: translate(0.85rem, -1.4rem) rotate(28deg) scale(1.15);
  opacity: 0.35;
}

.lgk-swipe--pop.is-done::after {
  content: "";
  position: absolute;
  right: 0.8rem;
  top: 0.2rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 65%);
  animation: lgk-swipe-fizz 0.7s ease-out forwards;
  pointer-events: none;
  z-index: 5;
}

@keyframes lgk-swipe-fizz {
  0% {
    transform: scale(0.2);
    opacity: 1;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* ——— INK ——— */
.lgk-swipe--ink {
  --lgk-swipe-accent: #38bdf8;
}

.lgk-swipe--ink .lgk-swipe__fill {
  background: radial-gradient(
    circle at calc(var(--lgk-swipe-p) * 100%) 50%,
    rgba(56, 189, 248, 0.85) 0%,
    rgba(14, 165, 233, 0.45) 28%,
    rgba(2, 6, 23, 0.2) 58%,
    transparent 75%
  );
  width: 100%;
  filter: blur(0.5px);
  opacity: calc(0.35 + var(--lgk-swipe-p) * 0.65);
}

/* ——— NEON ——— */
.lgk-swipe--neon {
  --lgk-swipe-accent: #4ade80;
  border-color: rgba(74, 222, 128, 0.2);
}

.lgk-swipe--neon .lgk-swipe__label {
  color: transparent;
  -webkit-text-stroke: 1px rgba(74, 222, 128, 0.35);
  text-shadow: none;
}

.lgk-swipe--neon.is-dragging .lgk-swipe__label,
.lgk-swipe--neon.is-done .lgk-swipe__label {
  color: #bbf7d0;
  -webkit-text-stroke: 0;
  text-shadow:
    0 0 8px #4ade80,
    0 0 18px #22c55e,
    0 0 28px rgba(34, 197, 94, 0.55);
  animation: lgk-swipe-flicker 0.9s steps(2, end) infinite;
}

.lgk-swipe--neon .lgk-swipe__fill {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), rgba(74, 222, 128, 0.45));
  box-shadow: inset 0 0 12px rgba(74, 222, 128, 0.25);
}

.lgk-swipe--neon .lgk-swipe__thumb {
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35);
}

@keyframes lgk-swipe-flicker {
  0%,
  100% {
    opacity: 1;
  }
  40% {
    opacity: 0.55;
  }
  60% {
    opacity: 0.9;
  }
}

/* Slideshow progress (pour-style autoplay bar) */
.lgk-slideshow-progress {
  position: absolute;
  left: 50%;
  bottom: 2.85rem;
  transform: translateX(-50%);
  z-index: 5;
  width: min(92%, 18rem);
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  pointer-events: none;
}

.lgk-slideshow-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, #67e8f9);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.55);
  transition: width 0.1s linear;
}

.lgk-slideshow-progress__fill.is-running {
  animation: lgk-slideshow-pour var(--lgk-slide-ms, 10000ms) linear forwards;
}

@keyframes lgk-slideshow-pour {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lgk-swipe--pour .lgk-swipe__fill,
  .lgk-swipe--neon.is-dragging .lgk-swipe__label,
  .lgk-swipe--gravity .lgk-swipe__particles span,
  .lgk-slideshow-progress__fill.is-running {
    animation: none !important;
  }
}
