<?php $__env->startSection('title', 'Sessions'); ?>

<?php $__env->startSection('content'); ?>
<div class="pg-head">
    <div>
        <h1>Sessions</h1>
        <p>Manage event sessions and schedules.</p>
    </div>
    <div class="pg-actions">
        <a href="<?php echo e(route('mexco.admin.sessions.create')); ?>" class="btn-purple">+ Create New Session</a>
        <?php if($event->sessions->count() > 0): ?>
            <a href="<?php echo e(route('mexco.admin.sessions.tentative')); ?>" class="btn-outline" target="_blank">Generate Event Tentative</a>
        <?php endif; ?>
    </div>
</div>

<div class="card">
    <div class="tbl-wrap">
        <table class="data-tbl">
            <thead>
                <tr>
                    <th>Session Title</th>
                    <th>Speaker</th>
                    <th>Date &amp; Time</th>
                    <th>Status</th>
                    <th style="text-align:right">Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td><span class="link-title"><?php echo e($s->title); ?></span></td>
                        <td><span class="cell-sub"><?php echo e($s->speaker ?: '-'); ?></span></td>
                        <td>
                            <span class="cell-sub"><?php echo e($s->day->format('d M Y')); ?><br><?php echo e($s->time); ?></span>
                            <?php if($s->is_parallel): ?>
                                <span class="status-pill status-scheduled d-inline-block mt-1">Parallel</span>
                            <?php endif; ?>
                        </td>
                        <td>
                            <form method="POST" action="<?php echo e(route('mexco.admin.sessions.toggle-publish', $s)); ?>">
                                <?php echo csrf_field(); ?>
                                <button type="submit"
                                    class="status-toggle <?php echo e($s->is_published ? 'is-active' : ''); ?>"
                                    title="<?php echo e($s->is_published ? 'Unpublish session' : 'Publish session'); ?>">
                                    <span class="status-toggle-track" aria-hidden="true"></span>
                                    <span class="status-toggle-label"><?php echo e($s->is_published ? 'Published' : 'Unpublished'); ?></span>
                                </button>
                            </form>
                        </td>
                        <td>
                            <div class="tbl-actions">
                                <a href="<?php echo e(route('mexco.admin.sessions.edit', $s)); ?>" class="icon-btn" title="Edit">
                                    <svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M12 20h9M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4 12.5-12.5z"/></svg>
                                </a>
                                <form method="POST" action="<?php echo e(route('mexco.admin.sessions.destroy', $s)); ?>"
                                      onsubmit="return confirm('Delete session <?php echo e($s->session_key); ?> - <?php echo e($s->title); ?>?')">
                                    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="icon-btn danger" title="Delete">
                                        <svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14"/></svg>
                                    </button>
                                </form>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="5" style="text-align:center;padding:3rem;color:var(--muted)">No sessions yet.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>

    <div class="tbl-foot">
        <span>Showing <?php echo e($sessions->count() ? 1 : 0); ?> to <?php echo e($sessions->count()); ?> of <?php echo e($sessions->count()); ?> entries</span>
        <div class="pager"><span class="on">1</span></div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\myapp\resources\views/admin/sessions/index.blade.php ENDPATH**/ ?>