/* GenMonitor — vue topographique + animations */

.topo-bg {
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(16,185,129,0.10), transparent 60%),
    radial-gradient(900px 500px at 90% 90%, rgba(59,130,246,0.08), transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #0a1024 100%);
}

.topo-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.topo-line {
  fill: none;
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 1;
}
.topo-line.major { stroke: rgba(148, 163, 184, 0.32); stroke-width: 1.4; }

.topo-grid line { stroke: rgba(255,255,255,0.04); stroke-width: 1; }

.gen-node { cursor: pointer; transition: transform .25s ease; transform-origin: center; transform-box: fill-box; }
.gen-node:hover { transform: scale(1.08); }

.gen-halo { animation: pulse 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 0.15; transform: scale(1.6); }
}

.dot-on      { fill: #34d399; }
.dot-off     { fill: #64748b; }
.dot-offline { fill: #f59e0b; }
.halo-on      { fill: #10b981; }
.halo-off     { fill: #475569; }
.halo-offline { fill: #f59e0b; }

.tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 24, 48, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: #e2e8f0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity .15s ease;
  z-index: 50;
  min-width: 180px;
}
.tooltip.show { opacity: 1; }

.kpi-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
}

.gen-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  transition: border-color .2s ease, transform .2s ease;
}
.gen-card:hover { border-color: rgba(16,185,129,0.4); transform: translateY(-2px); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 999px; }
.pill-green { background: rgba(16,185,129,0.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.pill-green .dot { background: #34d399; box-shadow: 0 0 10px #34d399; }
.pill-slate { background: rgba(100,116,139,0.12); color: #cbd5e1; border: 1px solid rgba(100,116,139,0.3); }
.pill-slate .dot { background: #94a3b8; }
.pill-red   { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.35); }
.pill-red .dot { background: #f87171; box-shadow: 0 0 10px #f87171; }
.pill-amber { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.35); }
.pill-amber .dot { background: #f59e0b; }

.bar-track { height: 6px; background: rgba(148,163,184,0.18); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.bar-ok { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-soon { background: linear-gradient(90deg, #eab308, #f59e0b); }
.bar-urgent { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.bar-overdue { background: #ef4444; }

.section-title {
  font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: #94a3b8;
}

.live-dot {
  width: 8px; height: 8px; border-radius: 999px; background: #34d399;
  box-shadow: 0 0 10px #34d399; animation: pulse 1.6s ease-in-out infinite;
  display: inline-block;
}

/* Toggle topographique / carte */
.view-btn {
  color: #94a3b8;
  background: transparent;
}
.view-btn:hover {
  color: #e2e8f0;
}
.view-btn.active {
  background: rgba(16,185,129,0.15);
  color: #34d399;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}

/* Leaflet — adaptation au thème sombre */
.leaflet-container {
  background: #0a1024;
  font-family: inherit;
  border-radius: 16px;
  outline: 0;
}
.leaflet-control-zoom a {
  background: rgba(15,24,48,0.92) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148,163,184,0.25) !important;
}
.leaflet-control-zoom a:hover {
  background: rgba(16,185,129,0.2) !important;
  color: #34d399 !important;
}
.leaflet-control-attribution {
  background: rgba(15,24,48,0.85) !important;
  color: #94a3b8 !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: #94a3b8 !important; }

/* Markers personnalisés */
.gm-marker {
  background: transparent;
  border: 0;
}
.gm-marker .marker-dot {
  width: 18px; height: 18px; border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
  position: relative;
}
.gm-marker .marker-halo {
  position: absolute; inset: -8px; border-radius: 999px;
  pointer-events: none;
}
/* La couleur du dot est appliquée en inline-style depuis le JS (selon l'utilisation).
   Le halo (couleur + animation) reflète le statut courant on/off/offline. */
.gm-marker.on    .marker-dot  { box-shadow: 0 0 14px currentColor, 0 0 0 2px rgba(0,0,0,0.4); }
.gm-marker.on    .marker-halo { animation: pulse 2.4s ease-in-out infinite; }
.gm-marker.offline .marker-dot { box-shadow: 0 0 14px #f59e0b, 0 0 0 2px rgba(0,0,0,0.4); }
.gm-marker.offline .marker-halo { animation: pulse 1.6s ease-in-out infinite; }
.gm-marker.off .marker-halo { display: none; }

/* Légende : pastilles halo */
.legend-halo {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 999px;
  position: relative;
}
.legend-halo.on      { background: #10b981; box-shadow: 0 0 8px #34d399; animation: pulse 2.4s ease-in-out infinite; }
.legend-halo.offline { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; animation: pulse 1.6s ease-in-out infinite; }

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(15,24,48,0.96) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148,163,184,0.25);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.leaflet-popup-content {
  margin: 12px 14px !important;
  font-size: 12px;
  min-width: 200px;
}
.leaflet-popup-close-button {
  color: #94a3b8 !important;
}
