<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}{% endblock %}</title>
    {{ pwa() }}
    {% block meta %}
        <meta name="description" content="{% block description %}E-Ticket - Plateforme de vente de tickets evenementiels pour associations{% endblock %}">
    {% endblock %}
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "Organization",
        "name": "E-Ticket",
        "url": "https://ticket.e-cosplay.fr",
        "logo": "https://ticket.e-cosplay.fr/logo.png",
        "email": "contact@e-cosplay.fr",
        "telephone": "+33679348802",
        "address": {
            "@type": "PostalAddress",
            "streetAddress": "42 rue de Saint-Quentin",
            "addressLocality": "Beautor",
            "postalCode": "02800",
            "addressCountry": "FR"
        },
        "sameAs": [
            "https://www.facebook.com/assocationecosplay",
            "https://www.e-cosplay.fr"
        ]
    }
    </script>
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "WebSite",
        "name": "E-Ticket",
        "url": "https://ticket.e-cosplay.fr",
        "potentialAction": {
            "@type": "SearchAction",
            "target": {
                "@type": "EntryPoint",
                "urlTemplate": "https://ticket.e-cosplay.fr/search?q={search_term_string}"
            },
            "query-input": "required name=search_term_string"
        }
    }
    </script>
    {% if breadcrumbs is defined and breadcrumbs is not empty %}
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "BreadcrumbList",
        "itemListElement": [
            {% for breadcrumb in breadcrumbs %}
            {
                "@type": "ListItem",
                "position": {{ loop.index }},
                "name": "{{ breadcrumb.name }}"{% if breadcrumb.url is defined and breadcrumb.url is not empty %},
                "item": "{{ absolute_url(breadcrumb.url) }}"{% endif %}
            }{% if not loop.last %},{% endif %}
            {% endfor %}
        ]
    }
    </script>
    {% endif %}
    {% block og %}
        <meta property="og:title" content="{% block og_title %}{{ block('title') }}{% endblock %}">
        <meta property="og:description" content="{% block og_description %}{{ block('description') }}{% endblock %}">
        <meta property="og:type" content="{% block og_type %}website{% endblock %}">
        <meta property="og:url" content="{{ app.request.uri }}">
        <meta property="og:locale" content="fr_FR">
        <meta property="og:site_name" content="E-Ticket">
        {% block og_image %}
            <meta property="og:image" content="https://ticket.e-cosplay.fr/logo.png">
        {% endblock %}
        <meta name="twitter:card" content="summary_large_image">
        <meta name="twitter:title" content="{{ block('og_title') }}">
        <meta name="twitter:description" content="{{ block('og_description') }}">
    {% endblock %}
    {% block stylesheets %}{% endblock %}
    {% block javascripts %}
        {{ vite_asset('app.js') }}
    {% endblock %}
    {% block head %}{% endblock %}
