    </div> <!-- Closing div for content-container -->
    
    <!-- Footer -->
    <footer class="footer-mobile-optimized py-3">
        <div class="container">
            <div class="footer-content d-flex flex-column flex-md-row align-items-center justify-content-center">
                <img src="images/Head_Logo1.png" class="footer-logo-mobile me-md-3 mb-2 mb-md-0" alt="District Logo" loading="lazy">
                <div class="footer-text text-center text-md-start small">
                    Copyright <sup>©</sup> <span id="currentYear"></span> - All Rights Reserved To E&SE District Kotli AK
                </div>
            </div>
                 <div class="footer-links" style="text-align:center">
                    <a href="index.php">Home</a> |
                    <a href="contact_us.php">Contact</a> |
                    <a href="privacy.php">Privacy Policy</a> |
                    <a href="terms.php">Terms of Service</a>
                </div>
        </div>
    </footer>

    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <style>
        /* Footer - Mobile Optimized with Unique Classes */
        .footer-mobile-optimized {
            background-color: var(--primary-color);
            color: white;
            padding: 1rem 0;
            font-size: 0.875rem;
            margin-top: auto;
        }
        
        .footer-logo-mobile {
            height: 35px;
            width: auto;
            max-width: 150px;
        }
        
        .footer-content {
            /* Additional footer content styles if needed */
        }
        
        .footer-text {
            /* Additional footer text styles if needed */
        }
        
        /* Ensure footer stays at bottom with unique classes */
        .footer-layout-helper {
            height: 100%;
        }
        
        .footer-body-wrapper {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }
        
        .footer-content-container {
            flex: 1 0 auto;
        }
        
        /* Mobile Responsive Footer */
        @media (max-width: 768px) {
            .footer-mobile-optimized {
                padding: 1.5rem 0 !important;
                font-size: 0.8rem;
            }
            
            .footer-logo-mobile {
                height: 30px;
                max-width: 120px;
                margin-bottom: 0.75rem !important;
            }
            
            .footer-content {
                gap: 0.5rem;
            }
        }
        
        @media (max-width: 576px) {
            .footer-mobile-optimized {
                padding: 1.25rem 0 !important;
                font-size: 0.75rem;
            }
            
            .footer-logo-mobile {
                height: 25px;
                max-width: 100px;
            }
            
            .footer-text {
                text-align: center !important;
                line-height: 1.4;
            }
        }
        
        @media (max-width: 380px) {
            .footer-mobile-optimized {
                padding: 1rem 0 !important;
                font-size: 0.7rem;
            }
            
            .footer-logo-mobile {
                height: 20px;
                max-width: 80px;
            }
        }
    </style>
    
    <script>
        // DOM Ready Function
        document.addEventListener('DOMContentLoaded', function() {
            // Set current year in footer
            document.getElementById('currentYear').textContent = new Date().getFullYear();
            
            // Set active nav item
            setActiveNavItem();
            
            // Mobile-specific enhancements
            handleMobileFooter();
            
            // Apply footer layout classes
            applyFooterLayout();
        });
        
        // Set active navigation item - IMPROVED VERSION
        function setActiveNavItem() {
            const currentPath = window.location.pathname.split('/').pop() || 'index.php';
            const homeLink = document.querySelector('.nav-link[href="index.php"]');
            
            // Reset all active states first
            document.querySelectorAll('.nav-link').forEach(link => {
                link.classList.remove('active');
            });
            
            // Define which pages belong to which dropdown
            const dropdownPages = {
                'summary': ['schools_info.php', 'teacher&staff_info.php', 'students_info.php', 'overall_info.php'],
                'private-schools': ['reg_schools.php', 'unreg_schools.php', 'blacklist_schools.php', 'reg_procedure.php']
            };
            
            // Check if current page belongs to a dropdown
            let parentDropdown = null;
            for (const [dropdownName, pages] of Object.entries(dropdownPages)) {
                if (pages.includes(currentPath)) {
                    parentDropdown = dropdownName;
                    break;
                }
            }
            
            if (parentDropdown) {
                // Highlight the parent dropdown
                const dropdownToggle = document.querySelector(`.nav-link.dropdown-toggle`);
                if (dropdownToggle && dropdownToggle.textContent.toLowerCase().includes(parentDropdown)) {
                    dropdownToggle.classList.add('active');
                }
            } else {
                // Set active based on current page for non-dropdown pages
                let activeFound = false;
                document.querySelectorAll('.nav-link').forEach(link => {
                    const linkPath = link.getAttribute('href')?.split('/').pop();
                    if (linkPath === currentPath) {
                        link.classList.add('active');
                        activeFound = true;
                    }
                });
                
                // If no active link found and we're on homepage, activate Home
                if (!activeFound && (currentPath === 'index.php' || currentPath === '')) {
                    homeLink.classList.add('active');
                }
            }
        }
        
        // Mobile footer enhancements
        function handleMobileFooter() {
            const footer = document.querySelector('.footer-mobile-optimized');
            
            // Add touch-friendly padding on mobile
            if (window.innerWidth <= 768) {
                footer.style.padding = '1.5rem 0';
            }
            
            // Handle orientation changes
            window.addEventListener('resize', function() {
                if (window.innerWidth <= 768) {
                    footer.style.padding = '1.5rem 0';
                } else {
                    footer.style.padding = '1rem 0';
                }
            });
        }
        
        // Apply footer layout classes to body and html
        function applyFooterLayout() {
            // Add classes to html and body for footer positioning
            document.documentElement.classList.add('footer-layout-helper');
            document.body.classList.add('footer-body-wrapper');
            
            // Find the main content container and add class
            const contentContainer = document.querySelector('.content-container');
            if (contentContainer) {
                contentContainer.classList.add('footer-content-container');
            }
        }
    </script>
</body>
</html>