<% content_for :title, "spawn in a new key" %>

<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
  <div class="mb-8">
    <div class="flex items-center justify-between">
      <div>
        <h1 class="text-3xl font-bold text-white mb-2">spawn in a new key</h1>
        <p class="text-gray-400">its geting real</p>
      </div>
      <%= link_to "← get me outta here",
          admin_admin_api_keys_path,
          class: "text-gray-400 hover:text-white" %>
    </div>
  </div>

  <div class="bg-dark rounded-lg p-8">
    <%= form_with model: [:admin, @admin_api_key], local: true, class: "space-y-6" do |f| %>
      <% if @admin_api_key.errors.any? %>
        <div class="bg-red-900/50 border border-red-500 rounded-lg p-4">
          <h3 class="text-red-300 font-medium mb-2">you done did it, fix this or else</h3>
          <ul class="text-red-200 text-sm space-y-1">
            <% @admin_api_key.errors.full_messages.each do |message| %>
              <li>• <%= message %></li>
            <% end %>
          </ul>
        </div>
      <% end %>

      <div>
        <%= f.label :name, class: "block text-md font-medium text-white mb-2" %>
        <%= f.text_field :name,
            placeholder: "put down something good please",
            class: "w-full px-3 py-2 bg-darkless rounded text-white focus:border-primary focus:ring-1 focus:ring-primary" %>
      </div>

      <div class="bg-yellow-900/30 border border-yellow-500/50 rounded-lg p-4">
        <h3 class="text-yellow-300 font-medium mb-2">keep in mind this gives admin access, so dont go sharing it with your dog ya goober. we also track whatever you do, so dont go out banning people or heidi will pipebomb your sorry butt</h3>
      </div>

      <div class="flex justify-end space-x-4">
        <%= link_to "fuck no imma head out",
            admin_admin_api_keys_path,
            class: "px-4 py-2 text-gray-400 hover:text-white" %>
        <%= f.submit "okay lets do this thing",
            class: "px-6 py-2 bg-primary hover:bg-red text-white rounded-lg font-medium transition-colors" %>
      </div>
    <% end %>
  </div>
</div>
