@extends('layouts.master')

@section('title', 'Post RFQ')

@section('content')
<div class="container">
    <h1 class="mb-4">Post New RFQ</h1>

    <div class="card">
        <div class="card-body">
            <form action="{{ route('buyer.rfqs.store') }}" method="POST" enctype="multipart/form-data">
                @csrf
                <div class="mb-3">
                    <label for="title" class="form-label">Requirement Title</label>
                    <input type="text" class="form-control" id="title" name="title" value="{{ old('title') }}" required>
                </div>
                <div class="row">
                    <div class="col-md-6 mb-3">
                        <label for="category" class="form-label">Category</label>
                        <select class="form-select" id="category" name="category" required>
                            <option value="">Select Category</option>
                            <option value="Agriculture">Agriculture</option>
                            <option value="Chemicals">Chemicals</option>
                            <option value="Industrial">Industrial</option>
                            <!-- Add dynamic categories if available -->
                        </select>
                    </div>
                    <div class="col-md-6 mb-3">
                        <label for="quantity" class="form-label">Quantity</label>
                        <input type="number" class="form-control" id="quantity" name="quantity" value="{{ old('quantity') }}" required>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6 mb-3">
                        <label for="budget" class="form-label">Budget (Approx)</label>
                        <input type="number" class="form-control" id="budget" name="budget" step="0.01" value="{{ old('budget') }}" required>
                    </div>
                    <div class="col-md-6 mb-3">
                        <label for="delivery_location" class="form-label">Delivery Location</label>
                        <input type="text" class="form-control" id="delivery_location" name="delivery_location" value="{{ old('delivery_location') }}" required>
                    </div>
                </div>
                <div class="mb-3">
                    <label for="description" class="form-label">Detailed Description</label>
                    <textarea class="form-control" id="description" name="description" rows="4" required>{{ old('description') }}</textarea>
                </div>
                <div class="mb-3">
                    <label for="file" class="form-label">Attach File (Optional)</label>
                    <input type="file" class="form-control" id="file" name="file">
                </div>
                <button type="submit" class="btn btn-primary">Submit RFQ</button>
            </form>
        </div>
    </div>
</div>
@endsection
