@php $modalId = $modalId ?? 'modal-movement-in'; @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
@php $products = $products ?? collect(); @endphp
@php $departments = $departments ?? collect(); @endphp

<form method="POST" action="{{ route('movements.store.entree') }}" class="space-y-6">
    @csrf
    <div>
        <label class="block text-sm font-medium text-gray-700 mb-2">Produit <span class="text-red-500">*</span></label>
        <x-searchable-select name="product_id" :options="$products" :selected="old('product_id')" placeholder="Choisir un produit" searchPlaceholder="Rechercher un produit..." :required="true" :inputClass="$inputClass" />
    </div>
    <div class="grid grid-cols-1 sm:grid-cols-2 gap-5">
        <div>
            <label class="block text-sm font-medium text-gray-700 mb-2">Quantité <span class="text-red-500">*</span></label>
            <input type="number" name="quantity" min="1" value="{{ old('quantity') }}" class="{{ $inputClass }}" placeholder="0" required>
        </div>
        <div>
            <label class="block text-sm font-medium text-gray-700 mb-2">Département <span class="text-red-500">*</span></label>
            <x-searchable-select name="department_id" :options="$departments" :selected="old('department_id')" placeholder="Choisir un département" searchPlaceholder="Rechercher un département..." :required="true" :inputClass="$inputClass" />
        </div>
    </div>
    <div>
        <label class="block text-sm font-medium text-gray-700 mb-2">Commentaire</label>
        <textarea name="notes" rows="2" class="{{ $inputClass }} resize-none" placeholder="Optionnel">{{ old('notes') }}</textarea>
    </div>
    @include('components.modals.modal-actions', ['modalId' => $modalId, 'submitLabel' => 'Enregistrer l\'entrée', 'primaryClass' => 'bg-gradient-to-r from-green-600 to-emerald-600 hover:from-green-700 hover:to-emerald-700 text-white shadow-sm'])
</form>
