<%- include('partials/layout_start', { activePage: 'dashboard', pageTitle: 'Overview' }) %>

<div class="grid-2" style="margin-bottom: 30px;">
    <!-- Stat Card: Total Submissions -->
    <div style="background: #1e293b; padding: 25px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); display: flex; align-items: center;">
        <div style="background: #e0f2fe; color: #0284c7; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-right: 20px;">
            <i class="fas fa-envelope"></i>
        </div>
        <div>
            <div style="color: #64748b; font-size: 0.9em; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px;">Total Submissions</div>
            <div style="font-size: 2rem; font-weight: bold; color: #1e293b;"><%= submissions.length %></div>
        </div>
    </div>

    <!-- Stat Card: Total Videos -->
    <div style="background: #1e293b; padding: 25px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); display: flex; align-items: center;">
        <div style="background: #fce7f3; color: #db2777; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-right: 20px;">
            <i class="fas fa-video"></i>
        </div>
        <div>
            <div style="color: #64748b; font-size: 0.9em; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px;">Uploaded Videos</div>
            <div style="font-size: 2rem; font-weight: bold; color: #1e293b;"><%= videos.length %></div>
        </div>
    </div>
</div>

<div class="grid-2">
    <div class="admin-section">
        <h3>Recent Submissions</h3>
        <% if (submissions.length > 0) { %>
            <ul style="list-style: none; padding: 0; margin: 0;">
                <% submissions.slice(0, 5).forEach(sub => { %>
                    <li style="padding: 15px 0; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between;">
                        <div>
                            <strong><%= sub.name %></strong>
                            <div style="font-size: 0.85em; color: #64748b; margin-top: 5px;"><%= sub.email %></div>
                        </div>
                        <div style="font-size: 0.85em; color: #94a3b8;"><%= new Date(sub.created_at).toLocaleDateString() %></div>
                    </li>
                <% }) %>
            </ul>
            <a href="/admin/submissions" class="btn-outline mt-4" style="display: inline-block; text-align: center; width: 100%; box-sizing: border-box; border-color: #e2e8f0; color: #64748b;">View All Submissions</a>
        <% } else { %>
            <p style="color: #64748b;">No recent submissions.</p>
        <% } %>
    </div>

    <div class="admin-section">
        <h3>Website Sections Status</h3>
        <ul style="list-style: none; padding: 0; margin: 0;">
            <% sections.forEach(section => { %>
                <li style="padding: 12px 0; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center;">
                    <i class="fas fa-check-circle" style="color: #10b981; margin-right: 15px;"></i>
                    <span style="text-transform: capitalize;"><%= section.section_key.replace('_', ' ') %> Section</span>
                </li>
            <% }) %>
        </ul>
        <a href="/admin/sections" class="btn-outline mt-4" style="display: inline-block; text-align: center; width: 100%; box-sizing: border-box; border-color: #e2e8f0; color: #64748b;">Edit Sections</a>
    </div>
</div>

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