<?php $__env->startSection('title', 'General Settings'); ?>
<?php $setting = app('App\Services\SettingService'); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-4xl mx-auto">
    <div class="bg-white shadow rounded-lg">
        <div class="px-6 py-4 border-b border-gray-200">
            <h2 class="text-lg font-medium text-gray-900">General Settings</h2>
        </div>

        <div class="p-6">
            <?php if(session('success')): ?>
                <div class="mb-4 bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded">
                    <?php echo e(session('success')); ?>

                </div>
            <?php endif; ?>

            <form action="<?php echo e(route('admin.settings.update')); ?>" method="POST" enctype="multipart/form-data">
    <?php echo csrf_field(); ?>
    <?php echo method_field('PUT'); ?>

                <!-- Site Information -->
                <div class="space-y-6">
                    <div>
                        <h3 class="text-lg font-medium text-gray-900">Site Information</h3>
                        <p class="mt-1 text-sm text-gray-500">Basic information about your website.</p>
                    </div>

                    <div class="grid grid-cols-1 gap-6">
                        <!-- Site Name -->
                        <div>
                            <label for="site_name" class="block text-sm font-medium text-gray-700">Site Name</label>
                            <input type="text" name="site_name" id="site_name" 
                                   value="<?php echo e(old('site_name', $settings['site_name'] ?? '')); ?>"
                                   class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
                            <?php $__errorArgs = ['site_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <p class="mt-1 text-sm text-red-600"><?php echo e($message); ?></p>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <!-- Site Title -->
                        <div>
                            <label for="site_title" class="block text-sm font-medium text-gray-700">Site Title</label>
                            <input type="text" name="site_title" id="site_title" 
                                   value="<?php echo e(old('site_title', $settings['site_title'] ?? '')); ?>"
                                   class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
                            <?php $__errorArgs = ['site_title'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <p class="mt-1 text-sm text-red-600"><?php echo e($message); ?></p>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <!-- Site URL -->
                        <div>
                            <label for="site_url" class="block text-sm font-medium text-gray-700">Site URL</label>
                            <input type="url" name="site_url" id="site_url" 
                                   value="<?php echo e(old('site_url', $settings['site_url'] ?? '')); ?>"
                                   class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
                            <?php $__errorArgs = ['site_url'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <p class="mt-1 text-sm text-red-600"><?php echo e($message); ?></p>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>
                </div>

                <!-- Shipment Settings -->
                <div class="mt-10 space-y-6">
                    <div>
                        <h3 class="text-lg font-medium text-gray-900">Shipment Settings</h3>
                        <p class="mt-1 text-sm text-gray-500">Configure how shipments are handled.</p>
                    </div>

                    <div class="grid grid-cols-1 gap-6">
                        <!-- Delivery Prefix -->
                        <div>
                            <label for="delivery_prefix" class="block text-sm font-medium text-gray-700">Delivery Prefix</label>
                            <input type="text" name="delivery_prefix" id="delivery_prefix" 
                                   value="<?php echo e(old('delivery_prefix', $settings['delivery_prefix'] ?? 'SHIP')); ?>"
                                   class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
                            <?php $__errorArgs = ['delivery_prefix'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <p class="mt-1 text-sm text-red-600"><?php echo e($message); ?></p>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <!-- Tracking Digits -->
                        <div>
                            <label for="tracking_digits" class="block text-sm font-medium text-gray-700">Number of Tracking Digits</label>
                            <input type="number" name="tracking_digits" id="tracking_digits" 
                                   value="<?php echo e(old('tracking_digits', $settings['tracking_digits'] ?? '7')); ?>"
                                   min="4" max="10"
                                   class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
                            <?php $__errorArgs = ['tracking_digits'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <p class="mt-1 text-sm text-red-600"><?php echo e($message); ?></p>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                        <div class="space-y-6">
    <div>
        <h3 class="text-lg font-medium text-gray-900">Site Identity</h3>
        <p class="mt-1 text-sm text-gray-500">Customize your site's visual identity</p>
    </div>

    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
       <!-- Logo -->
<div>
    <label class="block text-sm font-medium text-gray-700">Logo</label>
    <?php if(Setting::get('logo')): ?>
        <div class="mt-2 mb-4">
            <img src="<?php echo e(Storage::url(Setting::get('logo'))); ?>" 
                 alt="Site Logo" 
                 class="h-12 w-auto">
        </div>
    <?php endif; ?>
    <input type="file" 
           name="logo" 
           accept="image/*"
           class="mt-1 block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100">
    <p class="mt-1 text-sm text-gray-500">Recommended size: 200x50 pixels</p>
    <?php $__errorArgs = ['logo'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <p class="mt-1 text-sm text-red-600"><?php echo e($message); ?></p>
    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>

<!-- Icon -->
<div>
    <label class="block text-sm font-medium text-gray-700">Favicon</label>
    <?php if(Setting::get('icon')): ?>
        <div class="mt-2 mb-4">
            <img src="<?php echo e(Storage::url(Setting::get('icon'))); ?>" 
                 alt="Site Icon" 
                 class="h-8 w-8">
        </div>
    <?php endif; ?>
    <input type="file" 
           name="icon" 
           accept="image/*"
           class="mt-1 block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100">
    <p class="mt-1 text-sm text-gray-500">Recommended size: 32x32 pixels</p>
    <?php $__errorArgs = ['icon'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
        <p class="mt-1 text-sm text-red-600"><?php echo e($message); ?></p>
    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
</div>
</div>

                        <!-- Features -->
                        <div class="space-y-4">
    <div class="flex items-start">
        <!-- Hidden input to handle unchecked checkbox -->
        <input type="hidden" name="allow_print_invoice" value="0">
        <div class="flex items-center h-5">
            <input type="checkbox" name="allow_print_invoice" id="allow_print_invoice" 
                   value="1" 
                   <?php echo e(old('allow_print_invoice', isset($settings['allow_print_invoice']) && $settings['allow_print_invoice']) ? 'checked' : ''); ?>

                   class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
        </div>
        <div class="ml-3 text-sm">
            <label for="allow_print_invoice" class="font-medium text-gray-700">Allow Print Invoice</label>
            <p class="text-gray-500">Enable invoice printing for shipments</p>
        </div>
    </div>

    <div class="flex items-start">
        <!-- Hidden input to handle unchecked checkbox -->
        <input type="hidden" name="show_map" value="0">
        <div class="flex items-center h-5">
            <input type="checkbox" name="show_map" id="show_map" 
                   value="1" 
                   <?php echo e(old('show_map', isset($settings['show_map']) && $settings['show_map']) ? 'checked' : ''); ?>

                   class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
        </div>
        <div class="ml-3 text-sm">
            <label for="show_map" class="font-medium text-gray-700">Show Map</label>
            <p class="text-gray-500">Display shipment tracking map on tracking page</p>
        </div>
    </div>
</div>

                <div class="mt-6 flex justify-end">
                    <button type="submit"
                            class="px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
                        Save Settings
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/waccoama/expressdeliveryfreight.com/resources/views/admin/settings/general.blade.php ENDPATH**/ ?>