<div class="max-w-4xl mx-auto">
  <div class="mb-6">
    <%= link_to '← Back to Messages', site_admin_messages_path, class: 'text-blue-600 hover:text-blue-800' %>
  </div>

  <div class="bg-white rounded-lg shadow overflow-hidden">
    <div class="px-6 py-4 border-b border-gray-200">
      <h1 class="text-2xl font-bold text-gray-900">Message Details</h1>
    </div>

    <div class="p-6">
      <dl class="grid grid-cols-1 gap-x-4 gap-y-6">
        <div>
          <dt class="text-sm font-medium text-gray-500">Email</dt>
          <dd class="mt-1 text-sm text-gray-900"><%= @message.origin_email.presence || 'N/A' %></dd>
        </div>

        <div>
          <dt class="text-sm font-medium text-gray-500">Date</dt>
          <dd class="mt-1 text-sm text-gray-900"><%= format_date(@message.created_at) %></dd>
        </div>

        <% if @message.content.present? %>
          <div>
            <dt class="text-sm font-medium text-gray-500">Message</dt>
            <dd class="mt-1 text-sm text-gray-900 whitespace-pre-wrap"><%= @message.content %></dd>
          </div>
        <% end %>
      </dl>
    </div>
  </div>
</div>
