/* =====================
   TERRAVOX MAP STYLES - Override Leaflet defaults
   ===================== */

/* Map container styling */
.terravox-map-container {
  position: relative;
  overflow: hidden;
}

.terravox-map-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--terravox-red), var(--terravox-yellow), var(--terravox-blue));
  z-index: 1000;
}

/* Enhanced tile styling */
.leaflet-tile-pane {
  filter: contrast(1.1) brightness(1.05) saturate(0.9) !important;
}

/* Enhanced markers */
.terravox-marker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.terravox-marker-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.terravox-marker-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.terravox-marker-emoji {
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  z-index: 1;
}

.terravox-marker-icon:hover {
  transform: scale(1.15);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.2),
    0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Status colors for markers */
.terravox-marker[data-status="termine"] .terravox-marker-icon {
  background: linear-gradient(135deg, #10B981, #059669) !important;
}

.terravox-marker[data-status="en_cours"] .terravox-marker-icon {
  background: linear-gradient(135deg, var(--terravox-yellow), #F59E0B) !important;
}

.terravox-marker[data-status="planifie"] .terravox-marker-icon {
  background: linear-gradient(135deg, var(--terravox-blue), #1E40AF) !important;
}

.terravox-marker[data-status="annule"] .terravox-marker-icon {
  background: linear-gradient(135deg, var(--terravox-red), #DC2626) !important;
}

.terravox-marker[data-status="brouillon"] .terravox-marker-icon {
  background: linear-gradient(135deg, var(--terravox-gray), #9CA3AF) !important;
}

/* Pulsing animation for "en cours" status */
.terravox-marker-pulse .terravox-marker-pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 3px solid var(--terravox-yellow);
  border-radius: 50%;
  animation: terravox-pulse 2s infinite ease-in-out;
  opacity: 0.7;
}

@keyframes terravox-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0.3;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0.8;
  }
}

/* Enhanced popups */
.leaflet-popup-content-wrapper {
  border-radius: 16px !important;
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px);
}

.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: none !important;
}

.leaflet-popup-close-button {
  color: #9CA3AF !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  width: 24px !important;
  height: 24px !important;
  line-height: 20px !important;
  text-align: center !important;
  border-radius: 50% !important;
  transition: all 0.2s ease !important;
}

.leaflet-popup-close-button:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #374151 !important;
}

/* Enhanced zoom controls */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.leaflet-control-zoom a {
  background: white !important;
  color: var(--terravox-blue) !important;
  border: none !important;
  font-weight: 700 !important;
  font-size: 18px !important;
  width: 40px !important;
  height: 40px !important;
  line-height: 38px !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.leaflet-control-zoom a:hover {
  background: var(--terravox-light-blue) !important;
  color: #1E40AF !important;
  transform: scale(1.05);
}

.leaflet-control-zoom-in {
  border-radius: 12px 12px 0 0 !important;
  border-bottom: 1px solid #E5E7EB !important;
}

.leaflet-control-zoom-out {
  border-radius: 0 0 12px 12px !important;
}

/* Enhanced attribution */
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px) !important;
  border-radius: 12px !important;
  font-size: 11px !important;
  padding: 6px 12px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.leaflet-control-attribution a {
  color: var(--terravox-blue) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}
