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

// Load DJ data
$djsFile = __DIR__ . '/data/djs.json';
$djs = file_exists($djsFile) ? json_decode(file_get_contents($djsFile), true) : [];
?>

<main class="content-area">

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

    <div class="content-wrapper">

        <section class="content-card center-text">
            <h1>🎙️ Meet Our DJs 🎙️</h1>
            <h2>The Heart & Soul of Smurfette’s Country Delights</h2>
        </section>

        <div class="dj-grid">

            <?php if (!empty($djs)): ?>
                <?php foreach ($djs as $dj): ?>
                    <div class="dj-card">

                        <div class="dj-image">
                            <img src="/img/djs/<?= htmlspecialchars($dj['image']) ?>" alt="<?= htmlspecialchars($dj['name']) ?>">
                        </div>

                        <h3 class="dj-name"><?= htmlspecialchars($dj['name']) ?></h3>
                        <p class="dj-show"><?= htmlspecialchars($dj['show']) ?></p>

                        <p class="dj-bio">
                            <?= nl2br(htmlspecialchars($dj['bio'])) ?>
                        </p>

                    </div>
                <?php endforeach; ?>
            <?php else: ?>
                <p style="text-align:center;">No DJs found.</p>
            <?php endif; ?>

        </div>

    </div>

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

</main>

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