@use '../variables' as *;
@use '../globals';

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-on-dark); // #E6F1FB – white on dark navy
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100px);
  z-index: 999;

  &--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  }

  &:focus {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
  }

  &:active {
    transform: translateY(-2px);
  }

  &__icon {
    width: 1.5rem;
    height: 1.5rem;
  }
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;

    &__icon {
      width: 1.25rem;
      height: 1.25rem;
    }
  }
}
