{% extends 'game/admin/base.html.twig' %}

{% block title %}Admin Dashboard{% endblock %}

{% block admin_body %}
    <h1 style="margin: 0 0 1.5rem; font-size: 1.5rem; color: #0f172a;">Dashboard</h1>

    <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem;">
        {% set stats = [
            { label: 'Total Users',      value: totalUsers,     color: '#3b82f6' },
            { label: 'Players',          value: totalPlayers,   color: '#8b5cf6' },
            { label: 'Admins',           value: totalAdmins,    color: '#f59e0b' },
            { label: 'Games',            value: totalGames,     color: '#10b981' },
            { label: 'Active Sessions',  value: activeSessions, color: '#ef4444' },
            { label: 'Total Sessions',   value: totalSessions,  color: '#64748b' },
        ] %}

        {% for stat in stats %}
            <div style="
                background: #fff;
                border-radius: 8px;
                padding: 1.25rem;
                border-left: 4px solid {{ stat.color }};
                box-shadow: 0 1px 3px rgba(0,0,0,.07);
            ">
                <div style="font-size: 1.75rem; font-weight: 700; color: {{ stat.color }};">{{ stat.value }}</div>
                <div style="font-size: 0.8rem; color: #64748b; margin-top: 0.25rem;">{{ stat.label }}</div>
            </div>
        {% endfor %}
    </div>

    <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem;">
        <a href="{{ path('game_admin_users') }}" style="
            background: #fff;
            border-radius: 8px;
            padding: 1.25rem;
            text-decoration: none;
            color: #1e293b;
            box-shadow: 0 1px 3px rgba(0,0,0,.07);
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-weight: 600;
        ">
            <span style="font-size: 1.5rem;">👤</span> Manage Users
        </a>
        <a href="{{ path('game_admin_games') }}" style="
            background: #fff;
            border-radius: 8px;
            padding: 1.25rem;
            text-decoration: none;
            color: #1e293b;
            box-shadow: 0 1px 3px rgba(0,0,0,.07);
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-weight: 600;
        ">
            <span style="font-size: 1.5rem;">🎮</span> Manage Games
        </a>
        <a href="{{ path('game_admin_sessions') }}" style="
            background: #fff;
            border-radius: 8px;
            padding: 1.25rem;
            text-decoration: none;
            color: #1e293b;
            box-shadow: 0 1px 3px rgba(0,0,0,.07);
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-weight: 600;
        ">
            <span style="font-size: 1.5rem;">▶</span> View Sessions
        </a>
        <a href="{{ path('game_admin_email_log') }}" style="
            background: #fff;
            border-radius: 8px;
            padding: 1.25rem;
            text-decoration: none;
            color: #1e293b;
            box-shadow: 0 1px 3px rgba(0,0,0,.07);
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-weight: 600;
        ">
            <span style="font-size: 1.5rem;">✉</span> Email Log
        </a>
    </div>
{% endblock %}
