/**
 * Scroll to Top Button Styles
 */

.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: #18453b;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease, background-color 0.2s ease;
  z-index: 9999;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  outline: none;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background-color: #0f2e27;
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.scroll-to-top:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:focus {
  outline: 3px solid #00c24e;
  outline-offset: 3px;
}

.scroll-to-top::before {
  content: '↑';
  /* Fallback for older browsers */
  font-size: 24px;
  /* Responsive: min 20px (mobile), preferred 24px, max 28px (desktop) */
  font-size: clamp(1.25rem, 1.5rem + 0.25vw, 1.75rem) !important;
  font-weight: bold;
  line-height: 1;
}

/* Screen reader only text */
.scroll-to-top .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .scroll-to-top::before {
    /* Fallback for older browsers */
    font-size: 20px;
    /* Responsive: min 18px (mobile), preferred 20px, max 22px */
    font-size: clamp(1.125rem, 1.25rem + 0.15vw, 1.375rem) !important;
  }
}

@media (max-width: 576px) {
  .scroll-to-top {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }

  .scroll-to-top::before {
    /* Fallback for older browsers */
    font-size: 18px;
    /* Responsive: min 16px (small mobile), preferred 18px, max 20px */
    font-size: clamp(1rem, 1.125rem + 0.15vw, 1.25rem) !important;
  }
}

/* Animation for scroll behavior */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-to-top.show {
  animation: fadeInUp 0.3s ease forwards;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .scroll-to-top {
    transition: none;
    animation: none;
  }

  .scroll-to-top:hover {
    transform: none;
  }
}
