<?php $__env->startSection('page-title', 'Settings'); ?>

<div class="p-6">
    <div class="max-w-7xl mx-auto space-y-6">

        
        <!--[if BLOCK]><![endif]--><?php if(session()->has('message')): ?>
            <div class="p-4 bg-green-50 dark:bg-green-900/30 border border-green-200 dark:border-green-800 rounded-lg">
                <p class="text-sm text-green-700 dark:text-green-300"><?php echo e(session('message')); ?></p>
            </div>
        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->

        
        <div class="bg-white dark:bg-gray-800 shadow-sm sm:rounded-lg">
            <div class="p-6">
                <h2 class="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-6">Website Configuration</h2>

                <form wire:submit.prevent="saveSiteConfig" class="space-y-6">

                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                            Company Name
                        </label>
                        <input
                            type="text"
                            wire:model="name"
                            class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                            placeholder="GB Secure"
                        />
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-xs text-red-500 mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>

                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                            Company Description
                        </label>
                        <textarea
                            wire:model="descr"
                            rows="3"
                            class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                            placeholder="Gengbiz Hologram Security Sticker System uses advanced tamper-proof holograms..."
                        ></textarea>
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['descr'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-xs text-red-500 mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>

                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                            Email Address
                        </label>
                        <input
                            type="email"
                            wire:model="email"
                            class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                            placeholder="webmaster@gengbiz.my"
                        />
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-xs text-red-500 mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->
                    </div>

                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                            Company Logo
                        </label>
                        <!--[if BLOCK]><![endif]--><?php if($logoPath): ?>
                            <div class="mb-2 text-sm text-gray-600 dark:text-gray-400"><?php echo e($logoPath); ?></div>
                        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                        <input
                            type="file"
                            wire:model="logo"
                            accept="image/*"
                            class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                        />
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['logo'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-xs text-red-500 mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->

                        <div class="grid grid-cols-2 gap-4 mt-3">
                            <div>
                                <label class="block text-xs text-gray-600 dark:text-gray-400 mb-1">Logo Width</label>
                                <input
                                    type="number"
                                    wire:model="width"
                                    class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                                    placeholder="120"
                                />
                            </div>
                            <div>
                                <label class="block text-xs text-gray-600 dark:text-gray-400 mb-1">Logo Height</label>
                                <input
                                    type="number"
                                    wire:model="height"
                                    class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                                    placeholder="120"
                                />
                            </div>
                        </div>
                    </div>

                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                            Current Contest Image (Lucky Draw)
                        </label>
                        <!--[if BLOCK]><![endif]--><?php if($contestImagePath): ?>
                            <div class="mb-2 text-sm text-gray-600 dark:text-gray-400"><?php echo e($contestImagePath); ?></div>
                        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                        <input
                            type="file"
                            wire:model="contestImage"
                            accept="image/*"
                            class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                        />
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['contestImage'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-xs text-red-500 mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->

                        <div class="grid grid-cols-2 gap-4 mt-3">
                            <div>
                                <label class="block text-xs text-gray-600 dark:text-gray-400 mb-1">Logo Width</label>
                                <input
                                    type="number"
                                    wire:model="contestWidth"
                                    class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                                    placeholder="400"
                                />
                            </div>
                            <div>
                                <label class="block text-xs text-gray-600 dark:text-gray-400 mb-1">Logo Height</label>
                                <input
                                    type="number"
                                    wire:model="contestHeight"
                                    class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                                    placeholder="600"
                                />
                            </div>
                        </div>
                    </div>

                    
                    <div>
                        <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                            QR Image
                        </label>
                        <!--[if BLOCK]><![endif]--><?php if($qrImagePath): ?>
                            <div class="mb-2 text-sm text-gray-600 dark:text-gray-400"><?php echo e($qrImagePath); ?></div>
                        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                        <input
                            type="file"
                            wire:model="qrImage"
                            accept="image/*"
                            class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                        />
                        <!--[if BLOCK]><![endif]--><?php $__errorArgs = ['qrImage'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <span class="text-xs text-red-500 mt-1"><?php echo e($message); ?></span> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?><!--[if ENDBLOCK]><![endif]-->

                        <div class="grid grid-cols-2 gap-4 mt-3">
                            <div>
                                <label class="block text-xs text-gray-600 dark:text-gray-400 mb-1">Logo Width</label>
                                <input
                                    type="number"
                                    wire:model="qrWidth"
                                    class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                                    placeholder="500"
                                />
                            </div>
                            <div>
                                <label class="block text-xs text-gray-600 dark:text-gray-400 mb-1">Logo Height</label>
                                <input
                                    type="number"
                                    wire:model="qrHeight"
                                    class="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                                    placeholder="250"
                                />
                            </div>
                        </div>
                    </div>

                    
                    <div class="flex justify-end">
                        <button
                            type="submit"
                            class="px-6 py-2 bg-green-600 hover:bg-green-700 text-white font-semibold rounded-lg transition-colors"
                        >
                            Save Configuration
                        </button>
                    </div>

                </form>
            </div>
        </div>

        
        <div class="bg-white dark:bg-gray-800 shadow-sm sm:rounded-lg">
            <div class="p-6">
                <h2 class="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4">Customer Form Fields</h2>
                <p class="text-sm text-gray-600 dark:text-gray-300 mb-6">Enable or disable fields that appear on the product verification form.</p>

                
                <div class="overflow-x-auto">
                    <table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
                        <thead class="bg-gray-50 dark:bg-gray-700">
                            <tr>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">
                                    Field Name
                                </th>
                                <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">
                                    Placeholder
                                </th>
                                <th class="px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">
                                    Visible
                                </th>
                                <th class="px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider">
                                    Required
                                </th>
                            </tr>
                        </thead>
                        <tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
                            <!--[if BLOCK]><![endif]--><?php $__currentLoopData = $fields; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr class="<?php echo e(in_array($field['unique_key'], ['name', 'email', 'contact']) ? 'bg-blue-50 dark:bg-blue-900/20' : ''); ?>">
                                    <td class="px-6 py-4 whitespace-nowrap">
                                        <div class="flex items-center">
                                            <div class="text-sm font-medium text-gray-900 dark:text-gray-100">
                                                <?php echo e($field['name']); ?>

                                            </div>
                                            <!--[if BLOCK]><![endif]--><?php if(in_array($field['unique_key'], ['name', 'email', 'contact'])): ?>
                                                <span class="ml-2 px-2 py-1 text-xs font-semibold text-blue-800 dark:text-blue-300 bg-blue-200 dark:bg-blue-900/50 rounded-full">
                                                    Base Field
                                                </span>
                                            <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                                        </div>
                                        <div class="text-xs text-gray-500 dark:text-gray-400"><?php echo e($field['unique_key']); ?></div>
                                    </td>
                                    <td class="px-6 py-4">
                                        <!--[if BLOCK]><![endif]--><?php if($editingPlaceholder === $field['id']): ?>
                                            <div class="flex items-center gap-2">
                                                <input
                                                    type="text"
                                                    wire:model="placeholderValue"
                                                    wire:keydown.enter="updatePlaceholder(<?php echo e($field['id']); ?>)"
                                                    wire:keydown.escape="cancelEdit"
                                                    class="text-sm px-2 py-1 border border-blue-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                                                    autofocus
                                                />
                                                <button
                                                    wire:click="updatePlaceholder(<?php echo e($field['id']); ?>)"
                                                    class="px-2 py-1 text-xs bg-green-500 text-white rounded hover:bg-green-600"
                                                >
                                                    Save
                                                </button>
                                                <button
                                                    wire:click="cancelEdit"
                                                    class="px-2 py-1 text-xs bg-gray-500 text-white rounded hover:bg-gray-600"
                                                >
                                                    Cancel
                                                </button>
                                            </div>
                                        <?php else: ?>
                                            <div class="flex items-center gap-2">
                                                <span class="text-sm text-gray-600 dark:text-gray-300"><?php echo e($field['placeholder']); ?></span>
                                                <button
                                                    wire:click="editPlaceholder(<?php echo e($field['id']); ?>, '<?php echo e(addslashes($field['placeholder'])); ?>')"
                                                    class="text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
                                                    title="Edit placeholder"
                                                >
                                                    <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
                                                    </svg>
                                                </button>
                                            </div>
                                        <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-center">
                                        <button
                                            wire:click="toggleVisible(<?php echo e($field['id']); ?>)"
                                            type="button"
                                            class="relative inline-flex items-center justify-center h-8 w-14 flex-shrink-0 cursor-pointer rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 <?php echo e($field['visible'] ? 'bg-green-500 focus:ring-green-500' : 'bg-gray-300 dark:bg-gray-600 focus:ring-gray-400'); ?>"
                                            role="switch"
                                            aria-checked="<?php echo e($field['visible'] ? 'true' : 'false'); ?>"
                                        >
                                            <span class="sr-only">Toggle visible</span>
                                            <span
                                                aria-hidden="true"
                                                class="absolute inline-block h-6 w-6 transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out <?php echo e($field['visible'] ? 'translate-x-3' : '-translate-x-3'); ?>"
                                            ></span>
                                        </button>
                                        <div class="text-xs mt-1 font-medium <?php echo e($field['visible'] ? 'text-green-600 dark:text-green-400' : 'text-gray-500 dark:text-gray-400'); ?>">
                                            <?php echo e($field['visible'] ? 'ON' : 'OFF'); ?>

                                        </div>
                                    </td>
                                    <td class="px-6 py-4 whitespace-nowrap text-center">
                                        <button
                                            wire:click="toggleRequired(<?php echo e($field['id']); ?>)"
                                            type="button"
                                            class="relative inline-flex items-center justify-center h-8 w-14 flex-shrink-0 cursor-pointer rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 <?php echo e($field['required'] ? 'bg-blue-500 focus:ring-blue-500' : 'bg-gray-300 dark:bg-gray-600 focus:ring-gray-400'); ?>"
                                            role="switch"
                                            aria-checked="<?php echo e($field['required'] ? 'true' : 'false'); ?>"
                                        >
                                            <span class="sr-only">Toggle required</span>
                                            <span
                                                aria-hidden="true"
                                                class="absolute inline-block h-6 w-6 transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out <?php echo e($field['required'] ? 'translate-x-3' : '-translate-x-3'); ?>"
                                            ></span>
                                        </button>
                                        <div class="text-xs mt-1 font-medium <?php echo e($field['required'] ? 'text-blue-600 dark:text-blue-400' : 'text-gray-500 dark:text-gray-400'); ?>">
                                            <?php echo e($field['required'] ? 'ON' : 'OFF'); ?>

                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><!--[if ENDBLOCK]><![endif]-->

                            
                            <tr class="bg-blue-50 dark:bg-blue-900/30 border-t-2 border-blue-200 dark:border-blue-800">
                                <td class="px-6 py-4 whitespace-nowrap">
                                    <div class="flex items-center">
                                        <div class="text-sm font-medium text-gray-900 dark:text-gray-100">
                                            <?php echo e($pincodeField['name']); ?>

                                        </div>
                                        <span class="ml-2 px-2 py-1 text-xs font-semibold text-blue-800 dark:text-blue-300 bg-blue-200 dark:bg-blue-900/50 rounded-full">
                                            Always Required
                                        </span>
                                    </div>
                                    <div class="text-xs text-gray-500 dark:text-gray-400"><?php echo e($pincodeField['unique_key']); ?></div>
                                </td>
                                <td class="px-6 py-4">
                                    <!--[if BLOCK]><![endif]--><?php if($editingPlaceholder === $pincodeField['id']): ?>
                                        <div class="flex items-center gap-2">
                                            <input
                                                type="text"
                                                wire:model="placeholderValue"
                                                wire:keydown.enter="updatePlaceholder(<?php echo e($pincodeField['id']); ?>)"
                                                wire:keydown.escape="cancelEdit"
                                                class="text-sm px-2 py-1 border border-blue-500 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100"
                                                autofocus
                                            />
                                            <button
                                                wire:click="updatePlaceholder(<?php echo e($pincodeField['id']); ?>)"
                                                class="px-2 py-1 text-xs bg-green-500 text-white rounded hover:bg-green-600"
                                            >
                                                Save
                                            </button>
                                            <button
                                                wire:click="cancelEdit"
                                                class="px-2 py-1 text-xs bg-gray-500 text-white rounded hover:bg-gray-600"
                                            >
                                                Cancel
                                            </button>
                                        </div>
                                    <?php else: ?>
                                        <div class="flex items-center gap-2">
                                            <span class="text-sm text-gray-600 dark:text-gray-300"><?php echo e($pincodeField['placeholder']); ?></span>
                                            <button
                                                wire:click="editPlaceholder(<?php echo e($pincodeField['id']); ?>, '<?php echo e(addslashes($pincodeField['placeholder'])); ?>')"
                                                class="text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300"
                                                title="Edit placeholder"
                                            >
                                                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path>
                                                </svg>
                                            </button>
                                        </div>
                                    <?php endif; ?><!--[if ENDBLOCK]><![endif]-->
                                </td>
                                <td class="px-6 py-4 whitespace-nowrap text-center">
                                    <div class="inline-flex items-center justify-center h-8 w-14 flex-shrink-0 rounded-full bg-gray-200 dark:bg-gray-700 opacity-50 cursor-not-allowed">
                                        <span class="inline-block h-6 w-6 rounded-full bg-gray-400 dark:bg-gray-600 shadow-lg"></span>
                                    </div>
                                    <div class="text-xs mt-1 font-medium text-gray-400 dark:text-gray-500">
                                        Always ON
                                    </div>
                                </td>
                                <td class="px-6 py-4 whitespace-nowrap text-center">
                                    <div class="inline-flex items-center justify-center h-8 w-14 flex-shrink-0 rounded-full bg-gray-200 dark:bg-gray-700 opacity-50 cursor-not-allowed">
                                        <span class="inline-block h-6 w-6 rounded-full bg-gray-400 dark:bg-gray-600 shadow-lg"></span>
                                    </div>
                                    <div class="text-xs mt-1 font-medium text-gray-400 dark:text-gray-500">
                                        Always ON
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>

            </div>
        </div>

    </div>
</div>
<?php /**PATH C:\laragon\www\trueid\resources\views/livewire/admin/settings.blade.php ENDPATH**/ ?>