/* ========== BACK TO TOP BUTTON ========== */

/* Back to Top Button Container */
.back-to-top {
  position: fixed;
  bottom: 80px;
  right: 30px;
  width: 70px;
  height: 70px;
  background: #f8b36a;
  color: white;
  cursor: pointer;
  border-radius: 50%;
  border: 3px solid #194164;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition-duration: 1s;
  transition-property: border-top, border-left, border-bottom, border-right, box-shadow, transform, opacity, visibility;
  box-shadow: 0 6px 25px rgba(248, 179, 106, 0.5), 0 0 0 0 rgba(25, 65, 100, 0);
}

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

/* Hover effects */
.back-to-top:hover {
  border: 3px solid #194164;
  box-shadow: rgba(25, 65, 100, 0.5) 5px 5px, rgba(25, 65, 100, 0.4) 10px 10px, rgba(25, 65, 100, 0.3) 15px 15px, 0 0 20px rgba(25, 65, 100, 0.4);
  transform: translateY(-3px) scale(1.05);
}

/* Active/pressed state */
.back-to-top:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 3px 15px rgba(25, 65, 100, 0.4);
}

/* Font Awesome Circle Arrow Up Icon */
.back-to-top::before {
  content: '\f0aa';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 70px;
  color: #194164;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: block;
}

/* Back to Top text - positioned below the circle */
.back-to-top::after {
  content: 'Back to Top';
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #194164;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(25, 65, 100, 0.2);
}

/* Focus styles for accessibility */
.back-to-top:focus {
  outline: 2px solid #f39c12;
  outline-offset: 2px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .back-to-top {
    bottom: 50px;
    right: 20px;
    width: 55px;
    height: 55px;
    background: #f8b36a;
    border: 3px solid #194164;
  }
  
  .back-to-top::before {
    font-size: 55px;
  }
  
  .back-to-top::after {
    font-size: 10px;
    font-weight: 700;
    bottom: -28px;
    padding: 3px 7px;
  }
}

@media (max-width: 576px) {
  .back-to-top {
    bottom: 60px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: #f8b36a;
    border: 3px solid #194164;
  }
  
  .back-to-top::before {
    font-size: 50px;
  }
  
  .back-to-top::after {
    font-size: 9px;
    font-weight: 700;
    bottom: -27px;
    padding: 3px 6px;
  }
}

/* Animation for smooth appearance */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.back-to-top.visible {
  animation: fadeInUp 0.3s ease-out;
}

/* Pulse animation for attention */
@keyframes pulse {
  0% {
    box-shadow: 0 6px 25px rgba(248, 179, 106, 0.5), 0 0 0 0 rgba(25, 65, 100, 0);
  }
  50% {
    box-shadow: 0 6px 25px rgba(248, 179, 106, 0.5), 0 0 0 12px rgba(25, 65, 100, 0.3);
  }
  100% {
    box-shadow: 0 6px 25px rgba(248, 179, 106, 0.5), 0 0 0 0 rgba(25, 65, 100, 0);
  }
}

/* Add pulse animation on first appearance */
.back-to-top.pulse {
  animation: pulse 2s ease-in-out;
}
