@extends('layouts.app')
@section('title', 'إنشاء طرف استقبال منتجات جديد')
@section('content')
<div class="min-h-screen bg-gradient-to-br from-slate-50 to-slate-100 py-8 px-4 md:px-8">
    <div class="max-w-2xl mx-auto">
        <div class="mb-8">
            <h1 class="text-3xl font-bold text-gray-900 mb-2">إنشاء طرف استقبال منتجات جديد</h1>
            <p class="text-gray-600">أضف طرف جديد لاستقبال المنتجات النهائية</p>
        </div>
        <div class="bg-white rounded-xl shadow-lg overflow-hidden border border-gray-200">
            <div class="p-8">
                <form action="{{ route('inventory.finished-goods-recipients.store') }}" method="POST" class="space-y-6">
                    @csrf
                    <div>
                        <label for="name" class="block text-sm font-semibold text-gray-700 mb-2">
                            <i class="fas fa-user ml-1 text-blue-600"></i>
                            اسم الطرف
                        </label>
                        <input type="text" id="name" name="name" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500" placeholder="مثال: الفرع الرئيسي" value="{{ old('name') }}" required>
                        @error('name')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                    </div>
                    <div>
                        <label for="address" class="block text-sm font-semibold text-gray-700 mb-2">
                            <i class="fas fa-map-marker-alt ml-1 text-blue-600"></i>
                            العنوان
                        </label>
                        <input type="text" id="address" name="address" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500" placeholder="مثال: الرياض - حي الياسمين" value="{{ old('address') }}">
                        @error('address')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                    </div>
                    <div>
                        <label for="contact_person" class="block text-sm font-semibold text-gray-700 mb-2">
                            <i class="fas fa-user-tie ml-1 text-blue-600"></i>
                            شخص التواصل
                        </label>
                        <input type="text" id="contact_person" name="contact_person" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500" placeholder="اسم المسؤول" value="{{ old('contact_person') }}">
                        @error('contact_person')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                    </div>
                    <div>
                        <label for="phone" class="block text-sm font-semibold text-gray-700 mb-2">
                            <i class="fas fa-phone ml-1 text-blue-600"></i>
                            رقم الهاتف
                        </label>
                        <input type="text" id="phone" name="phone" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500" placeholder="رقم الهاتف" value="{{ old('phone') }}">
                        @error('phone')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                    </div>
                    <div class="flex items-center">
                        <input type="checkbox" id="is_active" name="is_active" value="1" class="rounded border-gray-300 text-blue-600" {{ old('is_active') ? 'checked' : '' }}>
                        <label for="is_active" class="ml-2 text-sm font-semibold text-gray-700"><i class="fas fa-check-circle ml-1 text-green-600"></i> الطرف نشط</label>
                    </div>
                    <div class="flex justify-between gap-4 pt-4 border-t border-gray-200">
                        <a href="{{ route('inventory.finished-goods-recipients.index') }}" class="px-6 py-2 text-gray-700 bg-gray-200 rounded-lg hover:bg-gray-300 font-medium"><i class="fas fa-times ml-1"></i> إلغاء</a>
                        <button type="submit" class="px-6 py-2 bg-gradient-to-r from-blue-600 to-blue-700 text-white rounded-lg hover:from-blue-700 hover:to-blue-800 font-medium"><i class="fas fa-save ml-1"></i> حفظ</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection