{% macro jslibs() -%}
<script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>

<!-- Finance Theme Custom JavaScript -->
<script>
    // Finance Theme Enhancement Scripts
    document.addEventListener("DOMContentLoaded", function () {
        // Active navigation tab highlighting
        const currentPath = window.location.pathname
        const navLinks = document.querySelectorAll(".finance-tab")

        navLinks.forEach((link) => {
            if (link.href === window.location.href || currentPath.startsWith(link.pathname)) {
                link.classList.add("active")
            }
        })

        // Smooth scroll for anchor links
        document.querySelectorAll('a[href^="#"]').forEach((anchor) => {
            anchor.addEventListener("click", function (e) {
                e.preventDefault()
                const target = document.querySelector(this.getAttribute("href"))
                if (target) {
                    target.scrollIntoView({
                        behavior: "smooth",
                        block: "start",
                    })
                }
            })
        })

        // Finance-style hover effects for cards
        const cards = document.querySelectorAll(".finance-course-card, .card")
        cards.forEach((card) => {
            card.addEventListener("mouseenter", function () {
                this.style.transform = "translateY(-2px)"
                this.style.boxShadow = "0 8px 25px rgba(30, 58, 138, 0.15)"
            })

            card.addEventListener("mouseleave", function () {
                this.style.transform = "translateY(0)"
                this.style.boxShadow = "0 2px 10px rgba(0, 0, 0, 0.1)"
            })
        })

        // Toast-style notifications
        const alerts = document.querySelectorAll(".finance-alert")
        alerts.forEach((alert) => {
            setTimeout(() => {
                if (alert.classList.contains("show")) {
                    alert.classList.remove("show")
                    setTimeout(() => alert.remove(), 150)
                }
            }, 5000)
        })
    })
</script>
{% endmacro %}