</head>
<body class="min-h-screen flex flex-col bg-[#fbfbfb] text-[#111827]" data-env="{{ app.environment }}" data-k="{{ analytics_key }}" data-e="{{ analytics_endpoint }}"{% if app.user and app.user.id is defined and app.request.cookies.get('e_ticket_consent') == 'accepted' %} data-uid="{{ app.user.id }}"{% endif %}>
    <header class="sticky top-0 z-50 bg-white border-b-4 border-gray-900">
        <nav class="mx-auto px-4 lg:px-8" role="navigation" aria-label="Navigation principale" itemscope itemtype="https://schema.org/SiteNavigationElement">
            <div class="flex justify-between items-center h-20">
                <div class="flex-shrink-0">
                    <a href="{{ path('app_home') }}" class="flex items-center group" aria-label="E-Ticket - Retour a l'accueil">
                        <img class="h-8 md:h-12 w-auto" src="{{ 'logo.png' | imagine_filter('navbar_logo') }}" alt="E-Ticket" loading="eager" width="48" height="48">
                    </a>
                </div>

                <div class="hidden lg:flex items-center space-x-1">
                    {% set current_route = app.request.attributes.get('_route') %}
                    <a href="{{ path('app_home') }}" itemprop="url" class="px-3 py-2 text-xs font-black uppercase tracking-widest transition-all {{ current_route == 'app_home' ? 'bg-yellow-400 border-2 border-gray-900 shadow-[2px_2px_0px_rgba(0,0,0,1)]' : 'hover:text-indigo-600' }}"><span itemprop="name">Accueil</span></a>
                    <a href="{{ path('app_events') }}" itemprop="url" class="px-3 py-2 text-xs font-black uppercase tracking-widest transition-all {{ current_route in ['app_events', 'app_event_detail'] ? 'bg-yellow-400 border-2 border-gray-900 shadow-[2px_2px_0px_rgba(0,0,0,1)]' : 'hover:text-indigo-600' }}"><span itemprop="name">Evenements</span></a>
                    <a href="{{ path('app_organizers') }}" itemprop="url" class="px-3 py-2 text-xs font-black uppercase tracking-widest transition-all {{ current_route in ['app_organizers', 'app_organizer_detail'] ? 'bg-yellow-400 border-2 border-gray-900 shadow-[2px_2px_0px_rgba(0,0,0,1)]' : 'hover:text-indigo-600' }}"><span itemprop="name">Organisateurs</span></a>
                    <a href="{{ path('app_contact') }}" itemprop="url" class="px-3 py-2 text-xs font-black uppercase tracking-widest transition-all {{ current_route == 'app_contact' ? 'bg-yellow-400 border-2 border-gray-900 shadow-[2px_2px_0px_rgba(0,0,0,1)]' : 'hover:text-indigo-600' }}"><span itemprop="name">Contact</span></a>
                    <a href="https://www.e-cosplay.fr" target="_blank" itemprop="url" class="px-3 py-2 text-xs font-black uppercase tracking-widest transition-all hover:text-indigo-600"><span itemprop="name">E-Cosplay</span></a>
                </div>

                <div class="flex items-center space-x-4 border-l-4 border-gray-900 pl-6 h-full">
                    <div class="flex items-center gap-2">
                        {% if app.user %}
                            <a href="{{ path('app_account') }}" class="p-2 border-2 border-gray-900 bg-white text-gray-900 hover:bg-gray-900 hover:text-white transition-all flex items-center justify-center" aria-label="Mon espace">
                                <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
                            </a>
                        {% else %}
                            <a href="{{ path('app_register') }}" class="hidden lg:inline-flex px-3 py-1.5 border-2 border-gray-900 bg-[#fabf04] text-gray-900 text-xs font-black uppercase tracking-widest hover:bg-yellow-500 transition-all items-center">Inscription</a>
                            <a href="{{ path('app_login') }}" class="p-2 border-2 border-gray-900 bg-white text-gray-900 hover:bg-gray-900 hover:text-white transition-all flex items-center justify-center" aria-label="Connexion">
                                <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/></svg>
                            </a>
                        {% endif %}

                        <button id="mobile-menu-btn" class="lg:hidden p-2 border-2 border-gray-900 bg-yellow-400" aria-label="Ouvrir le menu de navigation" aria-expanded="false" aria-controls="mobile-menu">
                            <svg id="menu-icon-open" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M4 6h16M4 12h16M4 18h16"/></svg>
                            <svg id="menu-icon-close" class="w-5 h-5 hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M6 18L18 6M6 6l12 12"/></svg>
                        </button>
                    </div>
                </div>
            </div>
        </nav>

        <div id="mobile-menu" class="hidden lg:hidden border-t-4 border-gray-900 bg-white" role="menu">
            <div class="p-4 space-y-2 uppercase font-black italic">
                <a href="{{ path('app_home') }}" class="block p-3 border-2 {{ current_route == 'app_home' ? 'border-gray-900 bg-yellow-400' : 'border-transparent hover:border-gray-900 hover:bg-gray-50' }}" role="menuitem">Accueil</a>
                <a href="{{ path('app_events') }}" class="block p-3 border-2 {{ current_route in ['app_events', 'app_event_detail'] ? 'border-gray-900 bg-yellow-400' : 'border-transparent hover:border-gray-900 hover:bg-gray-50' }}" role="menuitem">Evenements</a>
                <a href="{{ path('app_organizers') }}" class="block p-3 border-2 {{ current_route in ['app_organizers', 'app_organizer_detail'] ? 'border-gray-900 bg-yellow-400' : 'border-transparent hover:border-gray-900 hover:bg-gray-50' }}" role="menuitem">Organisateurs</a>
                <a href="{{ path('app_contact') }}" class="block p-3 border-2 {{ current_route == 'app_contact' ? 'border-gray-900 bg-yellow-400' : 'border-transparent hover:border-gray-900 hover:bg-gray-50' }}" role="menuitem">Contact</a>
                <a href="https://www.e-cosplay.fr" target="_blank" class="block p-3 border-2 border-transparent hover:border-gray-900 hover:bg-gray-50" role="menuitem">E-Cosplay</a>
                {% if app.user %}
                    <a href="{{ path('app_account') }}" class="block p-3 border-2 border-transparent hover:border-gray-900 hover:bg-gray-50" role="menuitem">Mon espace</a>
                {% else %}
                    <a href="{{ path('app_login') }}" class="block p-3 border-2 border-transparent hover:border-gray-900 hover:bg-gray-50" role="menuitem">Connexion</a>
                    <a href="{{ path('app_register') }}" class="block p-3 border-2 border-gray-900 bg-[#fabf04] text-center" role="menuitem">Inscription</a>
                {% endif %}
            </div>
        </div>
    </header>

    <main class="flex-1">
        {% block body %}{% endblock %}
    </main>

    <footer class="bg-yellow-400 border-t-8 border-gray-900 text-gray-900 mt-auto">
        <div class="max-w-7xl mx-auto py-12 px-4">
            <div class="flex flex-wrap gap-12 pb-12 mb-12 border-b-4 border-gray-900">
                <div class="flex-1 min-w-[280px]">
                    <h3 class="text-3xl font-black uppercase tracking-tighter italic border-b-4 border-gray-900 inline-block mb-4">Nous Contacter</h3>
                    <p class="font-bold text-lg leading-snug">42 RUE DE SAINT-QUENTIN<br>02800 BEAUTOR, FRANCE</p>
                    <a href="mailto:contact@e-cosplay.fr" class="inline-block mt-4 px-4 py-2 bg-gray-900 text-white font-black uppercase text-sm hover:bg-indigo-600 transition-colors">
                        contact@e-cosplay.fr
                    </a>
                </div>

                <div class="flex-1 min-w-[280px]">
                    <h3 class="text-3xl font-black uppercase tracking-tighter italic border-b-4 border-gray-900 inline-block mb-4">E-Ticket</h3>
                    <p class="font-bold text-gray-800 italic leading-normal">
                        E-Ticket est une plateforme de billetterie destinee aux associations
                        pour la vente de tickets evenementiels, la reservation de tables,
                        l'organisation de brocantes et le vote en ligne.
                    </p>
                </div>
            </div>

            <div class="flex flex-col sm:flex-row flex-wrap justify-between items-start sm:items-center gap-6">
                <div>
                    <p class="font-black uppercase text-sm">&copy; {{ "now"|date("Y") }} E-TICKET.</p>
                    <p class="text-[11px] font-bold opacity-80">Solution proposee par l'association <a href="https://www.e-cosplay.fr" class="underline hover:no-underline">e-cosplay.fr</a></p>
                    <p class="text-[10px] font-bold opacity-70">RNA N&deg;W022006988</p>
                </div>
                <div class="flex flex-wrap gap-2">
                    <a href="{{ path('app_mentions_legales') }}" class="text-[10px] px-2 py-1 font-black uppercase bg-gray-900 text-white hover:bg-indigo-600 transition-colors">Mentions Legales</a>
                    <a href="{{ path('app_cookies') }}" class="text-[10px] px-2 py-1 font-black uppercase bg-gray-900 text-white hover:bg-indigo-600 transition-colors">Politique de Cookies</a>
                    <a href="{{ path('app_cgu') }}" class="text-[10px] px-2 py-1 font-black uppercase bg-gray-900 text-white hover:bg-indigo-600 transition-colors">CGU</a>
                    <a href="{{ path('app_cgv') }}" class="text-[10px] px-2 py-1 font-black uppercase bg-gray-900 text-white hover:bg-indigo-600 transition-colors">CGV</a>
                    <a href="{{ path('app_rgpd') }}" class="text-[10px] px-2 py-1 font-black uppercase bg-gray-900 text-white hover:bg-indigo-600 transition-colors">Politique RGPD</a>
                    <a href="{{ path('app_hosting') }}" class="text-[10px] px-2 py-1 font-black uppercase bg-gray-900 text-white hover:bg-indigo-600 transition-colors">Hebergement</a>
                    <a href="{{ path('app_tarifs') }}" class="text-[10px] px-2 py-1 font-black uppercase bg-gray-900 text-white hover:bg-indigo-600 transition-colors">Tarifs</a>
                    <a href="{{ path('app_conformite') }}" class="text-[10px] px-2 py-1 font-black uppercase bg-gray-900 text-white hover:bg-indigo-600 transition-colors">Conformite</a>
                </div>
            </div>
        </div>
    </footer>

    <div id="cookie-banner" class="hidden fixed bottom-0 left-0 right-0 z-50 border-t-4 border-gray-900 bg-white p-4">
        <div class="max-w-4xl mx-auto flex flex-col sm:flex-row items-center justify-between gap-4">
            <p class="text-sm font-bold text-gray-700">
                Ce site utilise des cookies pour mesurer l'audience. <a href="{{ path('app_cookies') }}" class="text-indigo-800 underline hover:text-indigo-950">En savoir plus</a>
            </p>
            <div class="flex gap-2">
                <button id="cookie-refuse" class="px-4 py-2 border-2 border-gray-900 bg-white font-black uppercase text-xs tracking-widest hover:bg-gray-100 transition-all cursor-pointer">Refuser</button>
                <button id="cookie-accept" class="px-4 py-2 border-2 border-gray-900 bg-[#fabf04] font-black uppercase text-xs tracking-widest hover:bg-indigo-600 hover:text-white transition-all cursor-pointer">Accepter</button>
            </div>
        </div>
    </div>
</body>
</html>
