/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles defined in this file take precedence over those in the files listed below.
 * From stylesheets/
 */

/* Terravox Interactive Map Styles - Inline for Rails 8 compatibility */
/* Clean, modern design with Terravox branding */

:root {
  --terravox-red: #FF2000;
  --terravox-yellow: #FFB700;
  --terravox-blue: #2185FB;
  --terravox-gray: #BDCCD4;
  --terravox-light-yellow: #FFEEC2;
  --terravox-light-blue: #E2EFFF;
  --terravox-light-red: #FDE9E9;
  --terravox-light-gray: #F1F1F1;
}

/* =====================
   MAP CONTAINER & TILES
   ===================== */

.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;
}

/* Custom tile layer styling for cleaner look */
.leaflet-tile-pane {
  filter: contrast(1.1) brightness(1.05) saturate(0.9) !important;
}

/* =====================
   ENHANCED MAP 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;
}

/* Enhanced hover effects */
.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-specific styling */
.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;
}

.terravox-popup-content {
  padding: 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-width: 320px;
  max-width: 400px;
}

.terravox-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.terravox-popup-type {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.terravox-popup-emoji {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(33, 133, 251, 0.1);
}

.terravox-popup-type-info {
  flex: 1;
}

.terravox-popup-type strong {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  display: block;
  margin-bottom: 4px;
}

.terravox-popup-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =====================
   CUSTOM MAP CONTROLS
   ===================== */

/* Zoom controls with Terravox styling */
.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;
}

/* Attribution with Terravox branding */
.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;
}