<x-admin-layout :title="$item->exists ? 'Edit Gallery Section' : 'Create Gallery Section'">
    <x-admin.form-panel :back-route="route('admin.gallery-sections.index')">
        <form method="POST" action="{{ $item->exists ? route('admin.gallery-sections.update', $item) : route('admin.gallery-sections.store') }}" class="space-y-4">
            @csrf
            @if ($item->exists) @method('PUT') @endif

            <div class="grid grid-cols-2 gap-4">
                <div>
                    <label class="block text-sm font-medium">Name</label>
                    <input name="name" value="{{ old('name', $item->name) }}" class="admin-input" required>
                </div>
                <div>
                    <label class="block text-sm font-medium">Slug</label>
                    <input name="slug" value="{{ old('slug', $item->slug) }}" class="admin-input" required>
                </div>
            </div>
            <div>
                <label class="block text-sm font-medium">Subtitle</label>
                <input name="subtitle" value="{{ old('subtitle', $item->subtitle) }}" class="admin-input">
            </div>
            <div>
                <label class="block text-sm font-medium">Sort Order</label>
                <input type="number" name="sort_order" value="{{ old('sort_order', $item->sort_order ?? 0) }}" class="admin-input" required>
            </div>
            <button type="submit" class="admin-btn-primary">Save</button>
        </form>
    </x-admin.form-panel>
</x-admin-layout>
