the multilanguage is missing the greek and german and also upgrade it and add improvements and upgrades and provide with the full complete code without anything missing :

<?php
declare(strict_types=1);
session_start();

// Set Content-Type to HTML
header('Content-Type: text/html; charset=utf-8');

// Enhanced Content Security Policy
header("Content-Security-Policy: default-src 'self'; script-src 'self' https://pagead2.googlesyndication.com https://cdn.jsdelivr.net https://cdnjs.cloudflare.com 'unsafe-inline'; style-src 'self' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com 'unsafe-inline'; img-src 'self' https://source.unsplash.com https://*.media-feed.com data:; font-src 'self' https://cdnjs.cloudflare.com; connect-src 'self'; frame-src https://*.google.com https://*.doubleclick.net; frame-ancestors 'self'; base-uri 'self';");

// Strict Transport Security
header("Strict-Transport-Security: max-age=31536000; includeSubDomains; preload");

// Set other security headers
header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: SAMEORIGIN'); // For AdSense compatibility
header('Referrer-Policy: no-referrer-when-downgrade');

// Language Selection
if (isset($_GET['lang'])) {
    $_SESSION['lang'] = $_GET['lang'];
}

if (!isset($_SESSION['lang'])) {
    $_SESSION['lang'] = 'en'; // Default language
}

$lang = $_SESSION['lang'];

