/**
 * Scroll to Top Button Styles
 *
 * Standalone CSS file for the scroll-to-top button
 * to prevent conflicts with other theme styles
 *
 * Features:
 * - Fixed positioning at viewport
 * - Circular button design
 * - Smooth fade and lift animations
 * - Fully responsive
 * - Customizable via CSS variables
 */

/* ========== SCROLL TO TOP BUTTON WRAPPER ========== */
/* Main container - Fixed positioning relative to viewport */
.scroll-to-top-wrapper {
  position: fixed;
  bottom: 2rem;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

/* Position variants */
.scroll-to-top-wrapper.right {
  right: 2rem;
  left: unset;
}

.scroll-to-top-wrapper.left {
  left: 2rem;
  right: unset;
}

/* ========== SCROLL TO TOP BUTTON ========== */
/* Main button element */
.scroll-to-top-btn {
  position: relative;
  width: var(--scroll-to-top-width, 50px);
  height: var(--scroll-to-top-width, 50px);
  border-radius: 50%;
  background: var(--scroll-to-top-bg, #1a1a1a);
  color: var(--scroll-to-top-color, #ffffff);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  padding: 0;
}

/* Hover state */
.scroll-to-top-btn:hover,
.scroll-to-top-btn:focus {
  background: var(--scroll-to-top-hover-bg, #333333);
  color: var(--scroll-to-top-hover-color, #ffffff);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  outline: none;
}

/* Active/Click state */
.scroll-to-top-btn:active {
  transform: translateY(-1px);
}

/* ========== BUTTON ICON ========== */
/* Icon styling inside button */
.scroll-to-top-icon {
  font-size: 1.4rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
}

/* ========== TABLET RESPONSIVE (768px) ========== */
@media (max-width: 768px) {
  .scroll-to-top-wrapper.right {
    right: 1.5rem;
  }

  .scroll-to-top-wrapper.left {
    left: 1.5rem;
  }

  .scroll-to-top-btn {
    width: var(--scroll-to-top-width, 45px);
    height: var(--scroll-to-top-width, 45px);
  }

  .scroll-to-top-icon {
    font-size: 1.2rem;
  }
}

/* ========== MOBILE RESPONSIVE (480px) ========== */
@media (max-width: 480px) {
  .scroll-to-top-wrapper {
    bottom: 1rem;
  }

  .scroll-to-top-wrapper.right {
    right: 1rem;
  }

  .scroll-to-top-wrapper.left {
    left: 1rem;
  }

  .scroll-to-top-btn {
    width: var(--scroll-to-top-width, 40px);
    height: var(--scroll-to-top-width, 40px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  }

  .scroll-to-top-icon {
    font-size: 1rem;
  }
}

/* ========== ACCESSIBILITY ========== */
/* High contrast mode support */
@media (prefers-contrast: more) {
  .scroll-to-top-btn {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  }

  .scroll-to-top-btn:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  }
}

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

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

/* ========== VISIBLE STATE ========== */
/* Applied by JavaScript when button should be visible */
.scroll-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.scroll-to-top-btn.hidden {
  opacity: 0;
  pointer-events: none;
}
