/* ==========================================================================
   Scroll to Top Component - 3ABN Women's Conference
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

/* High specificity selector to completely override Foundation's html [type="button"] */
button.scroll-to-top,
html button[type="button"].scroll-to-top,
.scroll-to-top {
  position: fixed !important;
  bottom: 28px !important;
  right: 28px !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  border-radius: 50% !important;
  background-color: #5B799D !important;
  color: #FFFFFF !important;
  border: none !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(41, 61, 93, 0.3) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(16px) !important;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.2s ease,
              box-shadow 0.2s ease !important;
  z-index: 99999 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box !important;
}

button.scroll-to-top svg,
.scroll-to-top svg {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  stroke: #FFFFFF !important;
  fill: none !important;
  pointer-events: none !important;
  transition: transform 0.2s ease !important;
}

button.scroll-to-top:hover,
.scroll-to-top:hover {
  background-color: #293D5D !important;
  color: #FFFFFF !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 20px rgba(41, 61, 93, 0.4) !important;
}

button.scroll-to-top:hover svg,
.scroll-to-top:hover svg {
  transform: translateY(-2px) !important;
}

button.scroll-to-top:active,
.scroll-to-top:active {
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(41, 61, 93, 0.3) !important;
}

button.scroll-to-top:focus-visible,
.scroll-to-top:focus-visible {
  outline: 3px solid #813A7A !important;
  outline-offset: 3px !important;
}

/* State when user has scrolled down */
button.scroll-to-top.is-visible,
html button[type="button"].scroll-to-top.is-visible,
.scroll-to-top.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  button.scroll-to-top,
  html button[type="button"].scroll-to-top,
  .scroll-to-top {
    bottom: 20px !important;
    right: 20px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
  }

  button.scroll-to-top svg,
  .scroll-to-top svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  button.scroll-to-top,
  button.scroll-to-top svg,
  .scroll-to-top,
  .scroll-to-top svg {
    transition: none !important;
    transform: none !important;
  }

  button.scroll-to-top:hover,
  button.scroll-to-top:active,
  .scroll-to-top:hover,
  .scroll-to-top:active {
    transform: none !important;
  }
}
