<?php
// Optional: you could validate the order_id or status here

?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Payment Processing</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <style>
    body {
      background-color: #f5f7fa;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      color: #333;
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100vh;
      margin: 0;
    }
    .container {
      text-align: center;
    }
    .message {
      font-size: 1.2rem;
      margin-top: 10px;
    }
    .spinner {
      width: 48px;
      height: 48px;
      border: 5px solid #ccc;
      border-top: 5px solid #4a90e2;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin: 20px auto;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }
  </style>
</head>
<body>
  <div class="container">
    <div class="spinner"></div>
    <div class="message">Finishing up... Please wait.</div>
    <div class="message" style="font-size: 0.95rem; color: #777;">You can safely close this screen.</div>
  </div>

  <script>
    if (window.flutter_inappwebview) {
      window.flutter_inappwebview.callHandler('paymentDone', {status: 'completed'});
    }
  </script>
</body>
</html>
