/* Animations */
.slide-up { animation: slideUp 0.3s ease-out forwards; }
.fade-in { animation: fadeIn 0.2s ease-out forwards; }
.pop-in { animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Scrollbars */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 10px; }

/* Mobile & Global Settings */
body { background-color: #f9fafb; -webkit-tap-highlight-color: transparent; }
.overflow-y-auto { -webkit-overflow-scrolling: touch; }
.pb-safe { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* Custom Checkbox Toggle */
.toggle-checkbox:checked { right: 0; border-color: #68D391; }
.toggle-checkbox:checked + .toggle-label { background-color: #68D391; }
.toggle-checkbox:checked + .toggle-label-blue { background-color: #4299E1; }

/* Flatpickr Calendar Customization */
.flatpickr-calendar { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important; border-radius: 1rem !important; padding: 10px !important; border: none !important; z-index: 99999 !important; }
.flatpickr-day.selected { background: #2563eb !important; border-color: #2563eb !important; }

/* ========================================================
   DARK MODE - CSS OVERRIDES INTELLIGENTS
======================================================== */
html.dark body { background-color: #111827; color: #f9fafb; }
html.dark .bg-white { background-color: #1f2937 !important; border-color: #374151 !important; color: #f9fafb !important; }
html.dark .bg-gray-50, html.dark .bg-gray-50\/50 { background-color: #111827 !important; border-color: #374151 !important; color: #f9fafb !important; }
html.dark .bg-gray-100 { background-color: #1f2937 !important; border-color: #4b5563 !important; color: #f9fafb !important; }
html.dark .bg-gray-200 { background-color: #374151 !important; border-color: #6b7280 !important; color: #f9fafb !important; }
html.dark .text-gray-900, html.dark .text-gray-800 { color: #f9fafb !important; }
html.dark .text-gray-700, html.dark .text-gray-600 { color: #d1d5db !important; }
html.dark .text-gray-500, html.dark .text-gray-400 { color: #9ca3af !important; }
html.dark .border-gray-100, html.dark .border-gray-200, html.dark .border-gray-300 { border-color: #374151 !important; }
html.dark input, html.dark select, html.dark textarea { background-color: #1f2937 !important; border-color: #374151 !important; color: #f9fafb !important; }
html.dark input::placeholder, html.dark textarea::placeholder { color: #6b7280 !important; }
html.dark nav.bg-white { background-color: #1f2937 !important; border-color: #374151 !important; }

/* Suppression du Jaune en Mode Sombre (Remplacé par du Gris/Bleu) */
html.dark .bg-\[\#FACC15\], html.dark .bg-yellow-300, html.dark .bg-yellow-400, html.dark .bg-yellow-500 { background-color: #3b82f6 !important; color: #f9fafb !important; border-color: #2563eb !important; }
html.dark .text-yellow-400, html.dark .text-yellow-500 { color: #d1d5db !important; }
html.dark .border-yellow-400 { border-color: #3b82f6 !important; }
html.dark .focus\:ring-yellow-400:focus { --tw-ring-color: #6b7280 !important; }
html.dark .hover\:bg-yellow-500:hover, html.dark .hover\:bg-yellow-600:hover { background-color: #2563eb !important; }
html.dark #nav-upcoming.text-yellow-500 { color: #f9fafb !important; } /* Onglet actif "A venir" */

/* Protection des Badges de couleur (Pastels inversés) */
html.dark .bg-blue-50, html.dark .bg-blue-50\/50 { background-color: #172554 !important; border-color: #1e3a8a !important; color: #bfdbfe !important; }
html.dark .bg-blue-100 { background-color: #1e3a8a !important; border-color: #1e3a8a !important; color: #bfdbfe !important; }
html.dark .border-blue-100 { border-color: #1e3a8a !important; }
html.dark .border-blue-200 { border-color: #3b82f6 !important; }
html.dark .text-blue-500, html.dark .text-blue-600, html.dark .text-blue-700, html.dark .text-blue-800, html.dark .text-blue-900 { color: #93c5fd !important; }
html.dark .active\:bg-blue-50:active, html.dark .active\:bg-blue-100:active, html.dark .active\:bg-blue-200:active { background-color: #1e3a8a !important; }

html.dark .bg-green-50, html.dark .bg-green-50\/50 { background-color: #022c22 !important; border-color: #064e3b !important; color: #bbf7d0 !important; }
html.dark .bg-green-100 { background-color: #064e3b !important; border-color: #064e3b !important; color: #bbf7d0 !important; }
html.dark .border-green-100 { border-color: #064e3b !important; }
html.dark .border-green-200 { border-color: #10b981 !important; }
html.dark .text-green-500, html.dark .text-green-600, html.dark .text-green-700, html.dark .text-green-800, html.dark .text-green-900 { color: #86efac !important; }

html.dark .bg-red-50, html.dark .bg-red-50\/50 { background-color: #450a0a !important; border-color: #7f1d1d !important; color: #fecaca !important; }
html.dark .bg-red-100 { background-color: #7f1d1d !important; border-color: #7f1d1d !important; color: #fecaca !important; }
html.dark .border-red-100 { border-color: #7f1d1d !important; }
html.dark .border-red-200 { border-color: #ef4444 !important; }
html.dark .text-red-500, html.dark .text-red-600, html.dark .text-red-700, html.dark .text-red-800, html.dark .text-red-900 { color: #fca5a5 !important; }

html.dark .bg-orange-50, html.dark .bg-orange-50\/50 { background-color: #431407 !important; border-color: #7c2d12 !important; color: #fed7aa !important; }
html.dark .bg-orange-100 { background-color: #7c2d12 !important; border-color: #7c2d12 !important; color: #fed7aa !important; }
html.dark .border-orange-100 { border-color: #7c2d12 !important; }
html.dark .border-orange-200 { border-color: #f97316 !important; }
html.dark .text-orange-500, html.dark .text-orange-600, html.dark .text-orange-700, html.dark .text-orange-800, html.dark .text-orange-900 { color: #fdba74 !important; }

html.dark .bg-purple-50, html.dark .bg-purple-50\/50 { background-color: #3b0764 !important; border-color: #581c87 !important; color: #e9d5ff !important; }
html.dark .bg-purple-100 { background-color: #581c87 !important; border-color: #581c87 !important; color: #e9d5ff !important; }
html.dark .border-purple-100 { border-color: #581c87 !important; }
html.dark .border-purple-200 { border-color: #a855f7 !important; }
html.dark .text-purple-500, html.dark .text-purple-600, html.dark .text-purple-700, html.dark .text-purple-800, html.dark .text-purple-900 { color: #d8b4fe !important; }

html.dark .bg-indigo-50, html.dark .bg-indigo-50\/50 { background-color: #1e1b4b !important; border-color: #312e81 !important; color: #c7d2fe !important; }
html.dark .bg-indigo-100 { background-color: #312e81 !important; border-color: #312e81 !important; color: #c7d2fe !important; }
html.dark .border-indigo-100 { border-color: #312e81 !important; }
html.dark .border-indigo-200 { border-color: #6366f1 !important; }
html.dark .text-indigo-500, html.dark .text-indigo-600, html.dark .text-indigo-700, html.dark .text-indigo-800, html.dark .text-indigo-900 { color: #a5b4fc !important; }
html.dark .active\:bg-indigo-50:active, html.dark .active\:bg-indigo-100:active { background-color: #312e81 !important; }

/* Modales et Header (Style sombre classe) */
html.dark .bg-black\/70, html.dark .bg-black\/80 { background-color: rgba(0,0,0,0.85) !important; }
html.dark header.bg-\[\#FACC15\] { background-color: #111827 !important; color: #f9fafb !important; border-bottom: 1px solid #374151 !important; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5) !important; }
html.dark header h1, html.dark header i { color: #f9fafb !important; }
html.dark header button { background-color: #1f2937 !important; color: #f9fafb !important; border: 1px solid #374151 !important; }
html.dark header button:hover { background-color: #374151 !important; }
html.dark #date-du-jour { background-color: #1f2937 !important; color: #f9fafb !important; border: 1px solid #374151 !important; }
html.dark .flatpickr-calendar { background: #1f2937 !important; color: #f9fafb !important; border-color: #374151 !important; }
html.dark .flatpickr-day { color: #d1d5db !important; }
html.dark .flatpickr-day:hover { background: #374151 !important; }

/* Actives states for grays */
html.dark .active\:bg-gray-50:active, html.dark .hover\:bg-gray-100:hover, html.dark .active\:bg-gray-100:active { background-color: #374151 !important; }
html.dark .active\:bg-gray-200:active, html.dark .hover\:bg-gray-200:hover { background-color: #4b5563 !important; }
html.dark .active\:bg-gray-300:active, html.dark .hover\:bg-gray-300:hover { background-color: #6b7280 !important; }