// Language Arrays
$lang_data = [
    'en' => [
        'code' => 'en',
        'name' => 'English',
        'title' => 'SkyPulse IT Services',
        'description' => 'Leading the way in IT solutions with innovation and excellence. Offering remote support, hardware repair, system architecture, and more.',
        'keywords' => 'IT Services, Remote Support, Hardware Repair, System Architecture, Network Specialist, Cloud Services, Cybersecurity',

        'nav_about' => 'About',
        'nav_services' => 'Services',
        'nav_blog' => 'Blog',
        'nav_contact' => 'Contact',
        'nav_privacy' => 'Privacy Policy',

        'get_started' => 'Get Started',

        'about_title' => 'About Us',
        'about_content' => "SkyPulse.uk is a leading IT services company dedicated to providing innovative solutions that transform businesses. With a team of experienced IT professionals, we deliver a comprehensive range of services tailored to meet the unique needs of each client. Our mission is to empower businesses through technology, enabling them to achieve their full potential. We focus on customer satisfaction and are committed to delivering excellence in every project we undertake.

Our team brings together a wealth of knowledge in various areas of IT, including system architecture, network infrastructure, hardware maintenance, and remote support. We specialize in remote support services, allowing us to assist clients worldwide efficiently. We believe in building long-term relationships with our clients, becoming a trusted partner in their success. At SkyPulse.uk, we are passionate about staying at the forefront of technological advancements, ensuring we provide our clients with the most effective and up-to-date solutions.",

        'services_title' => 'Our Services',
        'services' => [
            [
                'icon' => 'headset',
                'title' => 'Remote Support',
                'description' => 'Providing efficient remote support through advanced ticketing systems and professional communication, ensuring quick resolution of your IT issues. Our team is available 24/7 to assist with troubleshooting, software installations, and maintenance, minimizing downtime and keeping your operations running smoothly.'
            ],
            [
                'icon' => 'tools',
                'title' => 'Hardware Repair & Upgrade',
                'description' => 'Expert computer hardware repair and upgrades for optimal performance. We diagnose hardware issues and provide solutions that enhance the longevity and efficiency of your equipment, including desktops, laptops, and servers.'
            ],
            [
                'icon' => 'network-wired',
                'title' => 'Network Infrastructure',
                'description' => 'Strategic network optimization with experience in TCP/IP, LAN/WLAN, VPN, and more. We design and implement secure, reliable, and scalable network solutions that support your business effectively.'
            ],
            [
                'icon' => 'project-diagram',
                'title' => 'System Architecture',
                'description' => 'Design and implementation of robust system architectures tailored to your business needs. Our solutions enhance productivity and scalability, ensuring your IT infrastructure aligns with your organizational goals.'
            ],
            [
                'icon' => 'cloud',
                'title' => 'Cloud Services',
                'description' => 'Offering cloud integration and migration services to help you leverage the power of cloud computing. We assist with selecting the right cloud platforms and ensure seamless deployment and management.'
            ],
            [
                'icon' => 'shield-alt',
                'title' => 'Cybersecurity',
                'description' => 'Protecting your business from cyber threats with advanced security measures. Our services include network security, vulnerability assessments, and compliance with industry standards.'
            ]
        ],

        'contact_title' => 'Contact Us',
        'contact_description' => "Whether you have questions or need assistance, feel free to contact us. We're here to support your IT journey.",

        'form_name' => 'Name',
        'form_email' => 'Email',
        'form_message' => 'Message',
        'form_antispam_question' => 'What is 3 + 4?',
        'form_submit' => 'Send Message',

        'error_invalid_submission' => 'Invalid submission.',
        'error_name' => 'Please enter your name.',
        'error_email' => 'Please enter a valid email address.',
        'error_message' => 'Please enter your message.',
        'error_antispam' => 'Incorrect anti-spam answer.',
        'error_sending' => 'An error occurred while sending your message. Please try again later.',
        'success_message' => 'Thank you for your message. We will get back to you soon.',

        'email_subject' => 'New Contact Message from',
        'email_name' => 'Name',
        'email_email' => 'Email',
        'email_message' => 'Message',

        'privacy_policy_title' => 'Privacy Policy',
        'privacy_policy_content' => "### Privacy Policy for SkyPulse.uk

**Effective Date:** September 29, 2024

At SkyPulse.uk, we are committed to protecting your privacy and ensuring that your personal information is handled in a safe and responsible manner. This Privacy Policy outlines how we collect, use, and protect your information in compliance with the EU General Data Protection Regulation (GDPR), the California Consumer Privacy Act (CCPA), and other applicable laws.

#### 1. Information We Collect

- **Personal Information:** We may collect personal information such as your name, email address, phone number, and any other information you voluntarily provide when you contact us or use our services.
- **Usage Data:** We collect information on how you access and use our website, including your IP address, browser type, pages visited, and the date and time of your visit.

#### 2. Use of Your Information

We use your information to:

- Provide and maintain our services.
- Respond to your inquiries and support requests.
- Send administrative information, such as confirmations, invoices, and technical notices.
- Personalize your experience on our website.
- Comply with legal obligations and enforce our agreements.

#### 3. Cookies and Tracking Technologies

We use cookies and similar tracking technologies to track activity on our website and store certain information. Cookies are files with small amounts of data that may include an anonymous unique identifier. You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent.

#### 4. Google AdSense

We use Google AdSense to display advertisements on our website. Google AdSense may use cookies to serve ads based on your prior visits to our website or other websites. Users may opt out of personalized advertising by visiting [Google Ads Settings](https://www.google.com/settings/ads).

#### 5. Disclosure of Your Information

We may share your information with:

- **Service Providers:** Third-party companies and individuals to facilitate our services, provide services on our behalf, or perform service-related activities.
- **Legal Requirements:** We may disclose your personal information if required by law or in response to valid requests by public authorities.

#### 6. International Data Transfers

Your information may be transferred to—and maintained on—computers located outside of your state, province, country, or other governmental jurisdiction where data protection laws may differ.

#### 7. Security of Your Information

The security of your data is important to us. We implement appropriate technical and organizational measures to protect your personal information against unauthorized access, alteration, disclosure, or destruction.

#### 8. Your Rights Under GDPR

If you are a resident of the European Economic Area (EEA), you have certain data protection rights, including:

- The right to access, update, or delete the information we have on you.
- The right to rectification.
- The right to object.
- The right of restriction.
- The right to data portability.
- The right to withdraw consent.

To exercise these rights, please contact us at [info@skypulse.co.uk](mailto:info@skypulse.co.uk).

#### 9. Your Rights Under CCPA

If you are a California resident, you have the right to:

- Request disclosure of the categories and specific pieces of personal data collected.
- Request deletion of your personal information.
- Opt-out of the sale of your personal information.

To exercise these rights, please contact us at [info@skypulse.co.uk](mailto:info@skypulse.co.uk).

#### 10. Children's Privacy

Our services are not intended for individuals under the age of 13. We do not knowingly collect personal information from children under 13.

#### 11. Changes to This Privacy Policy

We may update our Privacy Policy from time to time. Any changes will be posted on this page with an updated effective date.

#### 12. Contact Us

If you have any questions about this Privacy Policy, please contact us:

- **Email:** [info@skypulse.co.uk](mailto:info@skypulse.co.uk)
- **Country:** Germany

---

By using our website, you consent to the terms of this Privacy Policy.",

        'blog_title' => 'IT News & Updates',
        'blog_description' => 'Stay updated with the latest news and articles in the IT world.',
        'read_more' => 'Read more',
        'no_articles' => 'No articles available at the moment. Please check back later.',
    ],

    // Include 'el' for Greek and 'de' for German with the updated privacy policies and language strings
    // ... [Greek and German language arrays remain the same as in your provided code]
];

// If the selected language is not available, default to English
if (!array_key_exists($lang, $lang_data)) {
    $lang = 'en';
}

$lang_arr = $lang_data[$lang];

// Initialize variables
$errors = [];
$successMessage = '';

// Process form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['contact_form'])) {
    // Validate form inputs
    $name = trim($_POST['name'] ?? '');
    $email = trim($_POST['email'] ?? '');
    $message = trim($_POST['message'] ?? '');
    $antispam_answer = trim($_POST['antispam_answer'] ?? '');
    $honeypot = trim($_POST['website'] ?? '');

    // Anti-spam measures
    if (!empty($honeypot)) {
        // Bot detected
        $errors[] = $lang_arr['error_invalid_submission'];
    } else {
        // Validate name
        if (empty($name)) {
            $errors[] = $lang_arr['error_name'];
        }

        // Validate email
        if (empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
            $errors[] = $lang_arr['error_email'];
        }

        // Validate message
        if (empty($message)) {
            $errors[] = $lang_arr['error_message'];
        }

        // Validate anti-spam answer
        $correct_answer = 7; // For example, 3 + 4
        if (empty($antispam_answer) || intval($antispam_answer) !== $correct_answer) {
            $errors[] = $lang_arr['error_antispam'];
        }

        // If no errors, send email
        if (empty($errors)) {
            // Prepare email
            $to = 'info@skypulse.co.uk'; // Change to your email
            $subject = $lang_arr['email_subject'] . ' ' . $name;
            $body = "{$lang_arr['email_name']}: $name\n{$lang_arr['email_email']}: $email\n\n{$lang_arr['email_message']}:\n$message";
            $headers = "From: $email";

            // Send email (simple mail function)
            if (mail($to, $subject, $body, $headers)) {
                $successMessage = $lang_arr['success_message'];
                // Clear form fields
                $name = $email = $message = '';
            } else {
                $errors[] = $lang_arr['error_sending'];
            }
        }
    }
}

