/* Axencia.co — Scroll to Top: Dark Glassmorphism, Sleek Animated */

.scroll-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.5) translateY(20px);
  transition: opacity 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              visibility 0.45s,
              transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.scroll-to-top-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dark glassmorphism button */
.scroll-to-top-btn {
  position: relative;
  width: 56px;
  height: 56px;
  transform-origin: center;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.scroll-to-top-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(6, 182, 212, 0.08) 100%);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.35s;
}

.scroll-to-top-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(6, 182, 212, 0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s;
}

.scroll-to-top:hover .scroll-to-top-btn {
  transform: scale(1.05);
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(59, 130, 246, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.scroll-to-top:hover .scroll-to-top-btn::before,
.scroll-to-top:hover .scroll-to-top-btn::after {
  opacity: 1;
}

.scroll-to-top:active .scroll-to-top-btn {
  transform: scale(0.96);
}

/* Arrow */
.scroll-to-top-arrow {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scroll-to-top-arrow::before,
.scroll-to-top-arrow::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 9px;
  height: 2px;
  background: #93c5fd;
  border-radius: 1px;
  transform-origin: left center;
  box-shadow: 0 0 6px rgba(147, 197, 253, 0.5);
}

.scroll-to-top-arrow::before {
  top: 5px;
  transform: translateX(-50%) rotate(-45deg);
}

.scroll-to-top-arrow::after {
  bottom: 5px;
  transform: translateX(-50%) rotate(45deg);
}

.scroll-to-top:hover .scroll-to-top-arrow {
  transform: translateY(-3px);
}

/* Pulse animation when visible */
.scroll-to-top.visible .scroll-to-top-btn {
  animation: scrollBtnPulse 3s ease-in-out infinite;
}

@keyframes scrollBtnPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }
  50% { box-shadow: 0 8px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(59, 130, 246, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.05) inset; }
}

@media (max-width: 768px) {
  .scroll-to-top { bottom: 20px; left: 20px; width: 50px; height: 50px; }
  .scroll-to-top-btn { width: 50px; height: 50px; border-radius: 14px; }
  .scroll-to-top-btn::after { border-radius: 15px; }
}
