@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.raw-materials-warehouses.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-warehouse 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="location" 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="location" name="location" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500" placeholder="مثال: المنطقة الصناعية" value="{{ old('location') }}">
                        @error('location')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                    </div>
                    <div>
                        <label for="description" class="block text-sm font-semibold text-gray-700 mb-2">
                            <i class="fas fa-file-alt ml-1 text-blue-600"></i>
                            الوصف
                        </label>
                        <textarea id="description" name="description" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500" placeholder="أضف وصف المخزن...">{{ old('description') }}</textarea>
                        @error('description')<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.raw-materials-warehouses.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