{% extends "layouts/base.html" %}
{% block content %}

<div class="card" style="max-width:600px;">
  <h3><i class="fa-solid fa-id-card" style="color:var(--color-primary);"></i> {{ t('profile') }}</h3>
  <form method="POST">
    <div class="form-group">
      <label>{{ t('full_name') }}</label>
      <input type="text" name="name" class="form-control" value="{{ user.name }}">
    </div>
    <div class="form-group">
      <label>{{ t('phone') }}</label>
      <input type="text" name="phone" class="form-control" value="{{ user.phone or '' }}">
    </div>
    <div class="form-group">
      <label>{{ t('address') }}</label>
      <input type="text" name="address" class="form-control" value="{{ user.address or '' }}">
    </div>
    <div class="form-group">
      <label>{{ t('district') }}</label>
      <select name="district" class="form-control">
        {% for d in districts %}<option {{ 'selected' if user.district==d }}>{{ d }}</option>{% endfor %}
      </select>
    </div>
    <div class="form-group">
      <label>{{ t('land_size') }}</label>
      <input type="number" step="0.1" name="land_size" class="form-control" value="{{ user.land_size or 0 }}">
    </div>
    <div class="form-group">
      <label>Preferred Crops</label>
      <input type="text" name="preferred_crops" class="form-control" value="{{ user.preferred_crops or '' }}">
    </div>
    <button type="submit" class="btn">{{ t('save_changes') }}</button>
  </form>
</div>

{% endblock %}
