<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <style>
        body, #app, main { background-color: #FAF7F2 !important; }
        .min-h-screen { background-color: #FAF7F2 !important; }
    </style>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />

    <div class="max-w-4xl mx-auto p-4 sm:p-6 lg:p-8 min-h-screen">
        
        
        <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-6">
            <div>
                <div class="flex items-center gap-2 text-sm text-[#8c6a4a] dark:text-[#c9b59b] mb-1">
                    <i class="fas fa-edit"></i>
                    <span>Edit Kategori</span>
                </div>
                <h1 class="text-2xl sm:text-3xl font-bold text-[#2c1a0e] dark:text-[#faf7f2]">
                    Edit <span class="text-[#f59e0b]">Category</span>
                </h1>
                <p class="text-sm text-[#8c6a4a] dark:text-[#c9b59b] mt-1">Ubah informasi kategori yang sudah ada</p>
            </div>
            <a href="<?php echo e(route('categories.index')); ?>" 
               class="inline-flex items-center gap-2 bg-[#8c6a4a] hover:bg-[#6b4c31] text-white px-5 py-2.5 rounded-xl transition duration-200 text-sm font-medium shadow-md">
                <i class="fas fa-arrow-left text-xs"></i> Kembali
            </a>
        </div>

        
        <div class="bg-white dark:bg-[#2c1a0e] rounded-2xl shadow-lg border border-[#e0d3c2] dark:border-[#4a321f] overflow-hidden">
            <div class="p-6 sm:p-8">
                <form action="<?php echo e(route('categories.update', $category)); ?>" method="POST">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PUT'); ?>

                    <div class="mb-6">
                        <label class="block mb-2 text-sm font-semibold text-[#2c1a0e] dark:text-[#faf7f2]">
                            <i class="fas fa-tag mr-2 text-[#f59e0b]"></i>
                            Nama Kategori
                        </label>
                        <input type="text"
                               name="name"
                               class="w-full px-4 py-3 border-2 border-[#e0d3c2] dark:border-[#4a321f] rounded-xl focus:ring-2 focus:ring-[#f59e0b] focus:border-[#f59e0b] outline-none transition bg-white dark:bg-[#3d2514] text-[#2c1a0e] dark:text-white <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> border-red-500 <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                               value="<?php echo e(old('name', $category->name)); ?>"
                               placeholder="Masukkan nama kategori...">

                        <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="text-red-500 text-xs mt-2 flex items-center gap-1">
                                <i class="fas fa-exclamation-circle"></i> <?php echo e($message); ?>

                            </div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    
                    <div class="mb-6 p-4 bg-[#fef3c7] dark:bg-[#3d2514] rounded-xl">
                        <div class="flex items-center gap-2 text-sm text-[#8c6a4a] dark:text-[#c9b59b]">
                            <i class="fas fa-info-circle text-[#f59e0b]"></i>
                            <span>Informasi: Perubahan akan langsung berdampak pada semua produk dengan kategori ini.</span>
                        </div>
                    </div>

                    <div class="flex justify-end gap-3">
                        <a href="<?php echo e(route('categories.index')); ?>" 
                           class="px-6 py-3 bg-[#e0d3c2] dark:bg-[#4a321f] hover:bg-[#c9b59b] dark:hover:bg-[#6b4c31] text-[#2c1a0e] dark:text-white rounded-xl font-medium transition-all duration-200 text-sm">
                            Batal
                        </a>
                        <button type="submit" 
                                class="bg-gradient-to-r from-[#f59e0b] to-[#d97706] hover:from-[#d97706] hover:to-[#b45309] text-white px-8 py-3 rounded-xl font-bold shadow-md transition-all duration-200 text-sm uppercase tracking-wider flex items-center gap-2">
                            <i class="fas fa-save"></i> Update Kategori
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <?php if(session('success')): ?>
        <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
        <script>
            const Toast = Swal.mixin({
                toast: true,
                position: 'top-end',
                showConfirmButton: false,
                timer: 3000,
                timerProgressBar: true
            });
            Toast.fire({
                icon: 'success',
                title: "<?php echo e(session('success')); ?>"
            });
        </script>
    <?php endif; ?>

    <?php if($errors->any()): ?>
        <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
        <script>
            Swal.fire({
                icon: 'error',
                title: 'Gagal!',
                text: '<?php echo e($errors->first()); ?>',
                confirmButtonColor: '#f59e0b'
            });
        </script>
    <?php endif; ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH C:\laragon\www\LokaPustaka\resources\views/categories/edit.blade.php ENDPATH**/ ?>