/* ==========================================================================
   map.css — Carte interactive NaluScore
   Dark mode strict · Leaflet overrides · Marqueurs & clusters personnalisés
   ========================================================================== */

/* ─── Reset & base ─────────────────────────────────────────────────────────── */

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #0a0f1a;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  color: #fff;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */

.map-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  background: rgba(8, 12, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

.map-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
  min-width: 90px;
}
.map-back-btn svg { width: 16px; height: 16px; }
.map-back-btn:hover { color: #00f5ff; }

.map-header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.map-header-logo svg { width: 32px; height: 32px; }

.map-logo-text {
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(135deg, #00f5ff, #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.map-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.map-suggest-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.map-suggest-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.map-suggest-btn:hover {
  color: #00f5ff;
  border-color: rgba(0, 245, 255, 0.4);
  background: rgba(0, 245, 255, 0.07);
}

.map-analyze-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: #0a0f1a;
  background: linear-gradient(135deg, #00f5ff, #00ff88);
  padding: 7px 14px;
  border-radius: 8px;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}
.map-analyze-btn svg { width: 13px; height: 13px; }
.map-analyze-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ─── Map container ──────────────────────────────────────────────────────────── */

#map {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* ─── Hint overlay ───────────────────────────────────────────────────────────── */

.map-hint {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: rgba(8, 12, 24, 0.88);
  border: 1px solid rgba(0, 245, 255, 0.18);
  border-radius: 24px;
  font-size: 12px;
  color: #9ca3af;
  backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.map-hint svg { width: 14px; height: 14px; flex-shrink: 0; color: #00f5ff; }

/* ─── Custom marker ──────────────────────────────────────────────────────────── */

.nalu-marker { background: none; border: none; }

.nalu-marker-pin {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  filter: drop-shadow(0 0 6px rgba(0, 245, 255, 0.5));
}
.nalu-marker-pin:hover { transform: scale(1.15); }
.nalu-marker-pin svg { width: 36px; height: 36px; }

/* ─── Custom cluster ──────────────────────────────────────────────────────────── */

.nalu-cluster { background: none; border: none; }

.nalu-cluster-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 245, 255, 0.12);
  border: 2px solid rgba(0, 245, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.3), inset 0 0 8px rgba(0, 245, 255, 0.08);
  transition: transform 0.15s ease;
}
.nalu-cluster:hover .nalu-cluster-inner { transform: scale(1.1); }

.nalu-cluster-inner span {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #00f5ff;
}

/* ─── Leaflet popup overrides ────────────────────────────────────────────────── */

/* Wrapper de la popup */
.nalu-leaflet-popup .leaflet-popup-content-wrapper {
  background: rgba(10, 15, 28, 0.96);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(0, 245, 255, 0.1);
  padding: 0;
  backdrop-filter: blur(12px);
}

/* Flèche de la popup */
.nalu-leaflet-popup .leaflet-popup-tip {
  background: rgba(10, 15, 28, 0.96);
}
.nalu-leaflet-popup .leaflet-popup-tip-container { margin-top: -1px; }

/* Bouton fermeture × */
.nalu-leaflet-popup .leaflet-popup-close-button {
  color: #6b7280 !important;
  font-size: 18px !important;
  top: 8px !important;
  right: 10px !important;
  transition: color 0.15s;
}
.nalu-leaflet-popup .leaflet-popup-close-button:hover { color: #00f5ff !important; }

/* Contenu (padding géré ici) */
.nalu-leaflet-popup .leaflet-popup-content { margin: 0; }

/* ─── Popup content ───────────────────────────────────────────────────────────── */

.nalu-popup {
  padding: 16px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 180px;
}

.nalu-popup-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  padding-right: 20px; /* espace pour le × */
}

.nalu-popup-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0a0f1a;
  background: linear-gradient(135deg, #00f5ff, #00ff88);
  transition: opacity 0.2s, transform 0.15s;
}
.nalu-popup-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ─── Leaflet UI overrides (dark mode) ──────────────────────────────────────── */

/* Zoom controls */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5) !important;
  border-radius: 10px !important;
  overflow: hidden;
}
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  background: rgba(10, 15, 28, 0.92) !important;
  color: #9ca3af !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  font-size: 16px !important;
  line-height: 30px !important;
  transition: color 0.15s, background 0.15s !important;
}
.leaflet-control-zoom-out { border-bottom: none !important; }
.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
  background: rgba(0, 245, 255, 0.1) !important;
  color: #00f5ff !important;
}

/* Attribution */
.leaflet-control-attribution {
  background: rgba(8, 12, 24, 0.8) !important;
  color: #4b5563 !important;
  font-size: 10px !important;
  border-top-left-radius: 6px !important;
}
.leaflet-control-attribution a { color: #6b7280 !important; }
.leaflet-control-attribution a:hover { color: #9ca3af !important; }

/* ─── Mobile ─────────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .map-header-logo { display: none; }
  .map-analyze-btn { font-size: 11px; padding: 6px 10px; }
  .map-suggest-btn { font-size: 0; padding: 6px 8px; } /* icône seule */
  .map-suggest-btn svg { width: 15px; height: 15px; }
  .map-back-btn span { display: none; }
  .map-hint { font-size: 11px; bottom: 16px; }
}
