<?php
/**
 * The template for displaying the footer.
 *
 * Contains the body & html closing tags.
 *
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
get_template_part( 'template-parts/footer' );
?>

<!-- Scroll‑to‑Top Button -->
<a href="#" id="scrollTopBtn" class="scroll-to-top" aria-label="Scroll to top">
	<span class="dashicons dashicons-arrow-up-alt2"></span>
</a>

<style>
#scrollTopBtn {
	position: fixed;
	bottom: 30px;
	right: 30px;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #00ff9d; /* Parrot Green */
	color: white;
	font-size: 24px;
	box-shadow: 0 5px 15px rgba(0,0,0,0.2);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 999;
	text-decoration: none;
}
#scrollTopBtn:hover {
	background: white;
	color: #00ff9d;
}
#scrollTopBtn.show {
	opacity: 1;
	visibility: visible;
}
</style>

<script>
document.addEventListener("DOMContentLoaded", function () {
	const scrollBtn = document.getElementById("scrollTopBtn");
	window.addEventListener("scroll", function () {
		if (window.scrollY > 300) {
			scrollBtn.classList.add("show");
		} else {
			scrollBtn.classList.remove("show");
		}
	});
	scrollBtn.addEventListener("click", function (e) {
		e.preventDefault();
		window.scrollTo({
			top: 0,
			behavior: "smooth"
		});
	});
});
</script>

<?php wp_footer(); ?>
</body>
</html>
