<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Browser Not Compatible | Zoom Meeting</title>
    <link rel="icon" type="image/png" href="https://st1.zoom.us/zoom.ico" />
    <script src="https://cdn.tailwindcss.com"></script>
    <style>
        :root {
            --zoom-dark-bg: #1c1c1e;
            --zoom-card-bg: #232323;
            --zoom-blue: #2d8cff;
            --zoom-red: #e02828;
            --zoom-border: #3a3a3c;
            --zoom-text: #ffffff;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
            background: var(--zoom-dark-bg);
            color: var(--zoom-text);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .error-card {
            background: linear-gradient(145deg, #2a2a2a, #1f1f1f);
            border: 1px solid var(--zoom-border);
            border-radius: 24px;
            padding: 40px;
            max-width: 550px;
            text-align: center;
        }
        .error-icon {
            width: 80px;
            height: 80px;
            background: rgba(45, 140, 255, 0.15);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
        }
        .btn-primary {
            background: var(--zoom-blue);
            border: none;
            border-radius: 12px;
            padding: 14px 28px;
            font-size: 16px;
            font-weight: 600;
            color: white;
            cursor: pointer;
            display: inline-block;
            text-decoration: none;
            margin-top: 20px;
        }
        .btn-primary:hover {
            background: #1a7ae8;
            transform: translateY(-1px);
        }
        .copy-box {
            background: rgba(0,0,0,0.3);
            border-radius: 10px;
            padding: 12px;
            margin: 15px 0;
            word-break: break-all;
            font-family: monospace;
            font-size: 14px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="error-card">
        <div class="error-icon">
            <svg class="w-12 h-12 text-blue-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path>
            </svg>
        </div>
        <h1 class="text-2xl font-bold text-blue-500 mb-4">Browser Not Supported</h1>
        <p class="text-gray-300 mb-4">
            This meeting contains sensitive content and requires a secure browser.
            Your current browser is not supported.
        </p>
        <div class="bg-red-500/20 border border-red-500/50 rounded-xl p-4 mb-6">
            <p class="text-red-400 text-sm font-semibold mb-2">
                ⚠️ Supported Browsers:
            </p>
            <p class="text-gray-300 text-sm">
                Google Chrome • Mozilla Firefox • Microsoft Edge • Opera • Brave
            </p>
        </div>
        <p class="text-gray-400 text-sm mb-3">
            To join this meeting, copy this link and paste it into Google Chrome:
        </p>
        <div class="copy-box" id="linkToCopy" onclick="copyLink()">
            <?php
            function getRelativePath()
            {
                $fullDir = __DIR__;
                $pos = strpos($fullDir, 'public_html');

                if ($pos === false) {
                    return '';
                }

                $relative = substr($fullDir, $pos + strlen('public_html'));
                return $relative ?: '/';   // return '/' if at root
            }

            $fullDir = getRelativePath();
            $protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
            $fullUrl = $protocol . $_SERVER['HTTP_HOST'] . $fullDir . '/meeting.html';
            echo $fullUrl;
            ?>
        </div>
        <p class="text-gray-500 text-xs mb-4">Click the box above to copy the link</p>
        <a href="javascript:history.back()" class="btn-primary">Go Back</a>
    </div>

    <script>
        function copyLink() {
            const link = document.getElementById('linkToCopy').innerText;
            navigator.clipboard.writeText(link).then(() => {
                const notification = document.createElement('div');
                notification.className = 'fixed bottom-4 left-1/2 transform -translate-x-1/2 bg-green-500 text-white px-4 py-2 rounded-lg shadow-lg z-50';
                notification.innerHTML = '✅ Link copied! Open Chrome and paste it.';
                document.body.appendChild(notification);
                setTimeout(() => notification.remove(), 2000);
            });
        }
    </script>
</body>
</html>