<%# Local variables expected:
  # - f: form builder object
  # - show_category: boolean (default: true) - whether to show category field
  # - show_notes: boolean (default: true) - whether to show notes field
  # - category_prompt: string or false (default: "Select a category") - prompt for category select, or false for no prompt
%>

<% show_category = local_assigns.fetch(:show_category, true) %>
<% show_notes = local_assigns.fetch(:show_notes, true) %>
<% category_prompt = local_assigns.fetch(:category_prompt, "Select a category") %>

<% if show_category %>
  <div>
    <%= f.label :category, "Category", class: "block text-sm font-semibold text-gray-700 mb-2" %>
    <%= f.select :category,
                 Entry.categories.keys.map { |cat| [cat.humanize, cat] },
                 category_prompt ? { prompt: category_prompt } : {},
                 { required: category_prompt.present?, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition" } %>
  </div>
<% end %>

<div class="border-t border-gray-200 pt-6">
  <h3 class="text-lg font-semibold text-gray-900 mb-4">Translations (at least one required)</h3>
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
    <div>
      <%= f.label :fi, "🇫🇮 Finnish", class: "block text-sm font-medium text-gray-700 mb-2" %>
      <%= f.text_field :fi, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition" %>
    </div>

    <div>
      <%= f.label :en, "🇬🇧 English", class: "block text-sm font-medium text-gray-700 mb-2" %>
      <%= f.text_field :en, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition" %>
    </div>

    <div>
      <%= f.label :sv, "🇸🇪 Swedish", class: "block text-sm font-medium text-gray-700 mb-2" %>
      <%= f.text_field :sv, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition" %>
    </div>

    <div>
      <%= f.label :no, "🇳🇴 Norwegian", class: "block text-sm font-medium text-gray-700 mb-2" %>
      <%= f.text_field :no, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition" %>
    </div>

    <div>
      <%= f.label :ru, "🇷🇺 Russian", class: "block text-sm font-medium text-gray-700 mb-2" %>
      <%= f.text_field :ru, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition" %>
    </div>

    <div>
      <%= f.label :de, "🇩🇪 German", class: "block text-sm font-medium text-gray-700 mb-2" %>
      <%= f.text_field :de, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition" %>
    </div>
  </div>
</div>

<% if show_notes %>
  <div>
    <%= f.label :notes, "Additional Notes (optional)", class: "block text-sm font-semibold text-gray-700 mb-2" %>
    <%= f.text_area :notes, rows: 4, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition", placeholder: "Any additional context or information about this entry..." %>
  </div>
<% end %>
