/* CommuneHub - Custom Styles & Civic Design System */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap');

:root {
  --marianne-blue: #000091;
  --marianne-blue-hover: #1212ff;
  --marianne-red: #e1000f;
  --civic-dark: #0f172a;
  --civic-bg: #f8fafc;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--civic-bg);
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}

/* Typographie officielle républicaine */
.font-serif {
  font-family: 'Merriweather', Georgia, serif;
}

/* Leaflet Map Customizations */
.leaflet-popup-content-wrapper {
  border-radius: 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  padding: 0.25rem;
  border: 1px solid #e2e8f0;
}

.leaflet-popup-content {
  margin: 0.85rem;
  line-height: 1.45;
}

.custom-pin {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.custom-pin:hover {
  transform: scale(1.25);
  z-index: 1000 !important;
}

/* Animations modales */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-modal {
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Ligne d'accentuation républicaine */
.republic-border {
  border-image: linear-gradient(to right, #000091 33.33%, #ffffff 33.33% 66.66%, #e1000f 66.66%) 1;
}

/* =========================================================================
   MODE SOMBRE (DARK THEME) GLOBAL POUR NEAUFLES-SAINT-MARTIN
   ========================================================================= */

html.dark {
  color-scheme: dark;
  --civic-bg: #0b1120;
}

html.dark body {
  background-color: #0b1120;
  color: #f1f5f9;
}

/* Header & Barres de navigation */
html.dark header {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

html.dark #main-nav-links .nav-btn:not(.bg-blue-900):hover,
html.dark .nav-btn:not(.bg-blue-900):hover {
  background-color: #1e293b !important;
  color: #f8fafc !important;
}

/* Cartes & Conteneurs Blancs */
html.dark .bg-white {
  background-color: #131d33 !important;
  color: #f1f5f9;
}

html.dark .bg-slate-50 {
  background-color: #0c1322 !important;
}

html.dark .bg-slate-50\/70,
html.dark .bg-slate-50\/80 {
  background-color: rgba(15, 23, 42, 0.75) !important;
}

html.dark .bg-slate-100 {
  background-color: #1a253e !important;
}

/* Bordures douces et séparateurs */
html.dark .border-slate-100,
html.dark .border-slate-150,
html.dark .border-slate-200,
html.dark .border-slate-300 {
  border-color: #23324d !important;
}

html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #1e293b !important;
}

/* Typographie & Couleurs de textes */
html.dark .text-slate-900,
html.dark .text-slate-800 {
  color: #f8fafc !important;
}

html.dark .text-slate-700,
html.dark .text-slate-600 {
  color: #cbd5e1 !important;
}

html.dark .text-slate-500,
html.dark .text-slate-400 {
  color: #94a3b8 !important;
}

/* Formulaires, Champs de saisie & Menus Déroulants */
html.dark input[type="text"],
html.dark input[type="email"],
html.dark input[type="tel"],
html.dark input[type="password"],
html.dark input[type="search"],
html.dark textarea,
html.dark select {
  background-color: #17223b !important;
  border-color: #2d3c5a !important;
  color: #ffffff !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark option {
  background-color: #131d33 !important;
  color: #f8fafc !important;
}

/* Tableaux du Back-Office */
html.dark thead {
  background-color: #0c1322 !important;
  color: #94a3b8 !important;
  border-color: #1e293b !important;
}

html.dark tbody tr {
  border-color: #1e2a42 !important;
}

html.dark tbody tr:hover,
html.dark tr.hover\:bg-slate-50\/80:hover {
  background-color: #172440 !important;
}

/* Modales & Arrière-plans d'ombrage */
html.dark .fixed.inset-0.bg-slate-900\/60,
html.dark .fixed.inset-0.bg-slate-900\/70,
html.dark .fixed.inset-0.bg-black\/60 {
  background-color: rgba(3, 7, 18, 0.85) !important;
}

/* Carte Leaflet en mode sombre */
html.dark .leaflet-tile {
  filter: brightness(0.8) invert(1) contrast(1.15) hue-rotate(200deg) saturate(0.35);
}

html.dark .leaflet-popup-content-wrapper {
  background-color: #131d33 !important;
  color: #f8fafc !important;
  border-color: #23324d !important;
}

html.dark .leaflet-popup-tip {
  background-color: #131d33 !important;
}

/* Barre de défilement sombre */
html.dark ::-webkit-scrollbar-track {
  background: #0b1120;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

html.dark ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Badges & Encadrés thématiques en mode sombre */
html.dark .bg-blue-50 {
  background-color: rgba(30, 58, 138, 0.3) !important;
  color: #93c5fd !important;
}
html.dark .bg-amber-50 {
  background-color: rgba(180, 83, 9, 0.25) !important;
  color: #fde68a !important;
}
html.dark .bg-emerald-50 {
  background-color: rgba(6, 95, 70, 0.25) !important;
  color: #a7f3d0 !important;
}
html.dark .bg-purple-50 {
  background-color: rgba(107, 33, 168, 0.25) !important;
  color: #e9d5ff !important;
}
html.dark .bg-rose-50,
html.dark .bg-red-50 {
  background-color: rgba(159, 18, 57, 0.25) !important;
  color: #fecdd3 !important;
}
html.dark .bg-orange-50 {
  background-color: rgba(194, 65, 12, 0.25) !important;
  color: #fed7aa !important;
}

