<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Admin{% endblock %} - E-Ticket</title>
    {% block javascripts %}
        {{ vite_asset('admin.js') }}
    {% endblock %}
</head>
<body class="admin-body min-h-screen flex flex-col">
    <header class="admin-header bg-white sticky top-0 z-50">
        <div class="flex items-center justify-between h-16 px-6">
            <div class="flex items-center gap-6">
                <a href="{{ path('app_admin_dashboard') }}" class="flex items-center gap-3">
                    <div class="admin-badge px-2 py-1 text-xs font-black uppercase">Admin</div>
                    <span class="text-xl font-black uppercase tracking-tighter italic">E-Ticket</span>
                </a>
                <nav class="flex items-center gap-1 ml-6">
                    {% set current_route = app.request.attributes.get('_route') %}
                    <a href="{{ path('app_admin_dashboard') }}" class="px-3 py-1.5 text-xs font-black uppercase tracking-widest transition-all {{ current_route == 'app_admin_dashboard' ? 'admin-nav-active' : 'hover:bg-gray-100' }}">Dashboard</a>
                    <a href="{{ path('app_admin_buyers') }}" class="px-3 py-1.5 text-xs font-black uppercase tracking-widest transition-all {{ current_route starts with 'app_admin_buyer' ? 'admin-nav-active' : 'hover:bg-gray-100' }}">Acheteurs</a>
                    <a href="{{ path('app_admin_organizers') }}" class="px-3 py-1.5 text-xs font-black uppercase tracking-widest transition-all {{ current_route starts with 'app_admin_organizer' ? 'admin-nav-active' : 'hover:bg-gray-100' }}">Organisateurs</a>
                    <a href="{{ path('app_admin_events') }}" class="px-3 py-1.5 text-xs font-black uppercase tracking-widest transition-all {{ current_route starts with 'app_admin_event' ? 'admin-nav-active' : 'hover:bg-gray-100' }}">Evenements</a>
                    <a href="{{ path('app_admin_orders') }}" class="px-3 py-1.5 text-xs font-black uppercase tracking-widest transition-all {{ current_route == 'app_admin_orders' ? 'admin-nav-active' : 'hover:bg-gray-100' }}">Commandes</a>
                    <a href="{{ path('app_admin_logs') }}" class="px-3 py-1.5 text-xs font-black uppercase tracking-widest transition-all {{ current_route == 'app_admin_logs' ? 'admin-nav-active' : 'hover:bg-gray-100' }}">Logs</a>
                    <a href="{{ path('app_admin_analytics') }}" class="px-3 py-1.5 text-xs font-black uppercase tracking-widest transition-all {{ current_route == 'app_admin_analytics' ? 'admin-nav-active' : 'hover:bg-gray-100' }}">Analytics</a>
                    <a href="{{ path('app_admin_infra') }}" class="px-3 py-1.5 text-xs font-black uppercase tracking-widest transition-all {{ current_route == 'app_admin_infra' ? 'admin-nav-active' : 'hover:bg-gray-100' }}">Infra</a>
                </nav>
            </div>
            <div class="flex items-center gap-3">
                <a href="{{ path('app_home') }}" class="admin-nav-link px-3 py-1.5 text-xs font-black uppercase tracking-widest bg-white hover:bg-gray-100 transition-all">Retour au site</a>
                <a href="{{ path('app_logout') }}" class="admin-nav-dark px-3 py-1.5 text-xs font-black uppercase tracking-widest text-white hover:bg-red-600 transition-all">Deconnexion</a>
            </div>
        </div>
    </header>

    <main class="flex-1 admin-main">
        {% for message in app.flashes('success') %}
            <div class="flash-success">
                <p class="font-black text-sm">{{ message }}</p>
            </div>
        {% endfor %}
        {% for message in app.flashes('error') %}
            <div class="flash-error">
                <p class="font-black text-sm">{{ message }}</p>
            </div>
        {% endfor %}
        {% block body %}{% endblock %}
    </main>
</body>
</html>