// Function to fetch and cache RSS feed
function fetchCachedRssFeed($feed_url, $cache_file, $cache_time = 600) {
    // Check if cache directory exists, if not create it
    $cache_dir = dirname($cache_file);
    if (!is_dir($cache_dir)) {
        mkdir($cache_dir, 0755, true);
    }

    // Check if cache file exists and is recent
    if (file_exists($cache_file) && (time() - filemtime($cache_file)) < $cache_time) {
        // Load from cache
        $content = file_get_contents($cache_file);
    } else {
        // Fetch from source
        $context = stream_context_create([
            'http' => [
                'header' => 'User-Agent: PHP'
            ]
        ]);

        $content = @file_get_contents($feed_url, false, $context);

        if ($content !== false) {
            // Save to cache
            file_put_contents($cache_file, $content);
        } else {
            // If fetch fails and cache exists, load from cache
            if (file_exists($cache_file)) {
                $content = file_get_contents($cache_file);
            } else {
                return [];
            }
        }
    }

    libxml_use_internal_errors(true);
    $rss = simplexml_load_string($content);
    if ($rss === false) {
        return [];
    }

    $articles = [];

    foreach ($rss->channel->item as $item) {
        $namespaces = $item->getNameSpaces(true);
        $media_content = $item->children($namespaces['media']);
        $image_url = '';

        if ($media_content && isset($media_content->content)) {
            $attributes = $media_content->content->attributes();
            $image_url = (string)$attributes['url'];
        } elseif ($item->enclosure) {
            $image_url = (string)$item->enclosure['url'];
        }

        // Get a snippet of the description
        $description = strip_tags((string)$item->description);
        $snippet = mb_substr($description, 0, 200) . '...';

        $articles[] = [
            'title' => (string)$item->title,
            'link' => (string)$item->link,
            'description' => $snippet,
            'pubDate' => date('F j, Y', strtotime((string)$item->pubDate)),
            'image' => $image_url
        ];
    }

    return array_slice($articles, 0, 5); // Limit to 5 articles
}

