<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>PayPal Payment Cancelled</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            background: #f5f5f5;
        }
        .container {
            background: white;
            padding: 2rem;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            text-align: center;
            max-width: 400px;
        }
        .icon {
            font-size: 3rem;
            margin-bottom: 1rem;
            color: #ffc107;
        }
        .message {
            margin: 1rem 0;
            font-size: 1.1rem;
            color: #666;
        }
        .close-btn {
            margin-top: 1.5rem;
            padding: 0.5rem 1.5rem;
            background: #6c757d;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 1rem;
        }
        .close-btn:hover {
            background: #5a6268;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="icon">⚠</div>
        <h2 style="color: #ffc107;">Payment Cancelled</h2>
        <p class="message">{{ $message }}</p>
        <p style="font-size: 0.9rem; color: #999;">You can try again or choose a different payment method.</p>
        
        <button class="close-btn" onclick="window.close();">
            Close Window
        </button>
    </div>

    <script>
        // Notify parent window if this is a popup
        if (window.opener) {
            try {
                window.opener.postMessage({
                    type: 'paypal_payment_cancelled',
                    message: '{{ $message }}'
                }, '*');
            } catch (e) {
                console.error('Error notifying parent window:', e);
            }
        }

        // Auto-close after 3 seconds
        setTimeout(function() {
            window.close();
        }, 3000);
    </script>
</body>
</html>
