/* Custom styles for Dispersed Camp Finder */

:root {
  --map-tile-filter: brightness(0.9) contrast(1.1);
}

body {
  background-color: #0b110e; /* Custom deep dark green background */
}

/* Custom scrollbars for a premium feel */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(21, 32, 27, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(86, 127, 105, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 153, 30, 0.6);
}

/* Glassmorphism panel styling */
.backdrop-blur-sm {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Slow spin animation for compass logo */
.animate-spin-slow {
  animation: spin 8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Leaflet map customization */
#map {
  background: #0b110e;
  font-family: inherit;
}

/* Custom Dark Leaflet Controls */
.leaflet-bar {
  border: 1px solid rgba(86, 127, 105, 0.3) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.leaflet-bar a {
  background-color: rgba(21, 32, 27, 0.9) !important;
  color: #cbdad0 !important;
  border-bottom: 1px solid rgba(86, 127, 105, 0.2) !important;
  transition: all 0.2s ease;
}

.leaflet-bar a:hover {
  background-color: rgba(249, 153, 30, 0.2) !important;
  color: #f9991e !important;
}

/* Custom Marker Styling classes */
.custom-div-icon {
  background: none;
  border: none;
}

.marker-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  position: absolute;
  transform: rotate(-45deg);
  transform-origin: center;
  left: 50%;
  top: 0;
  margin: 2px 0 0 -16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid #0b110e;
}

.marker-pin i {
  transform: rotate(45deg);
  font-size: 13px;
  color: #0b110e;
}

.marker-pin::after {
  content: '';
  width: 14px;
  height: 14px;
  margin: 8px 0 0 8px;
  background: transparent;
  position: absolute;
  border-radius: 50%;
}

.marker-pin:hover {
  transform: rotate(-45deg) scale(1.15);
}

/* Destination Pin Marker */
.destination-pin {
  background: #f9991e;
}

/* Camping Pin Marker */
.camping-pin-osm {
  background: #567f69;
}

.camping-pin-usfs {
  background: #3b82f6;
}

/* Selected marker glow */
.marker-selected {
  box-shadow: 0 0 0 4px rgba(249, 153, 30, 0.4), 0 4px 12px rgba(0,0,0,0.5);
  border-color: #f9991e;
}

/* Custom Popup styling */
.leaflet-popup-content-wrapper {
  background-color: rgba(21, 32, 27, 0.95) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(86, 127, 105, 0.3) !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(6px);
  padding: 4px;
}

.leaflet-popup-tip {
  background-color: rgba(21, 32, 27, 0.95) !important;
  border: 1px solid rgba(86, 127, 105, 0.3) !important;
}

.leaflet-popup-content {
  margin: 12px !important;
  font-family: 'Inter', sans-serif !important;
  width: 240px !important;
}

/* Active row highlight in coordinate table */
.active-row {
  background-color: rgba(249, 153, 30, 0.08) !important;
  border-left: 3px solid #f9991e;
}

/* Hover highlights for coordinate table rows */
tbody tr {
  transition: all 0.15s ease;
}

tbody tr:hover {
  background-color: rgba(86, 127, 105, 0.06);
}

/* Custom Autofill styles to prevent browser from forcing unreadable colors */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
  -webkit-text-fill-color: #f1f5f9 !important;
  -webkit-box-shadow: 0 0 0px 1000px #15201b inset !important; /* matches primary-950 */
  transition: background-color 5000s ease-in-out 0s;
}

/* Custom styling for select option tags to guarantee high contrast on dark themes */
select option {
  background-color: #15201b !important; /* Deep forest green to match background */
  color: #f8fafc !important; /* Extremely high contrast near-white text */
}

select option:disabled {
  color: #a2beae !important; /* High contrast muted teal-gray for placeholder/disabled options */
  opacity: 0.8;
}
