<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Multion Integration</title>
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Assistant:wght@200..800&display=swap" rel="stylesheet">
        <style>
            body {
                font-family: Assistant, sans-serif;
                background-color: #f4f4f4;
                margin: 0;
                padding: 0;
                display: flex;
                justify-content: center;
                align-items: center;
                height: 100vh;
            }
            .container {
                background-color: #fff;
                padding: 3rem;
                border-radius: 8px;
                box-shadow: 0 0 10px rgba(0,0,0,0.1);
                text-align: center;
                max-width: 400px;
                width: 100%;
            }
            h1 {
                margin-bottom: 2rem;
            }
            .logo-container {
                display: flex;
                justify-content: center;
                gap: 20px;
                margin-bottom: 2rem;
            }
            .logo-container img {
                width: 100px;
                height: 100px;
                object-fit: contain;
            }
            input[type="text"], button {
                width: 100%;
                padding: 10px;
                margin-bottom: 1rem;
                border: 1px solid #ddd;
                border-radius: 4px;
                box-sizing: border-box;
            }
            button {
                background-color: #000;
                color: #fff;
                border: none;
                cursor: pointer;
                font-size: 1rem;
            }
            button:hover {
                background-color: #333;
            }
            p {
                margin-top: 1rem;
            }
            .plugin-text {
                font-size: 1.2rem;
                font-weight: bold;
                margin-bottom: 1rem;
            }
        </style>
    </head>
<body>
    <div class="container">
        <div class="logo-container">
            <img src="/templates/static/images/friend_logo.svg" alt="Omi Logo" />
            <img src="/templates/static/images/multion_logo.svg" alt="Multion Logo" />
        </div>
        <p class="plugin-text">Omi x MultiOn Plugin</p>
        <h1>Connect with Multion</h1>
        <button onclick="connectWithMultion()">Connect with Multion</button>
    </div>
    <script>
      function connectWithMultion() {
        const orgId = "{{ org_id }}";
        const redirectUri = encodeURIComponent(window.location.href + '/callback');
        const multionAuthUrl = `https://platform.multion.ai/authorize?org_id=${orgId}&redirect_uri=${redirectUri}`;
        window.location.href = multionAuthUrl;
      }
    </script>
</body>
</html>