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

<?php $__env->startSection('content'); ?>
    <h1 class="text-2xl font-bold mb-6">Edit Section</h1>
    <div class="bg-white rounded-lg shadow p-6 max-w-lg">
        <form method="POST" action="<?php echo e(route('admin.sections.update', $section->id)); ?>" enctype="multipart/form-data">
            <?php echo csrf_field(); ?>
            <?php echo method_field('PUT'); ?>
            <div class="mb-4">
                <label for="key" class="block text-sm font-medium text-gray-700 mb-1">Key</label>
                <input type="text" name="key" id="key" value="<?php echo e(old('key', $section->key)); ?>" required
                    class="w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                <?php $__errorArgs = ['key'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p class="text-red-500 text-sm mt-1"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="mb-4">
                <label for="title" class="block text-sm font-medium text-gray-700 mb-1">Title</label>
                <input type="text" name="title" id="title" value="<?php echo e(old('title', $section->title)); ?>" required
                    class="w-full border border-gray-300 rounded px-3 py-2">
            </div>
            <div class="mb-4">
                <label for="subtitle" class="block text-sm font-medium text-gray-700 mb-1">Subtitle</label>
                <input type="text" name="subtitle" id="subtitle" value="<?php echo e(old('subtitle', $section->subtitle)); ?>"
                    class="w-full border border-gray-300 rounded px-3 py-2">
            </div>
            <div class="mb-4">
                <label for="description" class="block text-sm font-medium text-gray-700 mb-1">Description</label>
                <textarea name="description" id="description" rows="3"
                    class="w-full border border-gray-300 rounded px-3 py-2"><?php echo e(old('description', $section->description)); ?></textarea>
            </div>
            <div class="mb-4">
                <label for="image" class="block text-sm font-medium text-gray-700 mb-1">Image</label>
                <input type="file" name="image" id="image" accept="image/*"
                    class="w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
                <?php $__errorArgs = ['image'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p class="text-red-500 text-sm mt-1"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                <p class="text-xs text-gray-500 mt-1">JPEG, PNG, GIF, WebP. Max 2MB. Leave empty to keep current.</p>
                <?php if($section->image_url): ?>
                    <div class="mt-2">
                        <img src="<?php echo e($section->image_url); ?>" alt="<?php echo e($section->title); ?>" class="h-20 w-20 object-cover rounded border">
                        <p class="text-xs text-gray-400 mt-1">Current image</p>
                    </div>
                <?php endif; ?>
            </div>
            <div class="mb-4">
                <label for="badge_text" class="block text-sm font-medium text-gray-700 mb-1">Badge Text</label>
                <input type="text" name="badge_text" id="badge_text" value="<?php echo e(old('badge_text', $section->badge_text)); ?>"
                    class="w-full border border-gray-300 rounded px-3 py-2">
            </div>
            <div class="grid grid-cols-2 gap-4 mb-4">
                <div>
                    <label for="button_text" class="block text-sm font-medium text-gray-700 mb-1">Button Text</label>
                    <input type="text" name="button_text" id="button_text" value="<?php echo e(old('button_text', $section->button_text)); ?>"
                        class="w-full border border-gray-300 rounded px-3 py-2">
                </div>
                <div>
                    <label for="button_link" class="block text-sm font-medium text-gray-700 mb-1">Button Link</label>
                    <input type="text" name="button_link" id="button_link" value="<?php echo e(old('button_link', $section->button_link)); ?>"
                        class="w-full border border-gray-300 rounded px-3 py-2">
                </div>
            </div>
            <div class="grid grid-cols-2 gap-4 mb-4">
                <div>
                    <label for="sort_order" class="block text-sm font-medium text-gray-700 mb-1">Sort Order</label>
                    <input type="number" name="sort_order" id="sort_order" value="<?php echo e(old('sort_order', $section->sort_order)); ?>"
                        class="w-full border border-gray-300 rounded px-3 py-2">
                </div>
                <div class="flex items-end pb-2">
                    <label class="flex items-center gap-2">
                        <input type="checkbox" name="is_active" value="1" <?php echo e(old('is_active', $section->is_active) ? 'checked' : ''); ?>>
                        <span class="text-sm">Active</span>
                    </label>
                </div>
            </div>
            <div class="flex gap-4">
                <button type="submit" class="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700">Update</button>
                <a href="<?php echo e(route('admin.sections.index')); ?>" class="bg-gray-500 text-white px-4 py-2 rounded hover:bg-gray-600">Cancel</a>
            </div>
        </form>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin::layouts.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH G:\abo bilal nuisan\bernie_store\bernie-backend\Modules/Admin\resources/views/sections/edit.blade.php ENDPATH**/ ?>