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

<?php $__env->startSection('content'); ?>
<div class="row mt-4">
<div class="col-lg-7">
    <h1 class="text-2xl font-semibold text-slate-800 mb-4">Edit Service</h1>

    <form method="post" action="<?php echo e(route('services.update', $service)); ?>" class="bg-white rounded-xl shadow-sm border border-slate-200 p-6 space-y-4">
        <?php echo csrf_field(); ?>
        <?php echo method_field('put'); ?>

        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Name *</label>
                <input type="text" name="name" value="<?php echo e(old('name', $service->name)); ?>" required class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Category *</label>
                <select name="category_id" required class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
                    <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($cat->id); ?>" <?php echo e(old('category_id', $service->category_id) == $cat->id ? 'selected' : ''); ?>><?php echo e($cat->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>

        <div>
            <label class="block text-sm font-medium text-slate-700">Description</label>
            <textarea name="description" rows="3" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm"><?php echo e(old('description', $service->description)); ?></textarea>
        </div>

        <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Duration (minutes) *</label>
                <input type="number" name="duration_minutes" value="<?php echo e(old('duration_minutes', $service->duration_minutes)); ?>" min="1" required class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Buffer (minutes)</label>
                <input type="number" name="buffer_minutes" value="<?php echo e(old('buffer_minutes', $service->buffer_minutes)); ?>" min="0" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Price *</label>
                <input type="number" step="0.01" name="price" value="<?php echo e(old('price', $service->price)); ?>" min="0" required class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
        </div>

        <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Tax %</label>
                <input type="number" step="0.01" name="tax_percentage" value="<?php echo e(old('tax_percentage', $service->tax_percentage)); ?>" min="0" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Gender</label>
                <select name="gender_applicability" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
                    <option value="unisex" <?php echo e(old('gender_applicability', $service->gender_applicability) === 'unisex' ? 'selected' : ''); ?>>Unisex</option>
                    <option value="male" <?php echo e(old('gender_applicability', $service->gender_applicability) === 'male' ? 'selected' : ''); ?>>Male</option>
                    <option value="female" <?php echo e(old('gender_applicability', $service->gender_applicability) === 'female' ? 'selected' : ''); ?>>Female</option>
                </select>
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Status</label>
                <select name="status" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
                    <option value="active" <?php echo e(old('status', $service->status) === 'active' ? 'selected' : ''); ?>>Active</option>
                    <option value="inactive" <?php echo e(old('status', $service->status) === 'inactive' ? 'selected' : ''); ?>>Inactive</option>
                </select>
            </div>
        </div>

        <div class="flex items-center gap-2">
            <input type="checkbox" name="online_booking_enabled" value="1" id="online_booking_enabled" class="rounded border-slate-300" <?php echo e(old('online_booking_enabled', $service->online_booking_enabled) ? 'checked' : ''); ?>>
            <label for="online_booking_enabled" class="text-sm text-slate-700">Available for online booking</label>
        </div>

        <div class="flex gap-3 pt-2">
            <button type="submit" class="px-4 py-2 bg-slate-800 text-white text-sm font-medium rounded-lg">Update</button>
            <a href="<?php echo e(route('services.index')); ?>" class="px-4 py-2 bg-slate-200 rounded-lg text-sm">Cancel</a>
        </div>
    </form>
</div>
</div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.sash', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\xampp\htdocs\salon\resources\views/services/edit.blade.php ENDPATH**/ ?>