@extends('layouts.app')

@section('title', 'New Customer Profile')

@section('content')
<div class="max-w-3xl mx-auto space-y-6">
    <div class="flex items-center justify-between">
        <div>
            <h1 class="text-xl font-bold text-slate-900 dark:text-white">Create New Customer Profile</h1>
            <p class="text-xs text-slate-500">Multi-section registration form with identity details and mobile normalization.</p>
        </div>
        <a href="{{ route('app.customers.index') }}" class="px-4 py-2 bg-slate-200 dark:bg-slate-700 text-slate-700 dark:text-slate-200 font-semibold text-xs rounded-xl">Cancel</a>
    </div>

    <form action="{{ route('app.customers.store') }}" method="POST" class="bg-white dark:bg-slate-800 rounded-3xl p-6 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-6 text-xs">
        @csrf

        <!-- Section 1: Basic Information -->
        <div class="space-y-4">
            <h3 class="font-bold text-slate-900 dark:text-white uppercase tracking-wider text-xs border-b border-slate-100 dark:border-slate-700 pb-2">Basic Personal Information</h3>

            <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                <div>
                    <label class="block font-semibold mb-1">First Name *</label>
                    <input type="text" name="first_name" required placeholder="Mohammed" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl">
                </div>
                <div>
                    <label class="block font-semibold mb-1">Middle Name</label>
                    <input type="text" name="middle_name" placeholder="Rashid" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl">
                </div>
                <div>
                    <label class="block font-semibold mb-1">Last Name</label>
                    <input type="text" name="last_name" placeholder="Al Maktoum" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl">
                </div>
            </div>

            <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                <div>
                    <label class="block font-semibold mb-1">Nationality *</label>
                    <input type="text" name="nationality" value="Indian" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl">
                </div>
                <div>
                    <label class="block font-semibold mb-1">Gender</label>
                    <select name="gender" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl">
                        <option value="male">Male</option>
                        <option value="female">Female</option>
                    </select>
                </div>
                <div>
                    <label class="block font-semibold mb-1">Date of Birth</label>
                    <input type="date" name="dob" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl">
                </div>
            </div>
        </div>

        <!-- Section 2: Contact Info & UAE Mobile Normalization (Requirement 6, 11) -->
        <div class="space-y-4">
            <h3 class="font-bold text-slate-900 dark:text-white uppercase tracking-wider text-xs border-b border-slate-100 dark:border-slate-700 pb-2">Contact Details</h3>

            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                <div>
                    <label class="block font-semibold mb-1">Primary Mobile (UAE Phone-First) *</label>
                    <input type="text" name="primary_mobile" required value="{{ request()->query('mobile', '') }}" placeholder="0501234567 or +971501234567" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl font-bold font-mono text-sky-600">
                </div>

                <div>
                    <label class="block font-semibold mb-1">Email Address</label>
                    <input type="email" name="email" placeholder="customer@example.com" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl">
                </div>
            </div>
        </div>

        <!-- Section 3: Identity Documents (Requirement 13) -->
        <div class="space-y-4">
            <h3 class="font-bold text-slate-900 dark:text-white uppercase tracking-wider text-xs border-b border-slate-100 dark:border-slate-700 pb-2">Passport & Emirates ID Identity</h3>

            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                <div>
                    <label class="block font-semibold mb-1">Passport Number</label>
                    <input type="text" name="passport_number" placeholder="Z1234567" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl font-mono uppercase">
                </div>

                <div>
                    <label class="block font-semibold mb-1">Emirates ID (784-xxxx-xxxxxxx-x)</label>
                    <input type="text" name="emirates_id" placeholder="784-1990-1234567-1" class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl font-mono">
                </div>
            </div>
        </div>

        <div class="flex justify-end pt-4 border-t border-slate-100 dark:border-slate-700">
            <button type="submit" class="px-6 py-2.5 bg-sky-600 hover:bg-sky-700 text-white font-bold rounded-xl shadow-sm">Save Customer Profile</button>
        </div>
    </form>
</div>
@endsection
