/* Scroll affordance for tall SweetAlert2 HTML bodies */

.swal2-html-container:has(.scrollable-swal-zone) {
  overflow: visible !important;
  max-height: none !important;
}

.scrollable-swal-zone {
  --scrollable-swal-bg: #fff;
  --scrollable-swal-fade-size: 2rem;
  width: 100%;
}

.scrollable-swal-zone__shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 0.25rem;
}

.scrollable-swal-zone__viewport {
  max-height: min(60vh, 26rem);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.15rem 0.35rem 0.35rem 0;
  -webkit-overflow-scrolling: touch;
  outline: none;
  position: relative;
  z-index: 0;
}

.member-package-save-confirm .scrollable-swal-zone__viewport {
  max-height: min(60vh, 26rem);
}

.scrollable-swal-zone__content {
  position: relative;
  z-index: 0;
}

.scrollable-swal-zone__fade {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--scrollable-swal-fade-size);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.scrollable-swal-zone__fade--top {
  top: 0;
  background: linear-gradient(
    to bottom,
    var(--scrollable-swal-bg) 0%,
    color-mix(in srgb, var(--scrollable-swal-bg) 88%, transparent) 55%,
    transparent 100%
  );
}

.scrollable-swal-zone__fade--bottom {
  bottom: 0;
  background: linear-gradient(
    to top,
    var(--scrollable-swal-bg) 0%,
    color-mix(in srgb, var(--scrollable-swal-bg) 88%, transparent) 55%,
    transparent 100%
  );
}

.scrollable-swal-zone__hint {
  margin: 0.35rem 0 0;
  padding: 0.15rem 0.5rem 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #6e6b7b;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.2s ease, margin 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.scrollable-swal-zone__hint-icon {
  display: inline-block;
  font-size: 0.85rem;
  line-height: 1;
  animation: scrollable-swal-hint-nudge 1.6s ease-in-out infinite;
}

.scrollable-swal-zone.is-scrollable.has-more-below .scrollable-swal-zone__fade--bottom {
  opacity: 1;
}

.scrollable-swal-zone.is-scrollable.has-more-above .scrollable-swal-zone__fade--top {
  opacity: 1;
}

.scrollable-swal-zone.is-scrollable.has-more-below .scrollable-swal-zone__hint {
  opacity: 1;
  max-height: 2rem;
  margin-top: 0.35rem;
}

.dark-layout .scrollable-swal-zone {
  --scrollable-swal-bg: #283046;
}

.dark-layout .scrollable-swal-zone .scrollable-swal-zone__hint {
  color: #b4b7bd;
}

.swal2-html-container .scrollable-swal-zone {
  --scrollable-swal-bg: #fff;
}

.dark-layout .swal2-html-container .scrollable-swal-zone {
  --scrollable-swal-bg: #283046;
}

@keyframes scrollable-swal-hint-nudge {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scrollable-swal-zone__fade,
  .scrollable-swal-zone__hint,
  .scrollable-swal-zone__hint-icon {
    transition: none;
    animation: none;
  }
}

@supports not (background: color-mix(in srgb, #fff 88%, transparent)) {
  .scrollable-swal-zone__fade--top {
    background: linear-gradient(to bottom, var(--scrollable-swal-bg) 15%, transparent 100%);
  }

  .scrollable-swal-zone__fade--bottom {
    background: linear-gradient(to top, var(--scrollable-swal-bg) 10%, transparent 100%);
  }
}
