<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo isset($pageTitle) ? $pageTitle : 'E&SE Kotli'; ?></title>
    
    <!-- Include all assets from index.php -->
    <link rel="icon" href="images/favicon.ico" type="image/x-icon">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Montserrat:wght@400;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

    <style>
        :root {
            --primary-color: #2c3e50;
            --secondary-color: #3498db;
            --accent-color: #f39c12;
            --light-color: #ecf0f1;
            --dark-color: #2c3e50;
            --success-color: #27ae60;
        }
        
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        
        html {
            scroll-behavior: smooth;
            font-size: 16px;
        }
        
        body {
            font-family: 'Poppins', sans-serif;
            color: #333;
            line-height: 1.6;
            background-color: #f9f9f9;
            padding-top: 0 !important;
            width: 100%;
            min-width: 320px;
            max-width: 100vw;
            overflow-x: hidden;
        }
        
        /* Fluid typography */
        @media (min-width: 768px) {
            html {
                font-size: calc(16px + (20 - 16) * (100vw - 768px) / (1920 - 768));
            }
        }
        
        @media (min-width: 1920px) {
            html {
                font-size: 20px;
            }
        }
        
        /* Navigation */
		
		.dropdown-item.active {
			background-color: var(--accent-color);
			color: #fff !important;
			font-weight: 600;
		}
        .navbar {
            background-color: var(--primary-color);
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            padding: 0.5rem 1rem;
            position: fixed;
            top: 0;
            width: 100%;
            z-index: 1030;
        }
        
        .navbar-brand img {
            height: 35px;
            width: auto;
        }
        
        .nav-link {
            color: white;
            font-weight: 500;
            padding: 0.5rem 0.8rem;
            border-radius: 4px;
            transition: all 0.3s ease;
        }
        
        .nav-link:hover, .nav-link:focus {
            background-color: rgba(255,255,255,0.1);
            color: var(--accent-color);
        }
		
        	/* Style for active dropdown-toggle */
		.navbar-dark .navbar-nav .nav-link.dropdown-toggle.active {
			color: #ffcc00 !important;
			font-weight: bold;
			position: relative;
		}
		
		/* Optional: Add a visual indicator (like a bottom border or icon) */
		.navbar-dark .navbar-nav .nav-link.dropdown-toggle.active::after {
			content: " ▼";
			font-size: 0.6rem;
			color: #ffcc00;
		}
		
        /* Active nav item styles - this will override Bootstrap */
        .navbar-dark .navbar-nav .nav-link.active,
        .navbar-dark .navbar-nav .nav-link.show,
        .navbar-dark .navbar-nav .nav-item.show .nav-link {
            color: #ffcc00 !important;
            font-weight: bold;
            background-color: transparent !important;
        }
        
        /* Hover states */
        .navbar-dark .navbar-nav .nav-link.active:hover,
        .navbar-dark .navbar-nav .nav-link.active:focus {
            color: #ffdb4d !important;
        }
        
       
        .dropdown-menu {
            background-color: white;
            border: none;
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }
        
        /* Logo Table Styles */
        .logo-custom-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 56px; /* Height of navbar */
            background-color: white;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            border: none !important;
        }
        
        .logo-custom-table td {
            padding: 1rem;
            vertical-align: middle;
            border: none !important;
        }
        
        .logo-col-1, .logo-col-3 {
            text-align: center;
            width: 15%;
        }
        
        .logo-col-2 {
            text-align: center;
            width: 70%;
        }
        
        .logo-col-2 p {
            margin: 0.2rem 0;
            line-height: 1.1;
            font-family: 'Montserrat', sans-serif;
        }
        
        .main-title {
            font-size: clamp(1.5rem, 3.5vw, 2.5rem);
            font-weight: 700;
            color: #006600;
            text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.9);
            white-space: nowrap;
            margin-bottom: 0.5rem;
        }
        
        .sub-title {
            font-size: clamp(1rem, 2vw, 1.5rem);
            color: var(--dark-color);
        }
        
        .logo-custom-table img {
            max-width: 100%;
            height: auto;
        }
        
        /* Content Container */
        .content-container {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            padding: 30px;
            margin: 20px auto;
            max-width: 1200px;
        }
        
        .stylish-header {
            color: var(--primary-color);
            margin-bottom: 30px;
            position: relative;
            padding-bottom: 15px;
        }
        
        .stylish-header::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 3px;
            background: var(--accent-color);
        }
        
		/* Search Button and Searched Text */
		.search-input {
			width: 200px;
			border-top-right-radius: 0;
			border-bottom-right-radius: 0;
			border-right: none;
		}
		
		.search-btn {
			border-top-left-radius: 0;
			border-bottom-left-radius: 0;
			background-color: var(--accent-color);
			color: white;
		}
		
		.search-btn:hover {
			background-color: #e67e22;
		}
		/* Highlight the Searched Text */
		mark.highlighted {
			background-color: yellow;
			color: black;
			padding: 0 2px;
			border-radius: 3px;
		}       
        /* Responsive adjustments */
        @media (max-width: 992px) {
            .navbar-nav {
                padding-top: 1rem;
            }
            
            .nav-item {
                margin-bottom: 0.5rem;
            }
            
            .nav-buttons {
                margin: 1rem 0;
            }
            
            .logo-col-2 p {
                margin: 0.1rem 0;
                line-height: 1;
            }
            
            .main-title {
                font-size: clamp(1.3rem, 3.5vw, 2rem);
            }
            
            .sub-title {
                font-size: clamp(0.9rem, 1.8vw, 1.3rem);
            }
        }
        
        @media (max-width: 768px) {
            .logo-custom-table td {
                padding: 0.75rem;
            }
            
            .logo-col-1, .logo-col-3 {
                width: 20%;
            }
            
            .logo-col-2 {
                width: 60%;
            }
            
            .main-title {
                font-size: clamp(1.2rem, 3vw, 1.8rem);
                white-space: normal;
            }
            
            .sub-title {
                font-size: clamp(0.8rem, 1.6vw, 1.1rem);
            }
        }
        
        @media (max-width: 576px) {
            .logo-custom-table {
                display: flex;
                flex-direction: column;
            }
            
            .logo-custom-table tr {
                display: flex;
                flex-direction: column;
                align-items: center;
            }
            
            .logo-custom-table td {
                width: 100% !important;
                text-align: center !important;
                padding: 0.5rem;
            }
            
            .main-title {
                font-size: 1.3rem;
            }
            
            .sub-title {
                font-size: 1rem;
            }
            
            .logo-col-1, .logo-col-3 {
                width: 30%;
            }
            
            .logo-col-2 {
                width: 100%;
                order: -1;
                margin-bottom: 0.5rem;
            }
            
            .content-container {
                padding: 15px;
            }
        }
		
    </style>
