/* Custom Web GIS Styling System */

/* Reset and Core adjustments */
:root {
  --map-tile-filter: brightness(0.9) contrast(1.05) saturate(0.9) invert(0.05);
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  height: 100vh;
}

/* Hide standard Leaflet control elements we replaced (Zoom, etc.) */
.leaflet-control-zoom {
  display: none !important;
}

.leaflet-control-attribution {
  background: rgba(15, 23, 42, 0.6) !important;
  color: #94a3b8 !important;
  backdrop-filter: blur(4px);
  border-top-left-radius: 8px;
  font-size: 9px !important;
  font-family: monospace;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2px 8px !important;
}

.leaflet-control-attribution a {
  color: #38bdf8 !important;
  text-decoration: none;
}

/* Smooth Sidebar Transitions */
#sidebar {
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stunning Glassmorphic Scrollbar */
.scrollbar-thin::-webkit-scrollbar {
  width: 5px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.2);
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 9999px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* Deep Dark Leaflet Map Reset */
#map {
  background-color: #020617;
}

/* Custom premium marker cluster indicators */
.custom-cluster-park {
  background: rgba(245, 158, 11, 0.2);
  border: 2px solid rgba(245, 158, 11, 0.6);
  color: #fff;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  text-align: center;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 200ms ease;
}

.custom-cluster-park:hover {
  background: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
  transform: scale(1.08);
}

.custom-cluster-geo {
  background: rgba(236, 72, 153, 0.2);
  border: 2px solid rgba(236, 72, 153, 0.6);
  color: #fff;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  text-align: center;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 200ms ease;
}

.custom-cluster-geo:hover {
  background: rgba(236, 72, 153, 0.35);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
  transform: scale(1.08);
}

/* Leaflet Popup Styling Reset (Glassmorphic) */
.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.95) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  padding: 4px;
}

.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  font-size: 13px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
}

.leaflet-popup-close-button {
  color: #94a3b8 !important;
  font-size: 14px !important;
  padding: 8px 10px 0 0 !important;
  transition: color 150ms ease;
}

.leaflet-popup-close-button:hover {
  color: #ffffff !important;
}

/* Glowing Pulsating Marker for User Location */
.user-location-pulsar {
  position: relative;
}

.user-location-pulsar::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #3b82f6;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

.user-location-pulsar::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(59, 130, 246, 0.4);
  border-radius: 50%;
  animation: pulseLocate 1.8s infinite ease-out;
}

@keyframes pulseLocate {
  0% {
    width: 12px;
    height: 12px;
    opacity: 1;
  }
  100% {
    width: 48px;
    height: 48px;
    opacity: 0;
  }
}

/* Active switch highlights */
input:checked ~ .peer {
  background-color: var(--tw-peer-checked-bg) !important;
}

/* Dynamic details transitions */
#detailsCard {
  animation: slideInUp 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================================
   Upgraded Dynamic Features CSS (Search, Banner, Modal)
   ========================================================================= */

/* Geocoding Suggestion Autocomplete Items */
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: #cbd5e1;
  transition: all 150ms ease;
  border: 1px solid transparent;
}

.suggestion-item:hover {
  background: rgba(0, 145, 255, 0.08);
  border-color: rgba(0, 145, 255, 0.2);
  color: #ffffff;
}

/* Floating Zoom-Lock Warning Banner */
#zoomLockBanner {
  animation: slideDownBanner 300ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(245, 158, 11, 0.15);
}

@keyframes slideDownBanner {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Onboarding Setup Wizard Slide In */
#setupWizardModal > div {
  animation: slideDownModal 400ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 145, 255, 0.1);
}

@keyframes slideDownModal {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
