<!DOCTYPE html>
<html class="light" lang="fr">
    <head>
        <meta charset="utf-8"/>
        <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
        <title>Admin Event List</title>
        <!-- Google Fonts -->
        <link href="https://fonts.googleapis.com" rel="preconnect"/>
        <link crossorigin="" href="https://fonts.gstatic.com" rel="preconnect"/>
        <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&amp;display=swap" rel="stylesheet"/>
        <!-- Material Symbols -->
        <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&amp;display=swap" rel="stylesheet"/>
        <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&amp;display=swap" rel="stylesheet"/>
        <!-- Tailwind CSS -->
        <script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
        <!-- Tailwind Theme Config -->
        <script id="tailwind-config">
            tailwind.config = {
                darkMode: "class",
                theme: {
                    extend: {
                        colors: {
                            "primary": "#2b8cee",
                            "background-light": "#f6f7f8",
                            "background-dark": "#101922",
                            "body-bg": "#F9FAFB",
                            "card-bg": "#FFFFFF",
                            "dark-text": "#111827"
                            },
                        fontFamily: {
                            "display": ["Inter", "sans-serif"]
                        },
                        borderRadius: {"DEFAULT": "0.25rem", "lg": "0.5rem", "xl": "0.75rem", "full": "9999px"},
                    },
                },
            }
        </script>
    </head>
