/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 110px;
  right: 45px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  will-change: opacity, transform;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  animation: bounceIn 0.6s forwards;
}

.scroll-to-top:hover {
  background-color: #0056b3;
  transform: scale(1.1);
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 80px;
    right: 25px;
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
  }
}

/* Tablet (769px–1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .scroll-to-top {
    bottom: 95px;
    right: 35px;
    width: 45px;
    height: 45px;
    font-size: 1.4rem;
  }
}

/* Optional bounce-in animation */
@keyframes bounceIn {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }
  60% {
    transform: translateY(-10px);
    opacity: 1;
  }
  80% {
    transform: translateY(5px);
  }
  100% {
    transform: translateY(0);
  }
}
