

<?php $__env->startSection('title', 'Detail Event - ' . $event->nama_event); ?>

<?php $__env->startSection('content'); ?>

<div class="container" style="max-width:860px">

    <?php if(session('success')): ?>
        <div class="alert alert-success"><?php echo e(session('success')); ?></div>
    <?php endif; ?>
    <?php if(session('error')): ?>
        <div class="alert alert-danger"><?php echo e(session('error')); ?></div>
    <?php endif; ?>

    <div class="card-modern p-4 mb-4">
        <img src="<?php echo e($event->gambar ? asset('storage/'.$event->gambar) : 'https://via.placeholder.com/860x320?text=Konser'); ?>"
             alt="<?php echo e($event->nama_event); ?>"
             style="width:100%; height:280px; object-fit:cover; border-radius:12px; margin-bottom:20px">

        <h2 class="fw-bold mb-1"><?php echo e($event->nama_event); ?></h2>
        <div class="text-muted mb-2">
            <?php echo e($event->kategori->nama_kategori ?? '-'); ?> &bull;
            <?php echo e($event->lokasi->nama_lokasi ?? '-'); ?>

        </div>
        <div class="text-muted-sm mb-3">
            📅 <?php echo e($event->tanggal ? \Carbon\Carbon::parse($event->tanggal)->format('d M Y') : '-'); ?>

            <?php if($event->jam): ?>
                &nbsp;⏰ <?php echo e($event->jam); ?>

            <?php endif; ?>
        </div>
        <p style="line-height:1.7"><?php echo e($event->deskripsi); ?></p>
    </div>

    <div class="card-modern p-4">
        <h4 class="mb-3">🎟️ Pilih Tiket</h4>

        <?php $__empty_1 = true; $__currentLoopData = $event->tikets; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tiket): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div class="card-dark mb-3 p-3 d-flex justify-content-between align-items-center flex-wrap gap-3">
                <div>
                    <div class="fw-bold"><?php echo e($tiket->jenis); ?></div>
                    <div class="text-muted-sm">Rp <?php echo e(number_format($tiket->harga, 0, ',', '.')); ?></div>
                    <div class="mt-1">
                        <?php if($tiket->stok > 0): ?>
                            <span class="badge bg-success">Stok: <?php echo e($tiket->stok); ?></span>
                        <?php else: ?>
                            <span class="badge bg-danger">Stok Habis</span>
                        <?php endif; ?>
                    </div>
                </div>
                <div>
                    <?php if($tiket->stok > 0): ?>
                        <a href="<?php echo e(route('tiket.beli', $tiket->id)); ?>" class="btn btn-primary-custom">
                            Beli Tiket
                        </a>
                    <?php else: ?>
                        <button class="btn btn-secondary" disabled>Stok Habis</button>
                    <?php endif; ?>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div class="alert alert-warning">Belum ada tiket tersedia untuk event ini.</div>
        <?php endif; ?>

        <div class="mt-3">
            <a href="<?php echo e(route('user.events')); ?>" class="btn btn-outline-secondary">← Kembali</a>
        </div>
    </div>

</div>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\tugas pa asur\konser-ticket\resources\views/user/show.blade.php ENDPATH**/ ?>