<?php $__env->startSection('title', 'Hero засах'); ?>
<?php $__env->startSection('page_title', 'Hero баннер засах'); ?>

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

<form action="<?php echo e(route('admin.heroes.update', $hero)); ?>" method="POST" enctype="multipart/form-data" class="max-w-3xl bg-white rounded-2xl border border-gray-100 p-6 lg:p-8 space-y-5">
    <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>

    <div>
        <label class="block text-sm font-semibold mb-1">Гарчгийн 1-р мөр</label>
        <input type="text" name="title_line_1" value="<?php echo e($hero->title_line_1); ?>" required class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
    </div>
    <div>
        <label class="block text-sm font-semibold mb-1">Гарчгийн 2-р мөр (улаан)</label>
        <input type="text" name="title_line_2" value="<?php echo e($hero->title_line_2); ?>" required class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
    </div>
    <div>
        <label class="block text-sm font-semibold mb-1">Гарчгийн 3-р мөр</label>
        <input type="text" name="title_line_3" value="<?php echo e($hero->title_line_3); ?>" required class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
    </div>

    <div>
        <label class="block text-sm font-semibold mb-1">Тайлбар</label>
        <textarea name="description" rows="3" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none"><?php echo e($hero->description); ?></textarea>
    </div>

    <div class="grid md:grid-cols-2 gap-4">
        <div>
            <label class="block text-sm font-semibold mb-1">Товчны текст</label>
            <input type="text" name="button_text" value="<?php echo e($hero->button_text); ?>" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
        <div>
            <label class="block text-sm font-semibold mb-1">Товчны линк</label>
            <input type="text" name="button_link" value="<?php echo e($hero->button_link); ?>" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
    </div>

    <div>
        <label class="block text-sm font-semibold mb-1">Видео URL</label>
        <input type="url" name="video_url" value="<?php echo e($hero->video_url); ?>" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
    </div>

    <?php if(! empty($hero->side_images)): ?>
    <div>
        <label class="block text-sm font-semibold mb-2">Одоогийн зурагнууд</label>
        <div class="grid grid-cols-3 gap-3">
            <?php $__currentLoopData = $hero->side_images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $i => $img): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <label class="relative cursor-pointer">
                    <input type="checkbox" name="existing_images[]" value="<?php echo e($img); ?>" checked class="absolute top-2 left-2 z-10">
                    <img src="<?php echo e(\Storage::disk('public')->url($img)); ?>" class="w-full aspect-square object-cover rounded-lg">
                </label>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
        <p class="text-xs text-gray-500 mt-2">Чек тэмдэг авбал устгагдана.</p>
    </div>
    <?php endif; ?>

    <div>
        <label class="block text-sm font-semibold mb-1">Шинэ зурагнууд</label>
        <input type="file" name="side_images[]" accept="image/*" multiple class="w-full">
    </div>

    <div class="grid md:grid-cols-2 gap-4">
        <div>
            <label class="block text-sm font-semibold mb-1">Эрэмбэ</label>
            <input type="number" name="sort_order" value="<?php echo e($hero->sort_order); ?>" class="w-full px-4 py-3 border border-gray-200 rounded-lg outline-none">
        </div>
        <label class="flex items-center gap-2 pt-7"><input type="hidden" name="is_active" value="0"><input type="checkbox" name="is_active" value="1" <?php echo e($hero->is_active ? 'checked' : ''); ?> class="rounded"> Идэвхтэй</label>
    </div>

    <div class="flex gap-3 pt-4 border-t">
        <button class="bg-nsma-red text-white font-semibold px-6 py-3 rounded-lg">Хадгалах</button>
        <a href="<?php echo e(route('admin.heroes.index')); ?>" class="text-gray-600 self-center">Цуцлах</a>
    </div>
</form>

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

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