/* ============================================================
   11-libreville.css — Onglet Libreville : carte + stats + top 10
   ============================================================ */

/* ========== HERO LIBREVILLE ========== */

.hero-libreville {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.hero-libreville__bg {
  position: absolute;
  inset: 0;
  background-image: url('../assets/bg_libreville.jpg');
  background-size: cover;
  background-position: center;
  filter: brightness(0.4) saturate(1.2);
  z-index: 0;
}

.hero-libreville__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10, 14, 26, 0.3) 0%,
    rgba(10, 14, 26, 0.85) 70%,
    rgba(10, 14, 26, 0.95) 100%);
  z-index: 1;
}

.hero-libreville__content {
  position: relative;
  z-index: 2;
  padding: var(--space-xl) var(--space-lg);
}

.hero-libreville__label {
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-2xs);
}

.hero-libreville__titre {
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-black);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.hero-libreville__sous-titre {
  font-family: var(--font-serif);
  font-size: var(--font-size-md);
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.hero-libreville__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.hero-stat {
  background: rgba(21, 27, 46, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
}

.hero-stat__valeur {
  font-family: var(--font-data);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-black);
  color: var(--accent-premium);
  line-height: 1;
  font-feature-settings: "tnum";
}

.hero-stat__valeur--danger { color: var(--accent-danger); }
.hero-stat__valeur--warning { color: var(--accent-warning); }
.hero-stat__valeur--go { color: var(--accent-go); }

.hero-stat__label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-top: 6px;
  line-height: 1.2;
}

/* ========== CARTE LEAFLET ========== */

.carte-section {
  margin-bottom: var(--space-lg);
}

.carte-wrapper {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.carte-libreville {
  width: 100%;
  height: 400px;
  background: var(--bg-base);
}

.carte-overlay-controls {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-xs);
  z-index: 1000;
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.carte-legende {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
  padding: var(--space-xs);
  font-family: var(--font-data);
  font-size: var(--font-size-xs);
}

.carte-legende__item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  font-weight: var(--font-weight-semibold);
}

.carte-legende__pastille {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.carte-legende__pastille--vert { background: #10F59F; }
.carte-legende__pastille--jaune { background: #FFB020; }
.carte-legende__pastille--orange { background: #FF8B20; }
.carte-legende__pastille--rouge { background: #FF5E5E; }

/* Personnalisation popup Leaflet */
.leaflet-popup-content-wrapper {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-display) !important;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-default) !important;
}

.leaflet-popup-close-button {
  color: var(--text-tertiary) !important;
}

.popup-quartier {
  padding: 4px;
  min-width: 180px;
}

.popup-quartier__nom {
  font-family: var(--font-display);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.popup-quartier__commune {
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}

.popup-quartier__heures {
  font-family: var(--font-data);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--accent-warning);
  font-feature-settings: "tnum";
}

.popup-quartier__creneaux {
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ========== STATS PAR COMMUNE (4 cards) ========== */

.stats-communes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.commune-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-quick);
}

.commune-card:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.commune-card[data-niveau="critique"] {
  border-color: var(--accent-danger);
  background: linear-gradient(135deg,
    rgba(255, 94, 94, 0.08) 0%,
    var(--bg-surface) 60%);
}

.commune-card[data-niveau="warning"] {
  border-color: rgba(255, 176, 32, 0.4);
  background: linear-gradient(135deg,
    rgba(255, 176, 32, 0.06) 0%,
    var(--bg-surface) 60%);
}

.commune-card[data-niveau="ok"] {
  border-color: rgba(16, 245, 159, 0.3);
}

.commune-card__nom {
  font-family: var(--font-display);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: 6px;
}

.commune-card__nom-icon {
  font-size: 14px;
}

.commune-card__quartiers {
  font-family: var(--font-data);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-black);
  line-height: 1;
  font-feature-settings: "tnum";
}

.commune-card[data-niveau="critique"] .commune-card__quartiers { color: var(--accent-danger); }
.commune-card[data-niveau="warning"] .commune-card__quartiers { color: var(--accent-warning); }
.commune-card[data-niveau="ok"] .commune-card__quartiers { color: var(--accent-go); }

.commune-card__quartiers-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-top: 4px;
  margin-bottom: var(--space-sm);
}

.commune-card__details {
  font-family: var(--font-data);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  padding-top: var(--space-xs);
  border-top: 1px solid var(--border-subtle);
}

.commune-card__details-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

/* ========== TOP 10 QUARTIERS ========== */

.top10-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.top10-titre {
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-premium);
  margin-bottom: var(--space-md);
}

.top10-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.top10-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) var(--space-2xs);
  border-radius: var(--radius-md);
  transition: background var(--duration-quick);
  cursor: pointer;
}

.top10-item:hover {
  background: var(--bg-glass);
}

.top10-item__rang {
  font-family: var(--font-data);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  text-align: center;
  font-feature-settings: "tnum";
  color: var(--text-secondary);
}

/* Le rang reste neutre (pas de podium-rouge trompeur).
   La couleur des HEURES en revanche reflete la severite
   selon la meme echelle que la carte */


.top10-item__info {
  min-width: 0;
}

.top10-item__nom {
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top10-item__commune {
  font-family: var(--font-display);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.top10-item__heures {
  font-family: var(--font-data);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  font-feature-settings: "tnum";
  text-align: right;
}

/* Couleur des heures selon la severite (meme echelle que la carte) */
.top10-item[data-niveau="vert"]   .top10-item__heures { color: #10F59F; }
.top10-item[data-niveau="jaune"]  .top10-item__heures { color: #FFB020; }
.top10-item[data-niveau="orange"] .top10-item__heures { color: #FF8B20; }
.top10-item[data-niveau="rouge"]  .top10-item__heures { color: #FF5E5E; }

/* ========== INSIGHT 30 JOURS ========== */

.insight-30j {
  background: linear-gradient(135deg,
    rgba(124, 92, 255, 0.10) 0%,
    var(--bg-surface) 70%);
  border: 1px solid var(--accent-premium-glow);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.insight-30j::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle,
    var(--accent-premium-glow) 0%,
    transparent 70%);
  pointer-events: none;
}

.insight-30j__label {
  font-family: var(--font-display);
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-premium);
  margin-bottom: var(--space-xs);
}

.insight-30j__titre {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.insight-30j__desc {
  font-family: var(--font-serif);
  font-size: var(--font-size-sm);
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== ETAT NON PUBLIE OU CHARGEMENT ========== */

.libreville-vide {
  text-align: center;
  padding: var(--space-3xl) var(--space-md);
  background: var(--bg-glass);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-xl);
}

.libreville-vide__icon {
  font-size: 56px;
  margin-bottom: var(--space-sm);
  opacity: 0.5;
}

.libreville-vide__titre {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.libreville-vide__desc {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}