</head>

<body>

    <!-- Navigation -->
    <nav class="navbar navbar-expand-lg navbar-dark fixed-top">
        <div class="container-fluid">
            <a class="navbar-brand d-lg-none" href="#">
            	<img src="images/Head_Logo1.png" alt="Logo">
                </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="mainNav">
                <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                    <li class="nav-item"><a class="nav-link" href="index.php">Home</a></li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Summary</a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="schools_info.php">Schools</a></li>
                            <li><a class="dropdown-item" href="teacher&staff_info.php">Teachers & Staff</a></li>
                            <li><a class="dropdown-item" href="students_info.php">Students</a></li>
                            <li><a class="dropdown-item" href="overall_info.php">Overall Summary</a></li>
                        </ul>
                    </li>
                    <li class="nav-item"><a class="nav-link" href="org_chart.php">Org Chart</a></li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">Private Schools</a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="reg_schools.php">Registered</a></li>
                            <li><a class="dropdown-item" href="unreg_schools.php">Unregistered</a></li>
                            <li><a class="dropdown-item" href="blacklist_schools.php">Blacklist</a></li>
                            <li><a class="dropdown-item" href="reg_procedure.php">Procedure</a></li>
                        </ul>
                    </li>
                    <li class="nav-item"><a class="nav-link" href="notification_show.php">Notifications</a></li>
                    <li class="nav-item"><a class="nav-link" href="gallery_show.php">Gallery</a></li>
                    <li class="nav-item"><a class="nav-link" href="contact_us.php">Contact</a></li>
                </ul>

                <div class="d-flex align-items-center flex-nowrap gap-2">
                	<div class="dropdown">
    	<button class="btn btn-outline-light btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> Log In
    </button>
    <ul class="dropdown-menu">
        <li><a class="dropdown-item" href="login.php">School Login</a></li>
        <li><a class="dropdown-item" href="login_emp.php">Employee Login</a></li>
    </ul>
				</div>
                
                    <div class="dropdown">
    <button class="btn btn-primary btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
        Register
    </button>
    <ul class="dropdown-menu">
        <li><a class="dropdown-item" href="register.php">School Registration</a></li>
        <li><a class="dropdown-item" href="register_emp.php">Employee Registration</a></li>
    </ul>
			</div> 
            
             <div class="input-group input-group-sm" style="width: 220px;">
                        <input type="text" class="form-control search-input" placeholder="Search Site..." id="searchInput">
                        <button class="btn search-btn" id="searchBtn"><i class="fas fa-search"></i></button>
                    </div>
                </div>
            </div>
        </div>
    </nav>

    <!-- Logo Table -->
    <table class="logo-custom-table">
        <tbody>
            <tr>
                <td class="logo-col-1">
                    <img src="images/Head_Logo1.png" alt="District Logo" loading="lazy">
                </td>
                <td class="logo-col-2">
                    <div class="main-title">DISTRICT SCHOOL'S INFORMATION SYSTEM</div>
                    <p class="sub-title"><strong>A Project of Elementary &amp; Secondary Education</strong></p>
                    <p class="sub-title">District Kotli AJ&amp;K</p>
                </td>
                <td class="logo-col-3">
                    <img src="images/Head_Logo2.png" alt="Government Logo" loading="lazy">
                </td>
            </tr>
        </tbody>
    </table>
        
