<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AZ Tech Ninja Search</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            padding: 20px;
        }
        #searchResults {
            margin-top: 20px;
        }
        .result {
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
    <h1>Search AZ Tech Ninja</h1>
    <input type="text" id="searchInput" placeholder="Type to search..." oninput="performSearch()" style="width: 100%; padding: 10px;">
    <div id="searchResults"></div>

    <script>
        // Array of website pages
        const pages = [
            {
                title: "Home",
                url: "https://aztechninja.com",
                content: "Welcome to AZ Tech Ninja. We offer high-performance custom PCs and repairs. Services include computer repair, custom computers, virus and malware removal, system setup, hardware upgrades, web design, data recovery, backup solutions, network management, and system management."
            },
            {
                title: "Services",
                url: "https://aztechninja.com/services",
                content: "Our services include computer repair, custom computers, virus and malware removal, system setup, hardware upgrades, web design, data recovery, backup solutions, network management, and system management."
            },
            {
                title: "Contact Us",
                url: "https://aztechninja.com/contact",
                content: "Contact AZ Tech Ninja at 12121 West Saguaro Lane, El Mirage, AZ 85335. Phone: (602) 753-8627. Email: Support@AZTechNinja.com. Serving Phoenix, Scottsdale, Avondale, Surprise, Sun City, Litchfield, Cave Creek, Goodyear, and more."
            },
            // Add more pages as needed
        ];

        // Function to perform search
        function performSearch() {
            const query = document.getElementById('searchInput').value.toLowerCase();
            const results = pages.filter(page =>
                page.title.toLowerCase().includes(query) ||
                page.content.toLowerCase().includes(query)
            );
            displayResults(results);
        }

        // Function to display search results
        function displayResults(results) {
            const resultsContainer = document.getElementById('searchResults');
            resultsContainer.innerHTML = results.length
                ? results.map(page => `
                    <div class="result">
                        <a href="${page.url}" target="_blank">${page.title}</a>
                        <p>${page.content.substring(0, 150)}...</p>
                    </div>
                `).join('')
                : "<p>No results found.</p>";
        }
    </script>
</body>
</html>