<?php
echo message_box('success');
echo message_box('error');
$created = can_action('125', 'created');
$edited = can_action('125', 'edited');
?>
<div class="overflow-hidden rounded-3xl border border-border bg-card shadow-sm">
    <div class="relative border-b border-border px-6 py-5">
        <div class="absolute inset-0 bg-[radial-gradient(circle_at_top_right,rgba(59,130,246,0.08),transparent_40%)]"></div>
        <div class="relative flex items-start justify-between gap-4">
            <div>
                <h3 class="text-lg font-semibold text-foreground"><?= lang('payment_method') ?></h3>
                <p class="mt-1 text-sm text-muted-foreground">Create a reusable payment method without leaving the current workflow.</p>
            </div>

        </div>
    </div>
    <?php if (!empty($created) || !empty($edited)) { ?>
        <?php echo form_open(base_url('admin/settings/update_payment_method'), array('id' => 'update_payment_method', 'class' => 'space-y-5 p-6')); ?>
            <div class="rounded-2xl border border-border bg-background/60 p-4">
                <?= form_input_group('method_name', lang('method_name'), '', 'text', true, array('placeholder' => lang('method_name'))); ?>
            </div>
            <div class="rounded-2xl border border-border bg-background/60 p-4">
                <div class="flex items-start gap-3">
                    <div class="mt-0.5 inline-flex h-9 w-9 items-center justify-center rounded-xl bg-indigo-100 text-indigo-700 dark:bg-indigo-500/15 dark:text-indigo-300">
                        <i data-lucide="sparkles" class="h-4 w-4"></i>
                    </div>
                    <div class="space-y-1">
                        <div class="text-sm font-semibold text-foreground">Quick note</div>
                        <p class="text-sm leading-6 text-muted-foreground">The new method will be inserted back into the current form automatically after save.</p>
                    </div>
                </div>
            </div>
            <div class="flex items-center justify-end gap-2 border-t border-border pt-5">
                <button type="button" class="inline-flex items-center gap-2 rounded-lg border border-border bg-background px-4 py-2 text-sm font-medium text-foreground hover:bg-muted" data-dismiss="modal">
                    <i data-lucide="x" class="h-4 w-4"></i>
                    <?= lang('close') ?>
                </button>
                <button type="submit" class="inline-flex items-center gap-2 rounded-lg bg-primary px-5 py-2 text-sm font-semibold text-primary-foreground shadow-sm transition hover:bg-primary/90">
                    <i data-lucide="save" class="h-4 w-4"></i>
                    <?= lang('save') ?>
                </button>
            </div>
        <?php echo form_close(); ?>
    <?php } ?>
</div>

<script type="text/javascript">
    if (window.lucide) {
        window.lucide.createIcons();
    }
</script>
