
<div class="whatsapp-float" onclick="window.open('https://wa.me/2348106405712', '_blank')">
    <i class="fab fa-whatsapp"></i>
</div>
<footer>
    <p>&copy; <?php echo date('Y'); ?> Schoolportal.ng. All rights reserved.</p>
</footer>

<script>
    AOS.init();
    function toggleMenu() {
        const navList = document.getElementById('nav-list');
        navList.classList.toggle('show');
    }

    // Add active class to clicked navigation link
    document.addEventListener('DOMContentLoaded', function() {
        const navLinks = document.querySelectorAll('.nav-link');
        const currentPage = window.location.pathname.split('/').pop() || 'index.php';
        
        // Set initial active state based on current page
        navLinks.forEach(link => {
            // Remove active class from all links
            link.classList.remove('active');
            
            // Check if we're on index.php (home page)
            if (currentPage === 'index.php' || currentPage === '') {
                // For home page, check if link is the main Home link
                if (link.getAttribute('href') === './' && !link.getAttribute('href').includes('#')) {
                    link.classList.add('active');
                }
            } else {
                // For other pages, check if link matches current page
                if (link.getAttribute('href') === currentPage) {
                    link.classList.add('active');
                }
            }
        });
        
        // Handle click events on navigation links
        navLinks.forEach(link => {
            link.addEventListener('click', function(e) {
                // Remove active class from all links
                navLinks.forEach(item => item.classList.remove('active'));
                
                // Add active class to clicked link
                this.classList.add('active');
            });
        });
        
        // Handle scroll events to update active state for section links
        const sections = document.querySelectorAll('section[id]');
        const sectionLinks = document.querySelectorAll('a[href^="./#"]');
        
        function updateActiveSection() {
            let currentSection = '';
            
            sections.forEach(section => {
                const sectionTop = section.offsetTop;
                if (window.scrollY >= sectionTop - 100) {
                    currentSection = section.getAttribute('id');
                }
            });
            
            if (currentPage === 'index.php' || currentPage === '') {
                sectionLinks.forEach(link => {
                    link.classList.remove('active');
                    if (link.getAttribute('href') === './#' + currentSection) {
                        link.classList.add('active');
                    }
                });
            }
        }
        
        // Update active section on scroll
        window.addEventListener('scroll', updateActiveSection);
        
        // Also update on page load
        updateActiveSection();
    });
    
    // Modal functionality
    function openModal(title, description, videoSrc) {
        // Only use modal on larger screens (not mobile)
        if (window.innerWidth > 768) {
            document.getElementById('modalTitle').innerText = title;
            document.getElementById('modalDescription').innerText = description;
            document.getElementById('modalVideo').src = videoSrc;
            document.getElementById('videoModal').style.display = 'block';
            document.body.style.overflow = 'hidden'; // Prevent background scrolling
        }
    }
    
    function closeModal() {
        document.getElementById('videoModal').style.display = 'none';
        document.getElementById('modalVideo').src = ''; // Stop video playback
        document.body.style.overflow = 'auto'; // Re-enable scrolling
    }
    
    // Close modal when clicking outside of it
    // Removed: Clicking outside modal no longer closes it
    
    // Close modal with Escape key
    // Removed: Pressing Escape key no longer closes it
</script>
</script>