<body class="bg-background-light dark:bg-background-dark text-slate-900 dark:text-white font-display">
    <div class="relative flex h-auto min-h-screen w-full flex-col  font-display text-[#111418]">
        <!-- Sidebar -->
        <header class="sticky top-0 z-50 flex items-center justify-between whitespace-nowrap border-b border-solid border-b-[#f0f2f4] bg-white px-4 py-3 lg:px-10">
            <div class="flex items-center gap-4 lg:gap-8">
                <div class="flex items-center gap-2 text-[#111418]">
                    <div class="size-8 text-primary">
                        <img src="<?= base_url('assets/img/MEN.jpg') ?>" alt="Mon logo" class="h-8 w-30 object-contain">
                    </div>
                    <h2 class="text-lg font-bold leading-tight tracking-[-0.015em] hidden sm:block">Evenement MEN</h2>
                   
                </div>
            </div>
           
             
        </header>
        <!-- Main Content -->
         <main class="flex-1 flex flex-col h-full overflow-hidden relative">
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-8">
                <div class="flex flex-col md:flex-row md:items-end justify-between gap-4">
                    <div>
                        <h2 class="text-3xl font-black tracking-tight text-dark-text">Events Analytics</h2>
                        <p class="text-slate-500 mt-1">Overview of event performance and historical engagement data.</p>
                    </div>
                    <div class="flex gap-3">
                        <button class="flex items-center gap-2 px-4 py-2 border border-slate-200 rounded-lg text-sm font-semibold hover:bg-slate-50 transition-colors bg-white">
                        <span class="material-symbols-outlined text-lg">calendar_month</span>
                        Last 12 Months
                        </button>
                        <button onclick="openEventModal()" class="px-6 py-3 bg-blue-600 text-white rounded-xl hover:bg-blue-700">
                            <span class="material-symbols-outlined text-[20px]">add</span>
                            <span>Ajout Evenement</span>
                        </button>
                    </div>
                </div>
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
                    <div class="bg-card-bg p-6 rounded-xl border border-slate-200 shadow-sm">
                        <div class="flex justify-between items-start mb-4">
                            <div class="p-2 bg-blue-50 text-blue-600 rounded-lg">
                                <span class="material-symbols-outlined">event</span>
                            </div>
                            <span class="text-emerald-600 text-xs font-bold bg-emerald-50 px-2 py-1 rounded-full">+12.5%</span>
                        </div>
                        <p class="text-slate-500 text-sm font-medium">Total Events</p>
                        <h3 class="text-2xl font-bold mt-1">12,840</h3>
                    </div>
                    <div class="bg-card-bg p-6 rounded-xl border border-slate-200 shadow-sm">
                        <div class="flex justify-between items-start mb-4">
                            <div class="p-2 bg-purple-50 text-purple-600 rounded-lg">
                                <span class="material-symbols-outlined">group</span>
                            </div>
                            <span class="text-emerald-600 text-xs font-bold bg-emerald-50 px-2 py-1 rounded-full">+5.2%</span>
                        </div>
                        <p class="text-slate-500 text-sm font-medium">Active Users</p>
                        <h3 class="text-2xl font-bold mt-1">48,291</h3>
                    </div>
                    <div class="bg-card-bg p-6 rounded-xl border border-slate-200 shadow-sm">
                        <div class="flex justify-between items-start mb-4">
                            <div class="p-2 bg-emerald-50 text-emerald-600 rounded-lg">
                                <span class="material-symbols-outlined">trending_up</span>
                            </div>
                            <span class="text-emerald-600 text-xs font-bold bg-emerald-50 px-2 py-1 rounded-full">+18.2%</span>
                        </div>
                        <p class="text-slate-500 text-sm font-medium">Monthly Growth</p>
                        <h3 class="text-2xl font-bold mt-1">24.5%</h3>
                    </div>
                    <div class="bg-card-bg p-6 rounded-xl border border-slate-200 shadow-sm">
                        <div class="flex justify-between items-start mb-4">
                            <div class="p-2 bg-orange-50 text-orange-600 rounded-lg">
                                <span class="material-symbols-outlined">confirmation_number</span>
                            </div>
                            <span class="text-rose-600 text-xs font-bold bg-rose-50 px-2 py-1 rounded-full">-2.4%</span>
                        </div>
                        <p class="text-slate-500 text-sm font-medium">Avg Attendance</p>
                        <h3 class="text-2xl font-bold mt-1">852</h3>
                    </div>
                </div>
                <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
                    <div class="bg-card-bg p-8 rounded-2xl border border-slate-200 shadow-sm flex flex-col">
                        <div class="flex items-center justify-between mb-8">
                            <div>
                                <h4 class="text-lg font-bold text-dark-text">Events per Year</h4>
                                <p class="text-sm text-slate-500">Activity comparison 2020-2024</p>
                            </div>
                            <button class="material-symbols-outlined text-slate-400 hover:text-slate-600 transition-colors">more_horiz</button>
                        </div>
                            <div class="flex-1 flex items-end justify-between gap-4 h-64 mt-4 relative">
                                <div class="absolute inset-0 flex flex-col justify-between pointer-events-none">
                                    <div class="w-full border-t border-slate-100"></div>
                                    <div class="w-full border-t border-slate-100"></div>
                                    <div class="w-full border-t border-slate-100"></div>
                                    <div class="w-full border-t border-slate-100"></div>
                                    <div class="w-full border-t border-slate-100"></div>
                                </div>
                                <div class="flex-1 flex flex-col items-center gap-3 group relative z-10">
                                <div class="w-full bg-indigo-500/10 hover:bg-indigo-500/20 rounded-t-lg transition-all relative overflow-hidden group-hover:ring-1 ring-indigo-500/50" style="height: 40%;">
                                    <div class="absolute bottom-0 left-0 w-full h-1 bg-indigo-500"></div>
                                </div>
                                <span class="text-xs font-bold text-slate-400 uppercase tracking-tighter">2020</span>
                            </div>
                            <div class="flex-1 flex flex-col items-center gap-3 group relative z-10">
                                <div class="w-full bg-indigo-500/10 hover:bg-indigo-500/20 rounded-t-lg transition-all relative overflow-hidden group-hover:ring-1 ring-indigo-500/50" style="height: 60%;">
                                    <div class="absolute bottom-0 left-0 w-full h-1 bg-indigo-500"></div>
                                </div>
                                <span class="text-xs font-bold text-slate-400 uppercase tracking-tighter">2021</span>
                            </div>
                            <div class="flex-1 flex flex-col items-center gap-3 group relative z-10">
                                <div class="w-full bg-indigo-600 rounded-t-lg transition-all relative shadow-lg shadow-indigo-500/20" style="height: 95%;">
                                    <div class="absolute top-2 left-1/2 -translate-x-1/2 text-[10px] text-white font-bold">Peak</div>
                                </div>
                                <span class="text-xs font-bold text-slate-400 uppercase tracking-tighter">2022</span>
                            </div>
                            <div class="flex-1 flex flex-col items-center gap-3 group relative z-10">
                                <div class="w-full bg-indigo-500/10 hover:bg-indigo-500/20 rounded-t-lg transition-all relative overflow-hidden group-hover:ring-1 ring-indigo-500/50" style="height: 75%;">
                                    <div class="absolute bottom-0 left-0 w-full h-1 bg-indigo-500"></div>
                                </div>
                                <span class="text-xs font-bold text-slate-400 uppercase tracking-tighter">2023</span>
                            </div>
