@extends('layouts.app')

@section('title', 'Register Warehouse')

@section('content')
    <div class="mb-4">
        <h4 class="mb-0">New Storage Location</h4>
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb mb-0">
                <li class="breadcrumb-item"><a href="{{ url('/') }}">Dashboard</a></li>
                <li class="breadcrumb-item"><a href="{{ route('warehouses.index') }}">Warehouses</a></li>
                <li class="breadcrumb-item active">New Warehouse</li>
            </ol>
        </nav>
    </div>

    <div class="row justify-content-center">
        <div class="col-lg-8">
            <div class="card border-0 shadow-sm">
                <div class="card-body p-4">
                    <form action="{{ route('warehouses.store') }}" method="POST">
                        @csrf

                        <div class="row g-4">
                            <div class="col-md-8">
                                <label class="form-label fw-bold small text-muted text-uppercase">Warehouse Name <span
                                        class="text-danger">*</span></label>
                                <input type="text" name="name" class="form-control form-control-lg" required
                                    placeholder="e.g. Central Raw Materials Depot">
                            </div>
                            <div class="col-md-4">
                                <label class="form-label fw-bold small text-muted text-uppercase">Internal Code <span
                                        class="text-danger">*</span></label>
                                <input type="text" name="code" class="form-control form-control-lg" required
                                    placeholder="WH-001">
                            </div>

                            <div class="col-md-6">
                                <label class="form-label fw-bold small text-muted text-uppercase">Primary Function <span
                                        class="text-danger">*</span></label>
                                <select name="type" class="form-select" required>
                                    <option value="raw_material">Raw Materials Storage</option>
                                    <option value="finished_goods">Finished Goods Depot</option>
                                    <option value="returns">Returns & QA Holding</option>
                                    <option value="scrap">Scrap & Waste</option>
                                </select>
                            </div>

                            <div class="col-md-6">
                                <label class="form-label fw-bold small text-muted text-uppercase">Initial Status</label>
                                <select name="status" class="form-select">
                                    <option value="1">Active / Operational</option>
                                    <option value="0">Under Maintenance / Closed</option>
                                </select>
                            </div>

                            <div class="col-md-12">
                                <label class="form-label fw-bold small text-muted text-uppercase">Physical Location /
                                    Address</label>
                                <textarea name="location" class="form-control" rows="2"
                                    placeholder="Street, City, Building Number..."></textarea>
                            </div>
                        </div>

                        <div class="mt-5 pt-3 border-top d-flex justify-content-end gap-2">
                            <a href="{{ route('warehouses.index') }}" class="btn btn-light px-4">Cancel</a>
                            <button type="submit" class="btn btn-primary px-5 shadow-sm">Register Warehouse</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection