@extends('layouts.app')
@section('title', 'Add Client')
@section('page-title', 'Add Client')

@section('content')

<div class="d-flex align-items-center gap-3 mb-4">
    <a href="{{ route('clients.index') }}" class="btn btn-sm btn-light"><i class="bi bi-arrow-left"></i></a>
    <h5 class="fw-700 mb-0" style="color:#1e293b;">Add New Client</h5>
</div>

<div class="row justify-content-center">
<div class="col-lg-7">
<div class="card table-card p-4">

    @if($errors->any())
        <div class="alert alert-danger rounded-3 small py-2 mb-3">
            <i class="bi bi-exclamation-circle me-1"></i> {{ $errors->first() }}
        </div>
    @endif

    <form method="POST" action="{{ route('clients.store') }}" novalidate>
    @csrf

    <div class="row g-3">
        <div class="col-sm-6">
            <label class="form-label fw-500">Contact Name <span class="text-danger">*</span></label>
            <input type="text" name="name" class="form-control @error('name') is-invalid @enderror"
                   placeholder="Amara Nwosu" value="{{ old('name') }}" required>
        </div>
        <div class="col-sm-6">
            <label class="form-label fw-500">Business Name</label>
            <input type="text" name="business_name" class="form-control"
                   placeholder="NexGen Tech Nigeria" value="{{ old('business_name') }}">
        </div>
        <div class="col-sm-6">
            <label class="form-label fw-500">Email Address</label>
            <input type="email" name="email" class="form-control @error('email') is-invalid @enderror"
                   placeholder="amara@nexgentech.ng" value="{{ old('email') }}">
            <div class="form-text">Used for sending invoices and reminders</div>
        </div>
        <div class="col-sm-6">
            <label class="form-label fw-500">Phone Number</label>
            <input type="tel" name="phone" class="form-control"
                   placeholder="0801 234 5678" value="{{ old('phone') }}">
        </div>
        <div class="col-12">
            <label class="form-label fw-500">Address</label>
            <textarea name="address" rows="2" class="form-control"
                      placeholder="3 Ozumba Mbadiwe Ave, Victoria Island, Lagos">{{ old('address') }}</textarea>
        </div>
    </div>

    <div class="d-flex gap-2 mt-4">
        <button type="submit" class="btn fw-600" style="background:#00a651;color:white;">
            <i class="bi bi-person-plus me-2"></i>Add Client
        </button>
        <a href="{{ route('clients.index') }}" class="btn btn-outline-secondary fw-600">Cancel</a>
    </div>

    </form>
</div>
</div>
</div>
@endsection