<div class="flex-1 flex flex-col items-center gap-3 group relative z-10">
<div class="w-full bg-indigo-500/10 hover:bg-indigo-500/20 rounded-t-lg transition-all relative overflow-hidden group-hover:ring-1 ring-indigo-500/50" style="height: 85%;">
<div class="absolute bottom-0 left-0 w-full h-1 bg-indigo-500"></div>
</div>
<span class="text-xs font-bold text-slate-400 uppercase tracking-tighter">2024</span>
</div>
</div>
</div>
<div class="bg-card-bg p-8 rounded-2xl border border-slate-200 shadow-sm flex flex-col">
<div class="flex items-center justify-between mb-8">
<div>
<h4 class="text-lg font-bold text-dark-text">Monthly Events</h4>
<p class="text-sm text-slate-500">Performance for current year</p>
</div>
<div class="flex items-center gap-2">
<div class="flex items-center gap-1.5 px-2 py-1 bg-emerald-50 rounded-md">
<div class="size-2 bg-emerald-500 rounded-full"></div>
<span class="text-[10px] font-bold text-emerald-600 uppercase tracking-wider">On Track</span>
</div>
</div>
</div>
<div class="flex-1 h-64 mt-4 relative">
<div class="absolute inset-0 flex flex-col justify-between pointer-events-none pb-6">
<div class="w-full border-t border-slate-100"></div>
<div class="w-full border-t border-slate-100"></div>
<div class="w-full border-t border-slate-100"></div>
<div class="w-full border-t border-slate-100"></div>
</div>
<svg class="w-full h-full relative z-10" preserveAspectRatio="none" viewBox="0 0 500 200">
<defs>
<linearGradient id="gradientGreen" x1="0%" x2="0%" y1="0%" y2="100%">
<stop offset="0%" stop-color="#10b981" stop-opacity="0.2"></stop>
<stop offset="100%" stop-color="#10b981" stop-opacity="0"></stop>
</linearGradient>
</defs>
<path d="M0,160 C50,150 70,100 100,110 C130,120 150,40 200,60 C250,80 270,160 300,150 C330,140 370,20 420,30 C470,40 500,80 500,80 V200 H0 Z" fill="url(#gradientGreen)"></path>
<path d="M0,160 C50,150 70,100 100,110 C130,120 150,40 200,60 C250,80 270,160 300,150 C330,140 370,20 420,30 C470,40 500,80 500,80" fill="none" stroke="#10b981" stroke-linecap="round" stroke-width="3"></path>
<circle cx="420" cy="30" fill="#10b981" r="5"></circle>
<circle cx="420" cy="30" fill="#10b981" fill-opacity="0.2" r="10"></circle>
</svg>
<div class="flex justify-between mt-4">
<span class="text-[10px] font-bold text-slate-400">JAN</span>
<span class="text-[10px] font-bold text-slate-400">MAR</span>
<span class="text-[10px] font-bold text-slate-400">MAY</span>
<span class="text-[10px] font-bold text-slate-400">JUL</span>
<span class="text-[10px] font-bold text-slate-400">SEP</span>
<span class="text-[10px] font-bold text-slate-400">NOV</span>
</div>
</div>
</div>
</div>
<div class="bg-card-bg rounded-2xl border border-slate-200 shadow-sm overflow-hidden mb-8">
<div class="p-6 border-b border-slate-200 flex items-center justify-between bg-white">
<h4 class="font-bold text-dark-text">Upcoming Featured Events</h4>
<button class="text-sm font-semibold text-primary hover:underline">View All</button>
</div>
<div class="overflow-x-auto">
<table class="w-full text-left">
<thead>
<tr class="bg-slate-50 text-slate-500 text-xs font-bold uppercase tracking-wider">
<th class="px-6 py-4">Event Name</th>
<th class="px-6 py-4">Date</th>
<th class="px-6 py-4">Tickets Sold</th>
<th class="px-6 py-4">Revenue</th>
<th class="px-6 py-4 text-right">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-100">
<tr class="hover:bg-slate-50 transition-colors">
<td class="px-6 py-4">
<div class="flex items-center gap-3">
<div class="size-8 rounded bg-primary/10 flex items-center justify-center text-primary">
<span class="material-symbols-outlined text-sm">code</span>
</div>
<span class="text-sm font-semibold text-dark-text">TechCon 2024</span>
</div>
</td>
<td class="px-6 py-4 text-sm text-slate-600">Oct 12, 2024</td>
<td class="px-6 py-4 text-sm text-slate-600">1,240 / 1,500</td>
<td class="px-6 py-4 text-sm font-medium text-dark-text">$45,200</td>
<td class="px-6 py-4 text-right">
<span class="px-2 py-1 bg-emerald-100 text-emerald-600 text-[10px] font-bold rounded uppercase">Active</span>
</td>
</tr>
<tr class="hover:bg-slate-50 transition-colors">
<td class="px-6 py-4">
<div class="flex items-center gap-3">
<div class="size-8 rounded bg-purple-50 flex items-center justify-center text-purple-600">
<span class="material-symbols-outlined text-sm">palette</span>
</div>
<span class="text-sm font-semibold text-dark-text">Design Week NY</span>
</div>
</td>
<td class="px-6 py-4 text-sm text-slate-600">Nov 05, 2024</td>
<td class="px-6 py-4 text-sm text-slate-600">850 / 1,000</td>
<td class="px-6 py-4 text-sm font-medium text-dark-text">$12,800</td>
<td class="px-6 py-4 text-right">
<span class="px-2 py-1 bg-blue-100 text-blue-600 text-[10px] font-bold rounded uppercase">Pending</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</main>
    </div>

    <!-- MODAL AJOUT EVENEMENT -->
    <div id="eventModal"
        class="fixed inset-0 z-50 hidden items-center justify-center bg-black/60 backdrop-blur-sm">

        <div class="bg-white w-full max-w-2xl rounded-2xl shadow-xl p-6">

            <!-- HEADER -->
            <div class="flex justify-between items-center mb-6">
                <h2 class="text-xl font-semibold">Ajouter un événement</h2>
                <button onclick="closeEventModal()"
                    class="text-slate-500 hover:text-red-500 text-2xl">&times;</button>
            </div>

            <!-- FORM -->
            <form action="ajEvenement" method="post" enctype="multipart/form-data" class="space-y-6">

                <!-- Nom -->
                <div>
                    <label class="block text-sm font-medium mb-1">Nom de l’événement</label>
                    <input type="text" name="nom_evenement" placeholder="Ex : Arbre de Noël" class="w-full rounded-xl border px-4 py-3 focus:ring-2 focus:ring-blue-500">
                </div>

                <!-- Dates -->
                <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                    <div>
                        <label class="block text-sm font-medium mb-1">Date de début</label>
                        <input type="date" name="date_debut" class="w-full rounded-xl border px-4 py-3">
                    </div>

                    <div>
                        <label class="block text-sm font-medium mb-1">Date de fin</label>
                        <input type="date" name="date_fin" class="w-full rounded-xl border px-4 py-3">
                    </div>
                </div>

                <!-- Description -->
                <div>
                    <label class="block text-sm font-medium mb-1">Description</label>
                    <textarea name="description" rows="4" placeholder="Décrivez l’événement..." class="w-full rounded-xl border px-4 py-3"></textarea>
                </div>

                <!-- Image -->
                <div>
                    <label class="block text-sm font-medium mb-2">Image</label>
                    <label class="flex flex-col items-center justify-center gap-2 p-6 border-2 border-dashed rounded-xl cursor-pointer hover:border-blue-500 transition">
                        <span class="material-symbols-outlined text-blue-600 text-3xl">upload</span>
                        <span class="text-sm text-slate-600 text-center"> Cliquez pour choisir une image<br>
                        <span class="text-xs">PNG, JPG — max 5MB</span>
                        </span>
                        <input type="file" name="image" accept="image/*" class="hidden">
                    </label>
                </div>

                <!-- FOOTER -->
                <div class="flex justify-end gap-4 pt-6 border-t"> 
                    <button type="button" onclick="closeEventModal()" class="px-6 py-3 rounded-xl border">Annuler</button>

                    <button type="submit" class="px-6 py-3 rounded-xl bg-blue-600 text-white font-medium hover:bg-blue-700"> Enregistrer</button>
                </div>

            </form>
        </div>
    </div>

    <script>
        function openEventModal() {
            document.getElementById('eventModal').classList.remove('hidden');
            document.getElementById('eventModal').classList.add('flex');
        }

        function closeEventModal() {
            document.getElementById('eventModal').classList.add('hidden');
            document.getElementById('eventModal').classList.remove('flex');
        }
    </script>


</body>
</html>