<?php
session_start();
include __DIR__ . '/includes/header.php';
include __DIR__ . '/includes/nav.php';

$sent = isset($_GET['sent']) && $_GET['sent'] == '1';
?>

<main class="content-area">

  <div class="smurf-divider"></div>

  <div class="content-wrapper">

    <section class="content-card center-text">
      <h1>Request a Song</h1>
      <p>Send a request to Smurfette’s Country Delights.</p>
    </section>

    <div class="smurf-divider"></div>

    
    <?php if ($sent): ?>
      <section class="content-card center-text">
        <h2 style="color:#a6ff9e;">Your request has been received! 🎉</h2>
        <p>Thank you — we’ve received it.</p>
      </section>
      <div class="smurf-divider"></div>
    <?php endif; ?>
    

    <section class="content-card">
      <div class="request-wrapper">
        <form method="post" action="send_request.php">
<div class="request-box">
                <div class="request-field">
                    <label>Your Name</label>
                    <input type="text" class="request-input" name="name" required>
                </div>

                <div class="request-field">
                    <label>Email</label>
                    <input type="email" class="request-input" name="email" required>
                </div>
            </div>

            <div class="request-box">
                <div class="request-field">
                    <label>Song Title</label>
                    <input type="text" class="request-input" name="song" required>
                </div>

                <div class="request-field">
                    <label>Artist</label>
                    <input type="text" class="request-input" name="artist" required>
                </div>
            </div>

            <div class="request-box">
                <div class="request-field">
                    <label>Dedication (optional)</label>
                    <textarea class="request-textarea" name="dedication"></textarea>
                </div>
            </div>

            <div class="request-box center-text">
                <button class="request-button">Send Request 💌</button>
            </div>
        </form>
      </div>
    </section>

  </div>

  <div class="smurf-divider"></div>

</main>

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