<?php
    if (Auth('admin')->User()->dashboard_style == 'light') {
        $text = 'dark';
        $bg = 'light';
    } else {
        $text = 'light';
        $bg = 'dark';
    }
?>

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('admin.topmenu', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php echo $__env->make('admin.sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <div class="main-panel">
        <div class="content">
            <div class="page-inner">
                <div class="card">
                    <div class="card-body">
                        <div class="mt-2 mb-4">
                            <h1 class="title1 text-<?php echo e($text); ?> text-center">Create Fan Card Plan</h1>
                        </div>
                        <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.danger-alert','data' => []]); ?>
<?php $component->withName('danger-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                        <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.success-alert','data' => []]); ?>
<?php $component->withName('success-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                    </div>
                </div>
                <div class="mb-5 row d-flex justify-content-center">
                    <div class="col-md-10">
                        <div class="card p-2 shadow">
                            <div class="card-body">
                                <form method="POST" action="<?php echo e(route('admin.fan-card-plans.store')); ?>">
                                    <?php echo csrf_field(); ?>
                                    <div class="form-row">
                                        <div class="form-group col-md-6">
                                            <h6 class="text-<?php echo e($text); ?>">Plan Name <span class="text-danger">*</span></h6>
                                            <input type="text" class="form-control bg-<?php echo e($bg); ?> text-<?php echo e($text); ?>"
                                                name="name" value="<?php echo e(old('name')); ?>" required placeholder="e.g., Silver, Gold, Platinum">
                                            <?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="alert alert-danger mt-2"><?php echo e($message); ?></div>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="form-group col-md-6">
                                            <h6 class="text-<?php echo e($text); ?>">Annual Price (<?php echo e($settings->currency); ?>) <span class="text-danger">*</span></h6>
                                            <input type="number" step="0.01" class="form-control bg-<?php echo e($bg); ?> text-<?php echo e($text); ?>"
                                                name="price" value="<?php echo e(old('price')); ?>" required placeholder="99.00">
                                            <?php $__errorArgs = ['price'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <div class="alert alert-danger mt-2"><?php echo e($message); ?></div>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="form-group col-md-12">
                                            <h6 class="text-<?php echo e($text); ?>">Description</h6>
                                            <textarea class="form-control bg-<?php echo e($bg); ?> text-<?php echo e($text); ?>" name="description" 
                                                rows="3" placeholder="Brief description of this plan"><?php echo e(old('description')); ?></textarea>
                                            <?php $__errorArgs = ['description'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <div class="alert alert-danger mt-2"><?php echo e($message); ?></div>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="form-group col-md-6">
                                            <h6 class="text-<?php echo e($text); ?>">Discount Percentage on Bookings</h6>
                                            <input type="number" min="0" max="100" class="form-control bg-<?php echo e($bg); ?> text-<?php echo e($text); ?>"
                                                name="discount_percentage" value="<?php echo e(old('discount_percentage', 0)); ?>" placeholder="15">
                                            <small class="text-muted">Members get this % off on celebrity bookings</small>
                                            <?php $__errorArgs = ['discount_percentage'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <div class="alert alert-danger mt-2"><?php echo e($message); ?></div>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="form-group col-md-6">
                                            <h6 class="text-<?php echo e($text); ?>">Sort Order</h6>
                                            <input type="number" min="0" class="form-control bg-<?php echo e($bg); ?> text-<?php echo e($text); ?>"
                                                name="sort_order" value="<?php echo e(old('sort_order', 0)); ?>" placeholder="0">
                                            <small class="text-muted">Lower numbers appear first</small>
                                            <?php $__errorArgs = ['sort_order'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <div class="alert alert-danger mt-2"><?php echo e($message); ?></div>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="form-group col-md-6">
                                            <h6 class="text-<?php echo e($text); ?>">Badge Color</h6>
                                            <select class="form-control bg-<?php echo e($bg); ?> text-<?php echo e($text); ?>" name="badge_color">
                                                <option value="">Select Color</option>
                                                <option value="gray" <?php echo e(old('badge_color') == 'gray' ? 'selected' : ''); ?>>Gray (Silver)</option>
                                                <option value="yellow" <?php echo e(old('badge_color') == 'yellow' ? 'selected' : ''); ?>>Yellow (Gold)</option>
                                                <option value="purple" <?php echo e(old('badge_color') == 'purple' ? 'selected' : ''); ?>>Purple (Platinum)</option>
                                                <option value="blue" <?php echo e(old('badge_color') == 'blue' ? 'selected' : ''); ?>>Blue</option>
                                                <option value="green" <?php echo e(old('badge_color') == 'green' ? 'selected' : ''); ?>>Green</option>
                                                <option value="red" <?php echo e(old('badge_color') == 'red' ? 'selected' : ''); ?>>Red</option>
                                            </select>
                                            <?php $__errorArgs = ['badge_color'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <div class="alert alert-danger mt-2"><?php echo e($message); ?></div>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="form-group col-md-6">
                                            <h6 class="text-<?php echo e($text); ?>">Icon</h6>
                                            <select class="form-control bg-<?php echo e($bg); ?> text-<?php echo e($text); ?>" name="icon">
                                                <option value="star" <?php echo e(old('icon') == 'star' ? 'selected' : ''); ?>>Star</option>
                                                <option value="crown" <?php echo e(old('icon') == 'crown' ? 'selected' : ''); ?>>Crown</option>
                                                <option value="award" <?php echo e(old('icon') == 'award' ? 'selected' : ''); ?>>Award</option>
                                                <option value="gem" <?php echo e(old('icon') == 'gem' ? 'selected' : ''); ?>>Gem</option>
                                                <option value="shield" <?php echo e(old('icon') == 'shield' ? 'selected' : ''); ?>>Shield</option>
                                            </select>
                                            <?php $__errorArgs = ['icon'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <div class="alert alert-danger mt-2"><?php echo e($message); ?></div>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                        </div>

                                        <div class="form-group col-md-12">
                                            <h6 class="text-<?php echo e($text); ?>">Benefits</h6>
                                            <div id="benefits-container">
                                                <div class="input-group mb-2">
                                                    <input type="text" class="form-control bg-<?php echo e($bg); ?> text-<?php echo e($text); ?>" 
                                                        name="benefits[]" placeholder="e.g., Priority booking access">
                                                    <div class="input-group-append">
                                                        <button type="button" class="btn btn-success" onclick="addBenefit()">
                                                            <i class="fa fa-plus"></i>
                                                        </button>
                                                    </div>
                                                </div>
                                            </div>
                                            <small class="text-muted">Add multiple benefits, one per line</small>
                                        </div>

                                        <div class="form-group col-md-6">
                                            <h6 class="text-<?php echo e($text); ?>">Status Options</h6>
                                            <div class="custom-control custom-checkbox mb-3">
                                                <input type="checkbox" class="custom-control-input" name="is_active" id="is_active" 
                                                    <?php echo e(old('is_active', true) ? 'checked' : ''); ?>>
                                                <label class="custom-control-label text-<?php echo e($text); ?>" for="is_active">
                                                    <strong>Active</strong> (visible to users)
                                                </label>
                                            </div>
                                        </div>

                                        <div class="form-group col-md-6">
                                            <h6 class="text-<?php echo e($text); ?>">&nbsp;</h6>
                                            <div class="custom-control custom-checkbox mb-3">
                                                <input type="checkbox" class="custom-control-input" name="is_featured" id="is_featured"
                                                    <?php echo e(old('is_featured') ? 'checked' : ''); ?>>
                                                <label class="custom-control-label text-<?php echo e($text); ?>" for="is_featured">
                                                    <strong>Featured</strong> (recommended plan)
                                                </label>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="mt-3">
                                        <button type="submit" class="btn btn-primary px-5">
                                            <i class="fa fa-save"></i> Create Plan
                                        </button>
                                        <a href="<?php echo e(route('admin.fan-card-plans.index')); ?>" class="btn btn-secondary">
                                            <i class="fa fa-times"></i> Cancel
                                        </a>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        function addBenefit() {
            const container = document.getElementById('benefits-container');
            const newBenefit = document.createElement('div');
            newBenefit.className = 'input-group mb-2';
            newBenefit.innerHTML = `
                <input type="text" class="form-control bg-<?php echo e($bg); ?> text-<?php echo e($text); ?>" 
                    name="benefits[]" placeholder="Enter benefit">
                <div class="input-group-append">
                    <button type="button" class="btn btn-danger" onclick="this.parentElement.parentElement.remove()">
                        <i class="fa fa-minus"></i>
                    </button>
                </div>
            `;
            container.appendChild(newBenefit);
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\celebify\resources\views/admin/fan_card_plans/create.blade.php ENDPATH**/ ?>