// Determine which page to show
$page = $_GET['page'] ?? 'home';
?>
<!DOCTYPE html>
<html lang="<?= htmlspecialchars($lang_arr['code'], ENT_QUOTES, 'UTF-8'); ?>" data-theme="light">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <!-- Responsive Design -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- Page Title and Meta Tags -->
    <title><?= htmlspecialchars($lang_arr['title'], ENT_QUOTES, 'UTF-8'); ?></title>
    <meta name="description" content="<?= htmlspecialchars($lang_arr['description'], ENT_QUOTES, 'UTF-8'); ?>">
    <meta name="keywords" content="<?= htmlspecialchars($lang_arr['keywords'], ENT_QUOTES, 'UTF-8'); ?>">
    <meta name="author" content="SkyPulse.uk">

    <!-- Google AdSense -->
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7515568519961820"
     crossorigin="anonymous"></script>

    <!-- Bootstrap 5.3.2 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">

    <!-- Font Awesome 6.4.0 -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet" crossorigin="anonymous" referrerpolicy="no-referrer" />

    <!-- Custom Styles -->
    <style>
        /* Root Variables for Theme Colors */
        :root {
            --primary-color: #007bff;
            --secondary-color: #6c757d;
            --light-color: #ffffff;
            --dark-color: #343a40;
            --text-color: #212529;
            --text-light: #ffffff;
            --bg-color: var(--light-color);
            --banner-text-color: var(--text-light);
        }

        /* Global Styles */
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin-top: 75px;
            background-color: var(--bg-color);
            color: var(--text-color);
            transition: background-color 0.3s, color 0.3s;
        }
        h1, h2, h3, h4, h5 {
            font-family: 'Montserrat', sans-serif;
        }
        /* Navbar Styles */
        .navbar {
            background-color: var(--bg-color);
            padding: 15px 0;
            transition: background-color 0.3s;
        }
        .navbar-brand {
            font-weight: bold;
            color: var(--text-color);
        }
        .navbar-brand:hover {
            color: var(--primary-color);
        }
        .nav-link {
            color: var(--text-color);
            margin-left: 15px;
        }
        .nav-link:hover {
            color: var(--primary-color);
        }
        /* Theme Toggle Switch */
        .form-switch .form-check-input {
            cursor: pointer;
        }
        .theme-icon {
            font-size: 1.2rem;
            margin-left: 5px;
            color: var(--text-color);
        }
        /* Banner Section */
        .banner {
            background: url('https://source.unsplash.com/1600x900/?technology,it') no-repeat center center;
            background-size: cover;
            position: relative;
            color: var(--banner-text-color);
            text-shadow: 0 0 10px rgba(0,0,0,0.7);
            padding: 150px 0 100px 0;
            transition: background-image 0.3s;
        }
        .banner::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
        }
        .banner .container {
            position: relative;
            z-index: 2;
        }
        .banner h1 {
            font-size: 3rem;
            margin-bottom: 20px;
        }
        .banner p {
            font-size: 1.25rem;
        }
        /* Button Styles */
        .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
            transition: background-color 0.3s, border-color 0.3s;
        }
        .btn-primary:hover {
            background-color: #0056b3;
            border-color: #0056b3;
        }
        /* Services Section */
        .services {
            padding: 60px 0;
            background-color: var(--bg-color);
        }
        .service-item {
            text-align: center;
            margin-bottom: 40px;
        }
        .service-item i {
            font-size: 3rem;
            color: var(--primary-color);
            margin-bottom: 20px;
        }
        .service-item h5 {
            font-size: 1.5rem;
            margin-bottom: 15px;
        }
        .service-item p {
            font-size: 1rem;
            color: var(--secondary-color);
        }
        /* About Section */
        .about {
            background-color: var(--light-color);
            padding: 60px 0;
        }
        /* Contact Section */
        .contact {
            padding: 60px 0;
            background-color: var(--bg-color);
        }
        .contact h2 {
            margin-bottom: 40px;
        }
        /* Blog Section */
        .blog {
            padding: 60px 0;
            background-color: var(--light-color);
        }
        .blog-post {
            margin-bottom: 40px;
        }
        .blog-post h4 {
            font-size: 1.5rem;
            margin-bottom: 10px;
        }
        .blog-post p {
            color: var(--secondary-color);
        }
        .blog-post a {
            text-decoration: none;
            color: var(--primary-color);
        }
        .blog-post a:hover {
            text-decoration: underline;
        }
        .blog-post img {
            width: 100%;
            height: auto;
            margin-bottom: 15px;
            border-radius: 5px;
        }
        /* Footer Styles */
        footer {
            background-color: var(--dark-color);
            color: var(--text-light);
            padding: 30px 0;
            text-align: center;
        }
        footer a {
            color: var(--primary-color);
            text-decoration: none;
            margin: 0 5px;
        }
        footer a:hover {
            text-decoration: underline;
        }
        .footer-links a {
            margin: 0 10px;
        }
        /* Scroll to Top Button */
        #scrollTopBtn {
            position: fixed;
            bottom: 40px;
            right: 40px;
            display: none;
            background-color: var(--primary-color);
            color: #fff;
            border: none;
            outline: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            font-size: 24px;
            cursor: pointer;
            z-index: 1000;
            transition: background-color 0.3s;
        }
        #scrollTopBtn:hover {
            background-color: #0056b3;
        }
        /* Dark Theme Styles */
        [data-theme="dark"] {
            --primary-color: #0d6efd;
            --secondary-color: #adb5bd;
            --light-color: #212529;
            --dark-color: #f8f9fa;
            --text-color: #f8f9fa;
            --text-light: #212529;
            --bg-color: var(--light-color);
            --banner-text-color: #ffffff;
        }
        /* Responsive Adjustments */
        @media (max-width: 768px) {
            .banner h1 {
                font-size: 2.5rem;
            }
            .banner p {
                font-size: 1.1rem;
            }
        }
        @media (max-width: 576px) {
            .banner h1 {
                font-size: 2rem;
            }
            .banner p {
                font-size: 1rem;
            }
            .nav-link {
                margin-left: 0;
            }
        }
    </style>
</head>
<body>
    <!-- Navigation Bar -->
    <nav class="navbar navbar-expand-lg fixed-top shadow-sm">
        <div class="container">
            <a class="navbar-brand" href="index.php"><?= htmlspecialchars($lang_arr['title'], ENT_QUOTES, 'UTF-8'); ?></a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" 
                    aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon">
                    <i class="fas fa-bars" style="color: var(--text-color);"></i>
                </span>
            </button>
            <div class="collapse navbar-collapse justify-content-end" id="navbarNav">
                <ul class="navbar-nav align-items-center">
                    <li class="nav-item">
                        <a class="nav-link" href="index.php?page=home#aboutSection"><?= htmlspecialchars($lang_arr['nav_about'], ENT_QUOTES, 'UTF-8'); ?></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="index.php?page=home#servicesSection"><?= htmlspecialchars($lang_arr['nav_services'], ENT_QUOTES, 'UTF-8'); ?></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="index.php?page=blog"><?= htmlspecialchars($lang_arr['nav_blog'], ENT_QUOTES, 'UTF-8'); ?></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="index.php?page=home#contactSection"><?= htmlspecialchars($lang_arr['nav_contact'], ENT_QUOTES, 'UTF-8'); ?></a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#privacyModal" data-bs-toggle="modal"><?= htmlspecialchars($lang_arr['nav_privacy'], ENT_QUOTES, 'UTF-8'); ?></a>
                    </li>
                    <!-- Language Selector -->
                    <li class="nav-item dropdown ms-3">
                        <a class="nav-link dropdown-toggle" href="#" id="languageDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                            <?= strtoupper(htmlspecialchars($lang_arr['code'], ENT_QUOTES, 'UTF-8')); ?>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="languageDropdown">
                            <?php foreach ($lang_data as $key => $language): ?>
                                <li><a class="dropdown-item" href="?lang=<?= htmlspecialchars($key, ENT_QUOTES, 'UTF-8'); ?>&page=<?= htmlspecialchars($page, ENT_QUOTES, 'UTF-8'); ?>"><?= htmlspecialchars($language['name'], ENT_QUOTES, 'UTF-8'); ?></a></li>
                            <?php endforeach; ?>
                        </ul>
                    </li>
                    <!-- Theme Toggle Switch -->
                    <li class="nav-item ms-3">
                        <div class="form-check form-switch">
                            <input class="form-check-input" type="checkbox" id="themeSwitch" aria-label="Toggle Dark Mode">
                            <label class="form-check-label" for="themeSwitch"><i class="fas fa-moon theme-icon"></i></label>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <?php if ($page === 'blog'): ?>
        <!-- Blog Page -->
        <section class="blog">
            <div class="container">
                <h2 class="text-center mb-5"><?= htmlspecialchars($lang_arr['blog_title'], ENT_QUOTES, 'UTF-8'); ?></h2>
                <p class="text-center mb-4"><?= htmlspecialchars($lang_arr['blog_description'], ENT_QUOTES, 'UTF-8'); ?></p>

                <?php
                // Fetch articles from external RSS feed
                $feed_url = 'https://feeds.feedburner.com/TechCrunch/';
                $cache_file = 'cache/rss_cache_' . $lang . '.xml';
                $articles = fetchCachedRssFeed($feed_url, $cache_file);

                if (!empty($articles)):
                    foreach ($articles as $article): ?>
                        <div class="blog-post">
                            <?php if (!empty($article['image'])): ?>
                                <img src="<?= htmlspecialchars($article['image'], ENT_QUOTES, 'UTF-8'); ?>" alt="<?= htmlspecialchars($article['title'], ENT_QUOTES, 'UTF-8'); ?>">
                            <?php endif; ?>
                            <h4><?= htmlspecialchars($article['title'], ENT_QUOTES, 'UTF-8'); ?></h4>
                            <p><?= htmlspecialchars($article['description'], ENT_QUOTES, 'UTF-8'); ?></p>
                            <p><small><?= htmlspecialchars($article['pubDate'], ENT_QUOTES, 'UTF-8'); ?></small></p>
                            <a href="<?= htmlspecialchars($article['link'], ENT_QUOTES, 'UTF-8'); ?>" target="_blank"><?= htmlspecialchars($lang_arr['read_more'], ENT_QUOTES, 'UTF-8'); ?> &raquo;</a>
                        </div>
                    <?php endforeach;
                else: ?>
                    <p><?= htmlspecialchars($lang_arr['no_articles'], ENT_QUOTES, 'UTF-8'); ?></p>
                <?php endif; ?>
            </div>
        </section>
    <?php else: ?>
        <!-- Home Page Content -->
        <!-- Banner Section -->
        <section class="banner text-center">
            <div class="container">
                <h1><?= htmlspecialchars($lang_arr['title'], ENT_QUOTES, 'UTF-8'); ?></h1>
                <p class="lead"><?= htmlspecialchars($lang_arr['description'], ENT_QUOTES, 'UTF-8'); ?></p>
                <a href="index.php?page=home#contactSection" class="btn btn-primary mt-3"><?= htmlspecialchars($lang_arr['get_started'], ENT_QUOTES, 'UTF-8'); ?></a>
            </div>
        </section>

        <!-- About Section -->
        <section id="aboutSection" class="about">
            <div class="container">
                <h2 class="text-center mb-5"><?= htmlspecialchars($lang_arr['about_title'], ENT_QUOTES, 'UTF-8'); ?></h2>
                <p><?= nl2br(htmlspecialchars($lang_arr['about_content'], ENT_QUOTES, 'UTF-8')); ?></p>
            </div>
        </section>

        <!-- Services Section -->
        <section id="servicesSection" class="services">
            <div class="container">
                <h2 class="text-center mb-5"><?= htmlspecialchars($lang_arr['services_title'], ENT_QUOTES, 'UTF-8'); ?></h2>
                <div class="row">
                    <?php foreach ($lang_arr['services'] as $service): ?>
                    <div class="col-md-4 col-sm-6">
                        <div class="service-item">
                            <i class="fas fa-<?= htmlspecialchars($service['icon'], ENT_QUOTES, 'UTF-8'); ?>"></i>
                            <h5><?= htmlspecialchars($service['title'], ENT_QUOTES, 'UTF-8'); ?></h5>
                            <p><?= htmlspecialchars($service['description'], ENT_QUOTES, 'UTF-8'); ?></p>
                        </div>
                    </div>
                    <?php endforeach; ?>
                </div>
            </div>
        </section>

        <!-- Contact Section -->
        <section id="contactSection" class="contact">
            <div class="container">
                <h2 class="text-center mb-5"><?= htmlspecialchars($lang_arr['contact_title'], ENT_QUOTES, 'UTF-8'); ?></h2>
                <p class="text-center mb-4"><?= htmlspecialchars($lang_arr['contact_description'], ENT_QUOTES, 'UTF-8'); ?></p>
                <div class="row justify-content-center">
                    <div class="col-md-8">
                        <?php if (!empty($successMessage)): ?>
                            <div class="alert alert-success"><?= htmlspecialchars($successMessage, ENT_QUOTES, 'UTF-8'); ?></div>
                        <?php endif; ?>
                        <?php if (!empty($errors)): ?>
                            <div class="alert alert-danger">
                                <?php foreach ($errors as $error): ?>
                                    <p><?= htmlspecialchars($error, ENT_QUOTES, 'UTF-8'); ?></p>
                                <?php endforeach; ?>
                            </div>
                        <?php endif; ?>
                        <form action="index.php?page=home#contactSection" method="post" novalidate>
                            <div class="mb-3">
                                <label for="name" class="form-label"><?= htmlspecialchars($lang_arr['form_name'], ENT_QUOTES, 'UTF-8'); ?> *</label>
                                <input type="text" class="form-control" id="name" name="name" value="<?= htmlspecialchars($name ?? '', ENT_QUOTES, 'UTF-8'); ?>" required>
                            </div>
                            <div class="mb-3">
                                <label for="email" class="form-label"><?= htmlspecialchars($lang_arr['form_email'], ENT_QUOTES, 'UTF-8'); ?> *</label>
                                <input type="email" class="form-control" id="email" name="email" value="<?= htmlspecialchars($email ?? '', ENT_QUOTES, 'UTF-8'); ?>" required>
                            </div>
                            <div class="mb-3">
                                <label for="message" class="form-label"><?= htmlspecialchars($lang_arr['form_message'], ENT_QUOTES, 'UTF-8'); ?> *</label>
                                <textarea class="form-control" id="message" name="message" rows="5" required><?= htmlspecialchars($message ?? '', ENT_QUOTES, 'UTF-8'); ?></textarea>
                            </div>
                            <!-- Anti-spam question -->
                            <div class="mb-3">
                                <label for="antispam_answer" class="form-label"><?= htmlspecialchars($lang_arr['form_antispam_question'], ENT_QUOTES, 'UTF-8'); ?> *</label>
                                <input type="text" class="form-control" id="antispam_answer" name="antispam_answer" required>
                            </div>
                            <!-- Honeypot field (hidden from users) -->
                            <div style="display:none;">
                                <label for="website">Website</label>
                                <input type="text" id="website" name="website">
                            </div>
                            <input type="hidden" name="contact_form" value="1">
                            <button type="submit" class="btn btn-primary"><?= htmlspecialchars($lang_arr['form_submit'], ENT_QUOTES, 'UTF-8'); ?></button>
                        </form>
                    </div>
                </div>
            </div>
        </section>
    <?php endif; ?>

    <!-- Scroll to Top Button -->
    <button id="scrollTopBtn" title="Back to top"><i class="fas fa-chevron-up"></i></button>

    <!-- Footer -->
    <footer>
        <div class="container">
            <div class="mb-3 footer-links">
                <a href="index.php?page=home#aboutSection"><?= htmlspecialchars($lang_arr['nav_about'], ENT_QUOTES, 'UTF-8'); ?></a>|
                <a href="index.php?page=home#servicesSection"><?= htmlspecialchars($lang_arr['nav_services'], ENT_QUOTES, 'UTF-8'); ?></a>|
                <a href="index.php?page=blog"><?= htmlspecialchars($lang_arr['nav_blog'], ENT_QUOTES, 'UTF-8'); ?></a>|
                <a href="index.php?page=home#contactSection"><?= htmlspecialchars($lang_arr['nav_contact'], ENT_QUOTES, 'UTF-8'); ?></a>|
                <a href="#privacyModal" data-bs-toggle="modal"><?= htmlspecialchars($lang_arr['nav_privacy'], ENT_QUOTES, 'UTF-8'); ?></a>
            </div>
            <p>&copy; <?= date("Y"); ?> SkyPulse.uk. All Rights Reserved.</p>
            <!-- Google AdSense Placeholder -->
            <div class="mt-3">
                <!-- Replace the placeholder below with your actual Google AdSense code -->
                <!-- Example: <script src="your-adsense-code.js"></script> -->
                <span>Advertisement</span>
            </div>
        </div>
    </footer>

    <!-- Privacy Policy Modal -->
    <div class="modal fade" id="privacyModal" tabindex="-1" aria-labelledby="privacyModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg modal-dialog-scrollable">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 id="privacyModalLabel" class="modal-title"><?= htmlspecialchars($lang_arr['privacy_policy_title'], ENT_QUOTES, 'UTF-8'); ?></h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                    <!-- Privacy Policy Content -->
                    <?= nl2br($lang_arr['privacy_policy_content']); ?>
                </div>
            </div>
        </div>
    </div>

    <!-- Bootstrap 5.3.2 JS Bundle (includes Popper.js) -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>

    <!-- Custom JavaScript -->
    <script>
        document.addEventListener('DOMContentLoaded', () => {
            // Theme Toggle Functionality
            const themeSwitch = document.getElementById('themeSwitch');
            const currentTheme = localStorage.getItem('theme') || 'light';

            // Apply the saved theme or default
            document.documentElement.setAttribute('data-theme', currentTheme);

            // Set the toggle state based on the current theme
            themeSwitch.checked = currentTheme === 'dark';

            // Update theme icons
            updateThemeIcon();

            // Event listener for theme toggle
            themeSwitch.addEventListener('change', () => {
                const theme = themeSwitch.checked ? 'dark' : 'light';
                document.documentElement.setAttribute('data-theme', theme);
                localStorage.setItem('theme', theme);
                updateThemeIcon();
            });

            function updateThemeIcon() {
                const themeIcon = document.querySelector('.theme-icon');
                if (themeSwitch.checked) {
                    themeIcon.classList.remove('fa-moon');
                    themeIcon.classList.add('fa-sun');
                } else {
                    themeIcon.classList.remove('fa-sun');
                    themeIcon.classList.add('fa-moon');
                }
            }

            // Scroll to Top Button
            const scrollTopBtn = document.getElementById('scrollTopBtn');
            window.addEventListener('scroll', () => {
                if (window.scrollY > 300) {
                    scrollTopBtn.style.display = 'block';
                } else {
                    scrollTopBtn.style.display = 'none';
                }
            });
            scrollTopBtn.addEventListener('click', () => {
                window.scrollTo({ top: 0, behavior: 'smooth' });
            });
        });
    </script>
</body>
</html>