<?php $__env->startSection('title', 'Create Page Content'); ?>
<?php $__env->startSection('page-title', 'Create New Page Content'); ?>

<?php $__env->startSection('content'); ?>
<div class="fade-in max-w-4xl">
    <!-- Back Button -->
    <a href="<?php echo e(route('admin.page-content.index')); ?>" class="inline-flex items-center text-blue-600 hover:text-blue-700 mb-6">
        <i class="fas fa-arrow-left mr-2"></i>Back to List
    </a>

    <!-- Form Card -->
    <div class="bg-white dark:bg-gray-950 border border-gray-200 dark:border-gray-800 rounded-lg overflow-hidden">
        <form action="<?php echo e(route('admin.page-content.store')); ?>" method="POST" enctype="multipart/form-data" class="divide-y divide-gray-200 dark:divide-gray-800">
            <?php echo csrf_field(); ?>
            
            <!-- Header -->
            <div class="px-6 py-4 bg-gray-50 dark:bg-gray-900">
                <h2 class="text-lg font-semibold text-gray-900 dark:text-white">Page Content Details</h2>
                <p class="text-sm text-gray-600 dark:text-gray-400 mt-1">Fill in the information for this page section</p>
            </div>

            <!-- Form Content -->
            <div class="p-6 space-y-6">
                <!-- Section Field -->
                <div>
                    <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                        Section <span class="text-red-500">*</span>
                    </label>
                    <select name="section" required id="section-select" class="w-full py-2.5 px-4 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-lg text-sm text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 <?php echo e($errors->has('section') ? 'border-red-500' : ''); ?>">
                        <option value="">-- Select Section --</option>
                        <?php $__currentLoopData = $sections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $section): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php
                                $isDisabled = in_array($section, $existingSections);
                            ?>
                            <option value="<?php echo e($section); ?>" 
                                    <?php echo e($isDisabled ? 'disabled' : ''); ?>

                                    <?php echo e(old('section') === $section ? 'selected' : ''); ?>>
                                <?php echo e(ucfirst($section)); ?><?php echo e($isDisabled ? ' (Already exists)' : ''); ?>

                            </option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                    <?php if($existingSections): ?>
                        <div class="mt-2 p-3 bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800 rounded-md">
                            <p class="text-xs text-amber-800 dark:text-amber-200">
                                <i class="fas fa-info-circle mr-1"></i>
                                <strong>Note:</strong> Sections marked "(Already exists)" are disabled to prevent duplicates.
                            </p>
                        </div>
                    <?php endif; ?>
                    <?php $__errorArgs = ['section'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class="text-red-500 text-xs mt-1 block"><?php echo e($message); ?></span>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <!-- Title English -->
                <div>
                    <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                        Title (English)
                    </label>
                    <input type="text" name="title_en" value="<?php echo e(old('title_en')); ?>" 
                           placeholder="Enter title in English"
                           class="w-full py-2.5 px-4 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-lg text-sm text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 <?php echo e($errors->has('title_en') ? 'border-red-500' : ''); ?>">
                    <?php $__errorArgs = ['title_en'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class="text-red-500 text-xs mt-1 block"><?php echo e($message); ?></span>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <!-- Title Khmer -->
                <div>
                    <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                        Title (ភាសាខ្មែរ)
                    </label>
                    <input type="text" name="title_km" value="<?php echo e(old('title_km')); ?>" 
                           placeholder="Enter title in Khmer"
                           class="w-full py-2.5 px-4 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-lg text-sm text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 <?php echo e($errors->has('title_km') ? 'border-red-500' : ''); ?>">
                    <?php $__errorArgs = ['title_km'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class="text-red-500 text-xs mt-1 block"><?php echo e($message); ?></span>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <!-- Description English -->
                <div>
                    <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                        Description (English)
                    </label>
                    <textarea name="description_en" rows="5" 
                              placeholder="Enter description in English..."
                              class="w-full py-2.5 px-4 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-lg text-sm text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 <?php echo e($errors->has('description_en') ? 'border-red-500' : ''); ?>"><?php echo e(old('description_en')); ?></textarea>
                    <?php $__errorArgs = ['description_en'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class="text-red-500 text-xs mt-1 block"><?php echo e($message); ?></span>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <!-- Description Khmer -->
                <div>
                    <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                        Description (ភាសាខ្មែរ)
                    </label>
                    <textarea name="description_km" rows="5" 
                              placeholder="Enter description in Khmer..."
                              class="w-full py-2.5 px-4 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-lg text-sm text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 <?php echo e($errors->has('description_km') ? 'border-red-500' : ''); ?>"><?php echo e(old('description_km')); ?></textarea>
                    <?php $__errorArgs = ['description_km'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class="text-red-500 text-xs mt-1 block"><?php echo e($message); ?></span>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <!-- Image -->
                <div>
                    <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
                        Image
                    </label>
                    <input type="file" name="image" accept="image/*" 
                           class="w-full py-2.5 px-4 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-lg text-sm text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 <?php echo e($errors->has('image') ? 'border-red-500' : ''); ?>">
                    <p class="text-xs text-gray-500 dark:text-gray-400 mt-2">Max file size: 2MB. Supported formats: JPEG, PNG, JPG, GIF</p>
                    <?php $__errorArgs = ['image'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <span class="text-red-500 text-xs mt-1 block"><?php echo e($message); ?></span>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>
            </div>

            <!-- Form Actions -->
            <div class="px-6 py-4 bg-gray-50 dark:bg-gray-900 border-t border-gray-200 dark:border-gray-800 flex items-center justify-end gap-3">
                <a href="<?php echo e(route('admin.page-content.index')); ?>" 
                   class="px-6 py-2.5 bg-white dark:bg-gray-800 text-gray-900 dark:text-white font-medium rounded-lg border border-gray-300 dark:border-gray-700 shadow-sm hover:shadow-md transition-all">
                    Cancel
                </a>
                <button type="submit" 
                        class="px-6 py-2.5 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg shadow-sm hover:shadow-md transition-all">
                    <i class="fas fa-save mr-2"></i>Create Page Content
                </button>
            </div>
        </form>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/mac/Documents/360monicaAPI/resources/views/admin/page-content/create.blade.php ENDPATH**/ ?>