/* Carte Pollen France - Styles Modernes */
:root {
  --color-risk-0: #10b981; /* Nul / Très bon */
  --color-risk-1: #84cc16; /* Très faible */
  --color-risk-2: #eab308; /* Faible */
  --color-risk-3: #f97316; /* Modéré / Moyen */
  --color-risk-4: #ef4444; /* Élevé */
  --color-risk-5: #b91c1c; /* Très élevé */
  --color-risk-6: #7e22ce; /* Extrêmement élevé */

  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --border-card: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-emerald: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #0b1120;
  color: #f1f5f9;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Glassmorphism panels */
.glass-panel {
  background: rgba(30, 41, 59, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

.glass-panel-elevated {
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  border-radius: 1.25rem;
}

/* Risk badges & color tokens */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-0 { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.risk-1 { background: rgba(132, 204, 22, 0.2); color: #a3e635; border: 1px solid rgba(132, 204, 22, 0.4); }
.risk-2 { background: rgba(234, 179, 8, 0.2); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.4); }
.risk-3 { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.4); }
.risk-4 { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.risk-5 { background: rgba(185, 28, 28, 0.3); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.6); }
.risk-6 { background: rgba(126, 34, 206, 0.3); color: #d8b4fe; border: 1px solid rgba(126, 34, 206, 0.6); }

/* Pulse animation on high risk */
@keyframes alert-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

.pulse-high-risk {
  animation: alert-pulse 2s infinite ease-in-out;
}

/* Map Containers */
#leaflet-map {
  width: 100%;
  height: 620px;
  border-radius: 0.85rem;
  background: #090d16;
  z-index: 10;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}

/* Basemap selector pills */
.basemap-pill {
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}
.basemap-pill.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.3);
}

/* Outre-Mer Pills */
.dom-pill {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.dom-pill:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}
.dom-pill.selected {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* Hex & Cartogram Map */
.cartogram-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 1rem;
}

.cartogram-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.cartogram-cell:hover {
  transform: translateY(-3px) scale(1.08);
  z-index: 20;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.cartogram-cell.selected {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
  transform: translateY(-2px) scale(1.06);
  z-index: 25;
}

.cartogram-cell .dept-code {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.cartogram-cell .dept-sub {
  font-size: 0.6rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  text-align: center;
  margin-top: 0.15rem;
}

.cartogram-empty {
  visibility: hidden;
}

/* Leaflet Custom styling */
.leaflet-container {
  font-family: inherit;
}
.leaflet-bar a {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
.leaflet-bar a:hover {
  background-color: #334155 !important;
}
.custom-leaflet-tooltip {
  background: #1e293b !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 0.5rem !important;
  padding: 0.5rem 0.75rem !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}
.custom-leaflet-tooltip::before {
  border-top-color: #1e293b !important;
}

/* Pollen bar meter */
.pollen-meter-bg {
  background: rgba(255, 255, 255, 0.08);
  height: 0.6rem;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.pollen-meter-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Seasonality Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: 140px repeat(12, 1fr);
  gap: 2px;
  align-items: center;
}

.cal-month-head {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0;
  color: #94a3b8;
  border-bottom: 1px solid #334155;
}

.cal-month-head.current-month {
  color: #38bdf8;
  border-bottom: 2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 4px 4px 0 0;
}

.cal-cell {
  height: 22px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}

.cal-cell.cal-active-1 { background: rgba(132, 204, 22, 0.4); }
.cal-cell.cal-active-2 { background: rgba(234, 179, 8, 0.6); }
.cal-cell.cal-active-3 { background: rgba(239, 68, 68, 0.8); }

/* Print mode for official bulletin */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  .glass-panel, .glass-panel-elevated {
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    color: #000000 !important;
    box-shadow: none !important;
  }
  .print-only {
    display: block !important;
  }
}
