<?php require_once __DIR__ . '/includes/bootstrap.php';
$pageTitle = 'Schedule | Underground FX Radio';
$currentPage = basename(__FILE__);
include __DIR__ . '/includes/header.php';
?>
<section class="ugfx-page-hero">
  <div class="container-xxl">
    <div class="ugfx-kicker"><i class="bi bi-lightning-charge-fill"></i> Premium launch build</div>
    <h1 class="page-title">On-air schedule</h1>
    <p class="page-copy">Premium schedule page using the imported Hometime-style hourly data, rebuilt with cleaner layout and stronger current/next emphasis.</p>
  </div>
</section>

<section class="section-pad pt-3">
  <div class="container-xxl">
    <?php $schedule = ugfx_get_schedule(); $today = ugfx_day_name(); $currentHour = (int) date('G'); ?>
    <div class="ugfx-card p-4">
      <div class="table-responsive">
        <table class="table ugfx-table align-middle">
          <thead><tr><th style="width:120px;">Time</th><?php foreach ($schedule as $day => $slots): ?><th><?= htmlspecialchars(substr($day,0,3)) ?></th><?php endforeach; ?></tr></thead>
          <tbody>
            <?php for ($hour = 0; $hour < 24; $hour++): ?>
            <tr class="<?= $hour === $currentHour ? 'live-row' : '' ?>">
              <td><strong><?= date('g A', strtotime($hour . ':00')) ?></strong></td>
              <?php foreach ($schedule as $day => $slots): ?>
              <td><?= htmlspecialchars($slots[$hour] ?? '—') ?> <?= ($day === $today && $hour === $currentHour) ? '<span class="ugfx-live-pill ms-2">LIVE</span>' : '' ?></td>
              <?php endforeach; ?>
            </tr>
            <?php endfor; ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</section>

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