@import "tailwindcss";
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,100..900;1,100..900&display=swap');
html, body {
  height: 100%;
  font-size: 14px;
  -webkit-text-size-adjust: 100%;  /* Prevent font resizing */
  -ms-text-size-adjust: 100%;  /* Prevent font resizing */
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
}

.root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.map-label {
  background: rgba(255, 255, 255, 1);
  padding: 3px 10px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 30px;
  border-radius: 4px;
}

/* Leaflet device tooltips */
.leaflet-tooltip.map-tooltip {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.leaflet-tooltip.map-tooltip::before {
  display: none;
}

.map-tooltip-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  padding: 6px 10px 6px 9px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.12),
    0 2px 6px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
}

.map-tooltip-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.98);
}

.map-tooltip-name {
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  color: #0f172a;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-tooltip-badge {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

.map-tooltip-lock {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}

.map-tooltip-card--moving .map-tooltip-badge {
  background: #ecfdf5;
  color: #047857;
}

.map-tooltip-card--stopped .map-tooltip-badge {
  background: #fef2f2;
  color: #dc2626;
}

.map-tooltip-card--arrival .map-tooltip-badge {
  background: #fef3c7;
  color: #b45309;
}

/* Legacy replay tooltip wrapper — même rendu que device */
.leaflet-tooltip.replay-map-tooltip-wrap {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  pointer-events: none;
}

.leaflet-tooltip.replay-map-tooltip-wrap::before {
  display: none;
}

.replay-map-marker.leaflet-div-icon {
  background: transparent;
  border: none;
}

/* Replay — slider de position (design par défaut : piste noire / grise) */
.replay-position-slider {
  --replay-track-active: #0a0a0a;
  --replay-track-inactive: #d4d4d4;
  --replay-thumb-bg: #ffffff;
  --replay-thumb-border: #0a0a0a;
  padding: 2px 0;
}

.dark .replay-position-slider {
  --replay-track-active: #fafafa;
  --replay-track-inactive: #525252;
  --replay-thumb-bg: #171717;
  --replay-thumb-border: #fafafa;
}

.replay-position-slider--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.replay-position-slider__control {
  position: relative;
  height: 20px;
}

.replay-position-slider__rail {
  position: relative;
  height: 100%;
  padding: 0 8px;
  pointer-events: none;
}

.replay-position-slider__track-inactive {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1px;
  background: var(--replay-track-inactive);
  transform: translateY(-50%);
}

.replay-position-slider__track-active {
  position: absolute;
  left: 8px;
  top: 50%;
  height: 3px;
  background: var(--replay-track-active);
  border-radius: 1px;
  transform: translateY(-50%);
}

.replay-position-slider__thumb {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--replay-thumb-bg);
  border: 1px solid var(--replay-thumb-border);
  transform: translate(-50%, -50%);
  box-shadow: none;
}

.replay-position-slider__input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.replay-position-slider__input:disabled {
  cursor: not-allowed;
}

.replay-position-slider:focus-within .replay-position-slider__thumb {
  box-shadow: 0 0 0 2px rgba(10, 10, 10, 0.15);
}

.replay-position-slider__input::-webkit-slider-runnable-track {
  height: 20px;
  background: transparent;
}

.replay-position-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
}

.replay-position-slider__input::-moz-range-track {
  height: 20px;
  background: transparent;
  border: none;
}

.replay-position-slider__input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Leaflet marker clusters — Google Maps classic style */
.custom-cluster-icon.leaflet-div-icon {
  background: transparent !important;
  border: none !important;
}

.custom-cluster-icon svg {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  transition: transform 0.15s ease;
}

.custom-cluster-icon:hover svg {
  transform: scale(1.06);
}

/* Google Maps marker labels */
.map-marker-label {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 10px !important;
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.12),
    0 2px 6px rgba(15, 23, 42, 0.06) !important;
  padding: 5px 10px !important;
  color: #0f172a !important;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  letter-spacing: -0.01em;
}

.gm-style .gm-style-iw-c{
  padding: 10px !important;
}

.gm-style-iw button, .gm-style-iw button > span{
  width: 18px !important;
  height: 18px !important;
}

.gm-style-iw button > span{
  margin: 0px !important;
}

/* Masquer la toolbar Leaflet.Draw par défaut (boutons custom dans LeafletMapControls) */
.leaflet-draw.leaflet-control {
  display: none !important;
}

/* Masquer les tooltips d'instruction Leaflet.Draw (edit/draw/delete) */
.leaflet-draw-tooltip {
  display: none !important;
}

/* Marqueurs de périmètres virtuels — au-dessus des POI KML */
.leaflet-marker-icon.geofence-marker-icon {
  z-index: 1200 !important;
  background: transparent !important;
  border: none !important;
}

.leaflet-marker-icon.geofence-marker-icon svg {
  display: block;
  overflow: visible;
}

/* Leaflet geofence tooltips — distinct from white device tooltips */
.leaflet-tooltip.geofence-marker-tooltip {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  pointer-events: none;
  z-index: 1300 !important;
}

.leaflet-tooltip.geofence-marker-tooltip::before {
  display: none;
}

.geofence-tooltip-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  padding: 5px 11px 5px 9px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid var(--geofence-color, #3bb2d0);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
}

.geofence-tooltip-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(15, 23, 42, 0.92);
}

.geofence-tooltip-name {
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  color: #f8fafc;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}