/* Back to Top Button Component */

.back-to-top {
  position: fixed;
  bottom: var(--spacing-xl);
  left: var(--spacing-xl); /* Left in RTL is the visual right */
  width: 48px;
  height: 48px;
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-xl);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100px);
}

/* Show button when scrolled */
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hover effect */
.back-to-top:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Active (clicked) state */
.back-to-top:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Focus state for accessibility */
.back-to-top:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

/* Arrow icon */
.back-to-top::before {
  content: '↑';
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: var(--spacing-lg);
    left: var(--spacing-lg);
    font-size: var(--font-size-lg);
  }

  .back-to-top::before {
    font-size: 20px;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .back-to-top {
    width: 46px;
    height: 46px;
  }
}

/* Print - Hide button */
@media print {
  .back-to-top {
    display: none;
  }
}
