<?php require_once __DIR__ . '/includes/bootstrap.php';
$pageTitle = 'Join the Team | Underground FX Radio';
$currentPage = basename(__FILE__);
$success = false;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $items = ugfx_read_json($ugfx['storage']['applications'], []);
    $items[] = [
        'name' => trim($_POST['name'] ?? ''),
        'email' => trim($_POST['email'] ?? ''),
        'role' => trim($_POST['role'] ?? ''),
        'availability' => trim($_POST['availability'] ?? ''),
        'experience' => trim($_POST['experience'] ?? ''),
        'links' => trim($_POST['links'] ?? ''),
        'created_at' => date('Y-m-d H:i:s'),
        'status' => 'new'
    ];
    ugfx_write_json($ugfx['storage']['applications'], $items);
    $success = true;
}
include __DIR__ . '/includes/header.php';
?>
<section class="ugfx-page-hero">
  <div class="container-xxl">
    <div class="ugfx-kicker"><i class="bi bi-stars"></i> Build the station with us</div>
    <h1 class="page-title">Join the Team</h1>
    <p class="page-copy">A premium recruitment page for presenters, volunteers, support crew, promo help, event staff and community contributors.</p>
  </div>
</section>
<section class="section-pad pt-3">
  <div class="container-xxl">
    <div class="row g-4">
      <div class="col-lg-7">
        <div class="ugfx-card p-4">
          <?php if ($success): ?><div class="alert alert-success">Your application has been sent to the Underground FX team.</div><?php endif; ?>
          <form method="post" class="row g-3">
            <div class="col-md-6"><label class="form-label">Name</label><input class="form-control" name="name" required></div>
            <div class="col-md-6"><label class="form-label">Email</label><input class="form-control" type="email" name="email" required></div>
            <div class="col-md-6"><label class="form-label">Role Interest</label><select class="form-select" name="role" required><option value="">Select role</option><option>Presenter / DJ</option><option>Admin / Moderation</option><option>Events / Promo</option><option>Graphics / Media</option><option>General Support</option></select></div>
            <div class="col-md-6"><label class="form-label">Availability</label><input class="form-control" name="availability" placeholder="Weeknights, weekends, afternoons..."></div>
            <div class="col-12"><label class="form-label">Experience / Pitch</label><textarea class="form-control" rows="6" name="experience" required></textarea></div>
            <div class="col-12"><label class="form-label">Links</label><textarea class="form-control" rows="3" name="links" placeholder="Demo, socials, portfolio, stream links"></textarea></div>
            <div class="col-12"><button class="btn ugfx-btn-primary">Submit application</button></div>
          </form>
        </div>
      </div>
      <div class="col-lg-5">
        <div class="ugfx-card p-4 h-100">
          <div class="section-heading mb-4"><div class="title">What we can recruit for</div><div class="copy">This replaces the missing Hometime-style join flow with a stronger premium front-end and cleaner storage.</div></div>
          <div class="ugfx-stack-list compact">
            <div class="ugfx-stack-link static"><span><strong>Presenters and DJs</strong><small>Hosted slots, guest hours and specials</small></span></div>
            <div class="ugfx-stack-link static"><span><strong>Promo and events</strong><small>Support upcoming event drops and social pushes</small></span></div>
            <div class="ugfx-stack-link static"><span><strong>Moderation and admin support</strong><small>Help chat, content and station workflows</small></span></div>
            <div class="ugfx-stack-link static"><span><strong>Creative contributors</strong><small>Graphics, media, edits and community ideas</small></span></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
<?php include __DIR__ . '/includes/footer.php'; ?>
