/**
 * Scroll to Top Button
 * Floating button that appears when user scrolls down
 */

.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--color-primary, #008c45);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 140, 69, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  width: 56px;
  height: 56px;
}

.scroll-to-top:hover {
  background-color: var(--color-primary-hover, #007038);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 140, 69, 0.4);
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
}

.scroll-to-top svg polyline {
  stroke: currentColor;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
  
  .scroll-to-top svg {
    width: 20px;
    height: 20px;
  }
}

/* Accessibility */
.scroll-to-top:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.scroll-to-top.bounce {
  animation: bounce 2s infinite;
}
