@extends('layouts.app')

@section('title', 'Tambah Barang - INUFA')

@section('header', 'Tambah Barang Baru')

@section('content')
<div class="container mx-auto px-4 py-6">
    <div class="bg-white rounded-lg shadow-md p-6 max-w-4xl mx-auto">
        <form action="{{ route('input-stock.store') }}" method="POST" class="space-y-6">
            @csrf
            
            <!-- Informasi Barang -->
            <div class="grid grid-cols-1 gap-6">
                <div>
                    <h3 class="text-lg font-semibold mb-4 text-gray-800">Informasi Barang</h3>
                    
                    <!-- Nama Barang -->
                    <div class="mb-4">
                        <label for="nama" class="block text-gray-700 font-medium mb-2">Nama Barang <span class="text-red-500">*</span></label>
                        <input type="text" id="nama" name="nama" value="{{ old('nama') }}" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Masukkan nama barang" required>
                        @error('nama')
                            <p class="text-red-500 text-sm mt-1">{{ $message }}</p>
                        @enderror
                    </div>
                    
                    <!-- Stock Barang -->
                    <div class="mb-4">
                        <label for="stok" class="block text-gray-700 font-medium mb-2">Stok Barang <span class="text-red-500">*</span></label>
                        <input type="number" id="stok" name="stok" value="{{ old('stok', 0) }}" min="0" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Jumlah stok barang" required>
                        <p class="text-xs text-gray-500 mt-1">Jumlah barang yang tersedia</p>
                        @error('stok')
                            <p class="text-red-500 text-sm mt-1">{{ $message }}</p>
                        @enderror
                    </div>
                </div>
            </div>
            
            <!-- Tombol Submit -->
            <div class="flex justify-end space-x-2 mt-6">
                <a href="{{ route('input-stock') }}" class="bg-gray-300 text-gray-800 py-2 px-4 rounded hover:bg-gray-400 transition duration-200">
                    Batal
                </a>
                <button type="submit" class="bg-blue-900 text-white py-2 px-4 rounded hover:bg-blue-800 transition duration-200">
                    Simpan Barang
                </button>
            </div>
        </form>
    </div>
</div>
@endsection