<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title><?php echo setting('company_name') ?> | WhatsApp Result</title>
  <?= $this->include("admin/layout/partials/styles") ?>
  <style>
    .hero-card {
      border-radius: 16px;
      box-shadow: 0 10px 30px rgba(0,0,0,.08);
      overflow: hidden;
      background: #fff;
    }
    .wa-title {
      font-weight: 700;
    }
    .status-badge {
      display: inline-block;
      padding: 6px 10px;
      border-radius: 8px;
      font-weight: 600;
      color: #fff;
    }
    .status-ok { background: #28a745; }
    .status-fail { background: #dc3545; }
    pre {
      background: #f8f9fa;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      padding: 12px;
      max-height: 380px;
      overflow: auto;
      white-space: pre-wrap;
      word-break: break-word;
    }
  </style>
</head>
<body class="hold-transition layout-top-nav">
<div class="wrapper">
  <nav class="main-header navbar navbar-expand olx-header" style="background:#002f34;border-bottom:1px solid rgba(255,255,255,.08);">
    <div class="container">
      <a href="<?php echo url('/') ?>" class="navbar-brand olx-brand" style="color:#fff !important;font-weight:700;letter-spacing:.3px;">
        <?php echo setting('company_name') ?>
      </a>
    </div>
  </nav>
  <div class="content-wrapper">
    <section class="content">
      <div class="container py-4">
        <div class="row justify-content-center">
          <div class="col-md-10 col-lg-8">
            <div class="card hero-card">
              <div class="card-body">
                <div class="d-flex justify-content-between align-items-center mb-2">
                  <h3 class="wa-title mb-0">WhatsApp API Result</h3>
                  <?php $ok = ($status >= 200 && $status < 300); ?>
                  <span class="status-badge <?= $ok ? 'status-ok' : 'status-fail' ?>">HTTP <?= (int) $status ?></span>
                </div>
                <p class="text-muted mb-3">Request URL:</p>
                <div class="mb-3">
                  <code><?= esc($url) ?></code>
                </div>
                <p class="text-muted mb-2">Response Body:</p>
                <pre><?= esc($response) ?></pre>
                <div class="mt-3">
                  <a href="<?= url('whatsapp-test') ?>" class="btn btn-default">Back</a>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  </div>
</div>
<?= $this->include("admin/layout/partials/scripts") ?>
</body>
</html>
