.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30 !important;
}

.leaflet-div-icon {
  border: none;
  background-color: transparent;
}

.leaflet-container {
  overflow: hidden;
  z-index: 30 !important;
}

.leaflet-bottom {
  z-index: 30 !important;
}

#map {
  z-index: 0 !important;
}

.leaflet-popup-pane,
.leaflet-control {
  z-index: 30 !important;
}

.leaflet-draw-section{
  position: relative;
  margin-right: 42px;
}

.leaflet-draw-toolbar a {
  background-image: linear-gradient(transparent, transparent),
                    url("/images/spritesheet.png") !important;
}


/* ============================================================================
   MARKER ANIMATIONS
   ============================================================================ */

   .custom-trajectory-marker {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.custom-trajectory-marker:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
  z-index: 1000;
}

/* Colorized hover glows per marker type */
.trajectory-marker-end:hover {
  filter: drop-shadow(0 8px 16px rgba(59, 130, 246, 0.4));
}

.trajectory-marker-start:hover {
  filter: drop-shadow(0 8px 16px rgba(31, 41, 55, 0.4));
}

.trajectory-marker-entity_scan:hover {
  filter: drop-shadow(0 8px 16px rgba(16, 185, 129, 0.4));
}

.trajectory-marker-intermediate:hover {
  filter: drop-shadow(0 8px 16px rgba(139, 92, 246, 0.4));
}


/* ============================================================================
   TRAJECTORY LINE ANIMATION
   ============================================================================ */

/* The stroke-dasharray + duration + offset should be applied inline in JS */
.trajectory-line {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

@keyframes flowingTrajectory {
  0% {
    stroke-dashoffset: var(--trajectory-total-offset);
  }
  100% {
    stroke-dashoffset: 0;
  }
}


/* ============================================================================
   POPUP BASE STYLE (Glassmorphism)
   ============================================================================ */

.enhanced-trajectory-popup .leaflet-popup-content-wrapper {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 250, 252, 0.95) 100%
  );
  border-radius: 16px;
  padding: 0;
  min-width: 250px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(10px);
}

.enhanced-trajectory-popup .leaflet-popup-tip {
  background: inherit;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.enhanced-trajectory-popup .leaflet-popup-content {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
}

.enhanced-popup-content {
  padding: 0;
  overflow: hidden;
}


/* ============================================================================
   POPUP HEADER
   ============================================================================ */

.popup-header {
  display: flex;
  align-items: center;
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.6);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(249, 250, 251, 0.8) 100%
  );
}

/* Icon styles */
.popup-icon {
  margin-right: 12px;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* Icon color themes */
.entity-scan-header .popup-icon {
  background: linear-gradient(135deg, #10b981, #059669);
}

.segment-start-header .popup-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.segment-end-header .popup-icon {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.location-header .popup-icon {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.start-point-header .popup-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.end-point-header .popup-icon {
  background: linear-gradient(135deg, #1f2937, #111827);
}

.popup-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  line-height: 1.25;
}


/* ============================================================================
   POPUP BODY
   ============================================================================ */

.popup-body {
  padding: 16px 20px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-label {
  font-weight: 500;
  color: #6b7280;
  font-size: 13px;
  white-space: nowrap;
}

.info-value {
  font-size: 13px;
  color: #374151;
  word-break: break-word;
}
