@extends('layouts.app')

@section('title', 'Publish Listing - Agent Portal')

@section('content')
<div class="bg-black text-white py-8 border-b border-neutral-800">
    <div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">
        <h1 class="font-serif-heading font-extrabold text-2xl">Publish Property Listing</h1>
    </div>
</div>

<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-10">
    <div class="border border-gray-200 p-8 bg-white shadow-xl">
        
        <form action="{{ route('agent.properties.store') }}" method="POST" enctype="multipart/form-data" class="space-y-6">
            @csrf

            <div>
                <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Property Title</label>
                <input type="text" name="title" required placeholder="e.g. 5-Bedroom Villa in Guzape" class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs font-medium">
            </div>

            <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
                <div>
                    <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Price (₦)</label>
                    <input type="number" name="price" required placeholder="e.g. 150000000" class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs font-medium">
                </div>
                <div>
                    <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Property Type</label>
                    <select name="property_type" required class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs font-medium">
                        <option value="Villa">Villa</option>
                        <option value="Land">Land Plot</option>
                        <option value="House">House / Duplex</option>
                        <option value="Apartment">Serviced Apartment</option>
                    </select>
                </div>
                <div>
                    <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Listing Status</label>
                    <select name="status" required class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs font-medium">
                        <option value="Buy">For Sale</option>
                        <option value="Rent">For Rent</option>
                    </select>
                </div>
            </div>

            <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
                <div>
                    <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Bedrooms</label>
                    <input type="number" name="bedrooms" value="0" class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs">
                </div>
                <div>
                    <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Bathrooms</label>
                    <input type="number" name="bathrooms" value="0" class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs">
                </div>
                <div>
                    <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Area (sqm)</label>
                    <input type="number" name="sqft" value="0" class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs">
                </div>
            </div>

            <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                <div>
                    <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Address</label>
                    <input type="text" name="address" required placeholder="Street address..." class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs">
                </div>
                <div>
                    <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">City / District</label>
                    <input type="text" name="city" required placeholder="Maitama, Guzape, Ikoyi..." class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs">
                </div>
            </div>

            <div>
                <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Title Document</label>
                <input type="text" name="title_document" placeholder="FCDA C of O, AGIS R-of-O..." class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs">
            </div>

            <div>
                <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Description</label>
                <textarea name="description" rows="4" required class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs"></textarea>
            </div>

            <div>
                <label class="block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-1">Upload Property Photos</label>
                <input type="file" name="images[]" multiple class="w-full px-4 py-3 bg-gray-50 border border-gray-200 text-xs">
            </div>

            <button type="submit" class="w-full py-4 bg-brand-blue text-white text-xs font-bold uppercase tracking-[0.2em] hover:bg-brand-darkblue shadow-lg">
                Publish Listing Now
            </button>
        </form>

    </div>
</div>
@endsection
