<?php
// Define allowed administrator IP addresses
$allowed_ips = ['127.0.0.1', '::1', 'YOUR_ACTUAL_IP_HERE'];

// Check if the user is NOT an administrator
if (!in_array($_SERVER['REMOTE_ADDR'], $allowed_ips)) {
    // Send a 503 Service Unavailable header for SEO safety
    header('HTTP/1.1 503 Service Temporarily Unavailable');
    header('Status: 503 Service Temporarily Unavailable');
    header('Retry-After: 3600'); // Suggest retry in 1 hour
    ?>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Site Under Maintenance</title>
        <style>
            body { font-family: Arial, sans-serif; background: #f4f4f9; text-align: center; padding: 100px 20px; color: #333; }
            .card { background: white; padding: 40px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: inline-block; max-width: 500px; }
            h1 { color: #e74c3c; margin-bottom: 10px; }
            p { font-size: 18px; color: #666; line-height: 1.5; }
        </style>
    </head>
    <body>
        <div class="card">
            <h1>We’ll Be Right Back!</h1>
            <p>Our website is currently undergoing scheduled maintenance to improve your experience. Please check back shortly.</p>
        </div>
    </body>
    </html>
    <?php
    exit; // Stop executing the rest of the application code
}

// Your actual website code continues below for authorized admins:
echo "<h1>Admin Access: Site is live for you.</h1>";
