<editable-form id="about" class="block">
  <form
    id="form-about"
    hx-post="{{ form.post_url }}"
    hx-target="#about"
    hx-swap="outerHTML"
    class="bg-white rounded-lg p-6 border border-slate-300 shadow-sm space-y-6"
  >
    <input type="hidden" data-field="title" name="title" value="{{ form.title.value }}">
    <input type="hidden" data-field="text" name="text" value="{{ form.text.value }}">

    <div class="flex items-center justify-between mb-6">
      <div class="flex items-center space-x-2">
        <div class="w-3 h-3 bg-blue-500 rounded-full"></div>
        <span class="text-sm font-medium text-slate-600">Editing About</span>
      </div>
      <span class="text-xs text-slate-500 bg-slate-200 px-2 py-1 rounded-full">Draft</span>
    </div>

    <div>
      <label class="block text-sm font-medium text-slate-700 mb-2">Title</label>
      <div
        class="bg-white rounded-lg px-4 py-3 border border-slate-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 text-xl font-semibold text-slate-800"
        contenteditable="true"
        data-field="title"
        data-type="text"
        placeholder="About section title..."
      >
        {{ form.title.value|safe }}
      </div>
      {% for error in form.title.errors %}
        <p class="mt-2 text-sm text-red-600 bg-red-50 p-2 rounded-lg">{{ error|escape }}</p>
      {% endfor %}
    </div>

    <div>
      <label class="block text-sm font-medium text-slate-700 mb-2">About Text</label>
      <div
        class="min-h-[200px] bg-white rounded-lg px-4 py-3 border border-slate-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all duration-200 prose prose-slate max-w-none"
        contenteditable="true"
        data-field="text"
        data-type="html"
        placeholder="Write about yourself, your background, interests, and goals..."
      >
        {{ form.text.value|safe }}
      </div>
      {% for error in form.text.errors %}
        <p class="mt-2 text-sm text-red-600 bg-red-50 p-2 rounded-lg">{{ error|escape }}</p>
      {% endfor %}
    </div>

    <div class="flex items-center justify-end pt-6 border-t border-slate-200">
      <button
        id="submit-about"
        type="submit"
        class="inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 text-white font-semibold rounded-xl shadow-lg hover:shadow-xl transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"
      >
        <svg class="w-5 h-5 mr-2" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
          <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"></path>
        </svg>
        Save About
      </button>
    </div>
  </form>
</editable-form>