{% extends "base.html" %}

{% block title %}{{ _('Create Client') }} - {{ app_name }}{% endblock %}

{% block content %}
<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="d-flex justify-content-between align-items-center mb-4">
                <h1 class="h3 mb-0">
                    <i class="fas fa-plus text-primary"></i> {{ _('Create New Client') }}
                </h1>
                <a href="{{ url_for('clients.list_clients') }}" class="btn btn-secondary">
                    <i class="fas fa-arrow-left"></i> {{ _('Back to Clients') }}
                </a>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-8">
            <div class="card">
                <div class="card-header">
                    <h5 class="mb-0">
                        <i class="fas fa-info-circle"></i> {{ _('Client Information') }}
                    </h5>
                </div>
                <div class="card-body">
                    <form method="POST" action="{{ url_for('clients.create_client') }}" novalidate>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="mb-3">
                                    <label for="name" class="form-label">{{ _('Client Name') }} *</label>
                                    <input type="text" class="form-control" id="name" name="name" required 
                                           value="{{ request.form.get('name','') }}" placeholder="{{ _('Enter client name') }}">
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="mb-3">
                                    <label for="default_hourly_rate" class="form-label">{{ _('Default Hourly Rate') }}</label>
                                    <input type="number" step="0.01" min="0" class="form-control" id="default_hourly_rate" 
                                           name="default_hourly_rate" value="{{ request.form.get('default_hourly_rate','') }}" 
                                           placeholder="{{ _('e.g. 75.00') }}">
                                    <div class="form-text">{{ _('This rate will be automatically filled when creating projects for this client') }}</div>
                                </div>
                            </div>
                        </div>

                        <div class="mb-3">
                            <label for="description" class="form-label">{{ _('Description') }}</label>
                            <textarea class="form-control" id="description" name="description" rows="3" 
                                      placeholder="{{ _('Brief description of the client or project scope') }}">{{ request.form.get('description','') }}</textarea>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="mb-3">
                                    <label for="contact_person" class="form-label">{{ _('Contact Person') }}</label>
                                    <input type="text" class="form-control" id="contact_person" name="contact_person" 
                                           value="{{ request.form.get('contact_person','') }}" placeholder="{{ _('Primary contact name') }}">
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="mb-3">
                                    <label for="email" class="form-label">{{ _('Email') }}</label>
                                    <input type="email" class="form-control" id="email" name="email" 
                                           value="{{ request.form.get('email','') }}" placeholder="{{ _('contact@client.com') }}">
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="mb-3">
                                    <label for="phone" class="form-label">{{ _('Phone') }}</label>
                                    <input type="tel" class="form-control" id="phone" name="phone" 
                                           value="{{ request.form.get('phone','') }}" placeholder="{{ _('+1 (555) 123-4567') }}">
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="mb-3">
                                    <label for="address" class="form-label">{{ _('Address') }}</label>
                                    <textarea class="form-control" id="address" name="address" rows="2" 
                                              placeholder="{{ _('Client address') }}">{{ request.form.get('address','') }}</textarea>
                                </div>
                            </div>
                        </div>

                        <div class="d-flex justify-content-between">
                            <a href="{{ url_for('clients.list_clients') }}" class="btn btn-secondary">
                                <i class="fas fa-times"></i> {{ _('Cancel') }}
                            </a>
                            <button type="submit" class="btn btn-primary">
                                <i class="fas fa-save"></i> {{ _('Create Client') }}
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <div class="col-lg-4">
            <div class="card">
                <div class="card-header">
                    <h5 class="mb-0">
                        <i class="fas fa-info-circle"></i> {{ _('Help') }}
                    </h5>
                </div>
                <div class="card-body">
                    <h6>{{ _('Client Name') }}</h6>
                    <p class="text-muted small">{{ _('Choose a clear, descriptive name for the client organization.') }}</p>
                    
                    <h6>{{ _('Default Hourly Rate') }}</h6>
                    <p class="text-muted small">{{ _('Set the standard hourly rate for this client. This will automatically populate when creating new projects.') }}</p>
                    
                    <h6>{{ _('Contact Information') }}</h6>
                    <p class="text-muted small">{{ _('Add contact details for easy communication and record keeping.') }}</p>
                    
                    <h6>{{ _('Description') }}</h6>
                    <p class="text-muted small">{{ _('Provide context about the client relationship or typical project types.') }}</p>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
