@php $modalId = $modalId ?? 'modal-new-category'; @endphp
@php $inputClass = 'w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg bg-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors'; @endphp
<form method="POST" action="{{ route('categories.store') }}" class="space-y-6">
    @csrf
    <div>
        <label class="block text-sm font-medium text-gray-700 mb-2">Nom <span class="text-red-500">*</span></label>
        <input type="text" name="name" value="{{ old('name') }}" class="{{ $inputClass }} @error('name') border-red-500 @enderror" placeholder="Entrez le nom de la catégorie" required>
        @error('name')
            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
        @enderror
    </div>
    <div>
        <label class="block text-sm font-medium text-gray-700 mb-2">Description</label>
        <textarea name="description" rows="3" class="{{ $inputClass }} resize-none @error('description') border-red-500 @enderror" placeholder="Entrez la description de la catégorie">{{ old('description') }}</textarea>
        @error('description')
            <p class="mt-1 text-sm text-red-600">{{ $message }}</p>
        @enderror
    </div>
    @include('components.modals.modal-actions', ['modalId' => $modalId])
</form>
