<?= $this->extend('organizer/layouts/main') ?>
<?= $this->section('content') ?>

<div class="d-flex justify-content-between align-items-start mb-3">
    <div>
        <h1 class="h4 mb-1"><?= esc($event->event_name) ?></h1>
        <span class="badge bg-<?= esc($lookups->eventStatuses[$event->status]['badge'] ?? 'secondary') ?>"><?= esc($lookups->eventStatuses[$event->status]['label'] ?? $event->status) ?></span>
    </div>
    <a href="<?= site_url('organizer/dashboard') ?>" class="btn btn-outline-secondary btn-sm">Back to My Events</a>
</div>

<div class="card shadow-sm mb-3">
    <div class="card-header">Event Details</div>
    <div class="card-body">
        <p class="text-muted small mb-3">These details are set by the hotel — contact them directly if anything needs to change.</p>
        <div class="row row-cols-2 g-3 small">
            <div class="col"><span class="text-muted">Date</span><br><span class="fw-semibold"><?= esc(date('d M Y', strtotime($event->event_date))) ?></span></div>
            <div class="col"><span class="text-muted">Type</span><br><span class="fw-semibold"><?= esc($event->event_type ?: '—') ?></span></div>
            <div class="col"><span class="text-muted">Venue / Space</span><br><span class="fw-semibold"><?= esc($event->venue_space ?: '—') ?></span></div>
            <div class="col"><span class="text-muted">Expected Headcount</span><br><span class="fw-semibold"><?= esc($event->expected_headcount ?: '—') ?></span></div>
        </div>
    </div>
</div>

<?php echo view('events/_registrations_panel', [
    'event' => $event, 'lookups' => $lookups, 'customFields' => $customFields,
    'registrations' => $registrations, 'registerUrl' => $registerUrl,
    'checkinUrl' => $checkinUrl, 'qrDataUri' => $qrDataUri,
    'baseUrl' => 'organizer/events', 'canManageFields' => true,
]); ?>

<?= $this->endSection() ?>
