<?php
require_once __DIR__ . "/includes/config.php";
require_once __DIR__ . "/includes/functions.php";
include __DIR__ . "/includes/header.php";

$sent = false;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  // Simple mail() - may be blocked on shared hosting, better SMTP/PHPMailer.
  $name = trim($_POST['name'] ?? '');
  $email = trim($_POST['email'] ?? '');
  $msg = trim($_POST['message'] ?? '');

  // TODO: send via SMTP
  $sent = true;
}
?>

<h2>Contact Us</h2>
<p class="text-muted">Email: <b>Farasatali2025@gmail.com</b> | Phone: +44 7526 946530</p>

<div class="row">
  <div class="col-md-7">
    <?php if ($sent): ?><div class="alert alert-success">Message sent (demo). Setup SMTP for real sending.</div><?php endif; ?>
    <form method="post" class="card p-4 shadow-sm">
      <div class="mb-3">
        <label class="form-label">Name</label>
        <input class="form-control" name="name" required>
      </div>
      <div class="mb-3">
        <label class="form-label">Email</label>
        <input class="form-control" name="email" type="email" required>
      </div>
      <div class="mb-3">
        <label class="form-label">Message</label>
        <textarea class="form-control" name="message" rows="5" required></textarea>
      </div>
      <button class="btn btn-dark">Send</button>
    </form>
  </div>
</div>

<?php include __DIR__ . "/includes/footer.php"; ?>
