<x-admin-layout>
    <x-slot name="header">
        <div class="flex items-center gap-4">
            <a href="{{ route('admin.banks.index') }}" class="p-2 text-gray-400 hover:text-indigo-600 dark:hover:text-indigo-400 dark:text-indigo-400 hover:bg-indigo-50 dark:hover:bg-indigo-900/30 dark:bg-indigo-900/30 rounded-full transition-colors">
                <x-heroicon-o-arrow-left class="w-6 h-6" />
            </a>
            <h2 class="font-bold text-2xl text-gray-900 dark:text-white leading-tight">
                {{ __('Tambah Rekening & E-Wallet') }}
            </h2>
        </div>
    </x-slot>

    <div class="max-w-4xl">
        <div class="bg-white dark:bg-slate-800 rounded-2xl shadow-sm border border-gray-100 dark:border-slate-700 overflow-hidden">
            <form action="{{ route('admin.banks.store') }}" method="POST" enctype="multipart/form-data">
                @csrf
                <div class="p-8 space-y-6">
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div>
                            <label for="bank_name" class="block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2">Nama Layanan (Bank/E-Wallet) <span class="text-red-500">*</span></label>
                            <input type="text" name="bank_name" id="bank_name" value="{{ old('bank_name') }}" required
                                class="block w-full rounded-lg border-gray-300 dark:border-slate-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2.5 px-3 border dark:bg-slate-700 dark:text-white dark:border-slate-600"
                                placeholder="BCA / Mandiri / DANA / OVO">
                            @error('bank_name') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
                        </div>

                        <div>
                            <label for="account_number" class="block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2">Nomor Rekening / No. HP <span class="text-red-500">*</span></label>
                            <input type="text" name="account_number" id="account_number" value="{{ old('account_number') }}" required
                                class="block w-full rounded-lg border-gray-300 dark:border-slate-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2.5 px-3 border dark:bg-slate-700 dark:text-white dark:border-slate-600">
                            @error('account_number') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
                        </div>
                    </div>

                    <div>
                        <label for="account_name" class="block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2">Atas Nama Pemilik <span class="text-red-500">*</span></label>
                        <input type="text" name="account_name" id="account_name" value="{{ old('account_name') }}" required
                            class="block w-full rounded-lg border-gray-300 dark:border-slate-600 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 py-2.5 px-3 border dark:bg-slate-700 dark:text-white dark:border-slate-600">
                        @error('account_name') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
                    </div>

                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6 items-start">
                        <div>
                            <label for="logo" class="block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2">Logo Bank / E-Wallet (Opsional)</label>
                            <input type="file" name="logo" id="logo" accept="image/*"
                                class="block w-full text-sm text-gray-500 dark:text-gray-400 file:mr-4 file:py-2.5 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-indigo-50 dark:bg-indigo-900/30 file:text-indigo-700 hover:file:bg-indigo-100 border border-gray-200 dark:border-slate-700 rounded-lg dark:bg-slate-700 dark:text-white dark:border-slate-600">
                            <p class="mt-2 text-xs text-gray-500 dark:text-gray-400">Maks. ukuran 1 MB.</p>
                            @error('logo') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
                        </div>

                        <div>
                            <label class="block text-sm font-medium text-gray-700 dark:text-gray-200 mb-2">Status Visibilitas</label>
                            <label class="inline-flex items-center cursor-pointer mt-2">
                                <input type="checkbox" name="is_active" value="1" class="sr-only peer dark:bg-slate-700 dark:text-white dark:border-slate-600" {{ old('is_active', true) ? 'checked' : '' }}>
                                <div class="relative w-11 h-6 bg-gray-200 rounded-full peer peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white dark:bg-slate-800 after:border-gray-300 dark:border-slate-600 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-indigo-600"></div>
                                <span class="ms-3 text-sm font-medium text-gray-700 dark:text-gray-200">Tampilkan ke Pembeli</span>
                            </label>
                        </div>
                    </div>
                </div>

                <div class="px-8 py-4 bg-gray-50 dark:bg-slate-700/50 border-t border-gray-100 dark:border-slate-700 flex justify-end gap-3">
                    <a href="{{ route('admin.banks.index') }}" class="px-4 py-2 border border-gray-300 dark:border-slate-600 rounded-lg shadow-sm font-medium text-gray-700 dark:text-gray-200 bg-white dark:bg-slate-800 hover:bg-gray-50 dark:hover:bg-slate-700/50 dark:bg-slate-700/50">Batal</a>
                    <button type="submit" class="px-4 py-2 bg-indigo-600 border border-transparent rounded-lg shadow-sm font-medium text-white hover:bg-indigo-700">
                        Simpan Data
                    </button>
                </div>
            </form>
        </div>
    </div>
</x-admin-layout>
