<%- include('partials/layout_start', { activePage: 'submissions', pageTitle: 'Contact Submissions' }) %>

<div class="admin-section">
    <div class="table-responsive">
        <table>
            <thead>
                <tr>
                    <th>Date</th>
                    <th>Name</th>
                    <th>Brand</th>
                    <th>Email</th>
                    <th>Budget</th>
                    <th>Destination</th>
                    <th>Message</th>
                </tr>
            </thead>
            <tbody>
                <% if (submissions.length === 0) { %>
                    <tr>
                        <td colspan="7" style="text-align: center; padding: 20px; color: #64748b;">No contact submissions found.</td>
                    </tr>
                <% } else { %>
                    <% submissions.forEach(sub => { %>
                        <tr>
                            <td style="white-space: nowrap;"><%= new Date(sub.created_at).toLocaleDateString() %></td>
                            <td><strong><%= sub.name %></strong></td>
                            <td><%= sub.brand_name || '-' %></td>
                            <td><a href="mailto:<%= sub.email %>" style="color: #3b82f6;"><%= sub.email %></a></td>
                            <td><%= sub.budget || '-' %></td>
                            <td><%= sub.destination || '-' %></td>
                            <td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis;"><%= sub.message %></td>
                        </tr>
                    <% }) %>
                <% } %>
            </tbody>
        </table>
    </div>
</div>

<%- include('partials/layout_end') %>