<script>
document.addEventListener('DOMContentLoaded', function () {
    const currentPath = window.location.pathname.split('/').pop(); // e.g., students_info.php

    document.querySelectorAll('.dropdown-item').forEach(function (dropdownItem) {
        const hrefPath = dropdownItem.getAttribute('href').split('/').pop();

        if (currentPath === hrefPath) {
            // Mark the clicked dropdown-item active
            dropdownItem.classList.add('active');

            // Traverse up to the closest nav-item.dropdown
            const parentDropdownItem = dropdownItem.closest('li.nav-item.dropdown');
            if (parentDropdownItem) {
                const toggle = parentDropdownItem.querySelector('.dropdown-toggle');
                if (toggle) {
                    toggle.classList.add('active');
                    toggle.setAttribute('aria-current', 'page');
                }
            }
        }
    });
});
</script>

<script>
    // Search Functionality
    document.addEventListener('DOMContentLoaded', function() {
        const searchBtn = document.getElementById('searchBtn');
        const searchInput = document.getElementById('searchInput');
        
        // Handle search button click
        searchBtn.addEventListener('click', function(e) {
            e.preventDefault();
            performSearch();
        });
        
        // Handle Enter key in search input
        searchInput.addEventListener('keypress', function(e) {
            if (e.key === 'Enter') {
                e.preventDefault();
                performSearch();
            }
        });
        
        function performSearch() {
            const searchTerm = searchInput.value.trim();
            if (searchTerm) {
                window.location.href = `search_site.php?query=${encodeURIComponent(searchTerm)}`;
            } else {
                alert('Please enter a search term');
            }
        }
    });
</script>


    <!-- Main Content Container -->
    <div class="content-container animate__animated animate__fadeIn">