/* styles.css - Custom styling for Family GPS Tracker */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --bg-dark: #0f172a;
  --card-dark: #1e293b;
  --border-dark: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Leaflet Map overrides */
.leaflet-container {
  background-color: #0b1120 !important;
  outline: none;
}

.leaflet-bar a {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
.leaflet-bar a:hover {
  background-color: #334155 !important;
}

/* Custom Marker Styling */
.custom-member-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-pin {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  background: #1e293b;
  position: relative;
  z-index: 10;
  transition: transform 0.2s ease;
}

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

/* Pulse radar ring */
.marker-pulse {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  opacity: 0.6;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  z-index: 1;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.4);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.2);
    opacity: 0.15;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Member Marker Label */
.marker-tag {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  pointer-events: none;
  z-index: 12;
}

/* Stop Marker */
.stop-pin {
  background: #ef4444;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Moving Playback Marker */
.playback-vehicle-marker {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border: 3px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 4px 10px rgba(0,0,0,0.5);
  transition: all 0.1s linear;
}

/* Range input styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #334155;
  border-radius: 4px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Leaflet Popup overrides */
.leaflet-popup-content-wrapper {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-radius: 12px !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}
.leaflet-popup-tip {
  background: #1e293b !important;
}

/* Blinking SOS Alert Animation */
@keyframes sos-flash {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.03); }
}
.animate-sos-pulse {
  animation: sos-flash 1s infinite ease-in-out;
}
