<?php $__env->startSection('title', 'Kelola Video Edukasi'); ?>

<?php $__env->startSection('content'); ?>
<div class="card border-0 shadow-sm rounded-4 p-4 card-accent-orange">
    <div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center gap-3 mb-4">
        <div>
            <h5 class="fw-bold mb-1 text-dark"><i class="fa-solid fa-video text-warning me-2"></i> Kelola Video Edukasi</h5>
            <small class="text-muted">Kelola konten video pembelajaran pengelolaan sampah dari YouTube</small>
        </div>
        <a href="<?php echo e(route('admin.videos.create')); ?>" class="btn btn-warning rounded-pill fw-bold px-4 py-2 shadow-sm text-white" style="background: linear-gradient(90deg, #f97316 0%, #ea580c 100%); border: none;">
            <i class="fa-solid fa-plus me-1"></i> Tambah Video Baru
        </a>
    </div>

    <div class="table-responsive">
        <table class="table table-hover align-middle">
            <thead class="table-light">
                <tr>
                    <th>Judul Video</th>
                    <th style="width: 150px;">Kategori</th>
                    <th>Link YouTube</th>
                    <th class="text-end" style="width: 150px;">Aksi</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $videos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $vid): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td>
                        <strong class="text-dark d-block" style="font-size: 0.95rem;"><?php echo e($vid->title); ?></strong>
                        <small class="text-muted"><?php echo e(Str::limit($vid->description, 75)); ?></small>
                    </td>
                    <td><span class="badge bg-warning text-dark"><?php echo e($vid->category); ?></span></td>
                    <td>
                        <a href="<?php echo e($vid->youtube_url); ?>" target="_blank" class="btn btn-sm btn-outline-primary rounded-pill px-3 py-1 text-decoration-none small">
                            <i class="fa-solid fa-square-arrow-up-right me-1"></i> Buka Link
                        </a>
                    </td>
                    <td class="text-end">
                        <form action="<?php echo e(route('admin.videos.destroy', $vid->id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Hapus video ini?')">
                            <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                            <button class="btn btn-sm btn-outline-danger rounded-pill px-3">
                                <i class="fa-solid fa-trash me-1"></i> Hapus
                            </button>
                        </form>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="4" class="text-center text-muted py-5">
                        <i class="fa-solid fa-folder-open fs-2 mb-2 text-muted"></i>
                        <p class="mb-0">Belum ada video edukasi. Klik tombol di atas untuk menambah.</p>
                    </td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>

    <div class="d-flex justify-content-center mt-4">
        <?php echo e($videos->links()); ?>

    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\ProkerKKN\resources\views/admin/videos/index.blade.php ENDPATH**/ ?>