/* Air Quality Popup and Pin Styles (moved from air-quality-pin.js) */
.custom-pin {
  background: none;
  border: none;
}
.pin-content {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-family-accent);
  box-shadow: var(--shadow);
  transition: all var(--transition-speed) ease;
  color: var(--text-light);
  border: 2px solid rgba(255, 255, 255, 0.8);
}
.pin-content:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}
.pin-content:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-active);
}
.aqi-value {
  font-size: 1.2em;
  line-height: 1;
  font-weight: 800;
}
.pin-content .aqi-label {
  font-size: 0.65em;
  font-weight: 700;
  margin-top: 1px;
  text-transform: uppercase;
}
/* AQI color coding based on EPA standards */
.pin-content[data-aqi="0-50"] {
  background-color: #009966; /* Good - Green */
}
.pin-content[data-aqi="51-100"] {
  background-color: #ffde33; /* Moderate - Yellow */
  color: #333;
}
.pin-content[data-aqi="101-150"] {
  background-color: #ff9933; /* Unhealthy for Sensitive Groups - Orange */
}
.pin-content[data-aqi="151-200"] {
  background-color: #cc0033; /* Unhealthy - Red */
}
.pin-content[data-aqi="201-300"] {
  background-color: #660099; /* Very Unhealthy - Purple */
}
.pin-content[data-aqi="301+"] {
  background-color: #7e0023; /* Hazardous - Maroon */
}
/* Air Quality Popup Styling */
.air-quality-popup {
  font-family: var(--font-family-primary);
  color: var(--text-light);
  background-color: var(--dark-panel);
  border-radius: var(--border-radius);
  padding: 10px;
  max-width: 260px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--primary-color);
  transition: all var(--transition-speed) ease;
  line-height: 1.2;
  font-size: 0.85rem;
}
.air-quality-popup h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
}
.aqi-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: var(--border-radius);
  color: var(--text-light);
  background-color: var(--dark-overlay);
}
/* AQI display color coding - solid backgrounds matching the pin */
.aqi-display[data-aqi="0-50"] {
  background-color: #009966; /* Good - Green */
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.aqi-display[data-aqi="51-100"] {
  background-color: #ffde33; /* Moderate - Yellow */
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #333;
}
.aqi-display[data-aqi="101-150"] {
  background-color: #ff9933; /* Unhealthy for Sensitive Groups - Orange */
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.aqi-display[data-aqi="151-200"] {
  background-color: #cc0033; /* Unhealthy - Red */
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.aqi-display[data-aqi="201-300"] {
  background-color: #660099; /* Very Unhealthy - Purple */
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.aqi-display[data-aqi="301+"] {
  background-color: #7e0023; /* Hazardous - Maroon */
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.aqi-display .aqi-value {
  font-size: 1.5em;
  font-weight: 700;
}
.aqi-display .aqi-label {
  font-size: 0.9em;
  font-weight: 500;
}
.aqi-details {
  margin-bottom: 10px;
  background-color: var(--dark-overlay);
  padding: 8px;
  border-radius: var(--border-radius);
}
.aqi-details p {
  margin: 5px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.measurement-time {
  font-size: 0.7em;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  margin-left: 6px;
  white-space: nowrap;
}
.aqi-details strong {
  color: var(--primary-color);
}
.aqi-update-time {
  font-size: 0.75em;
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 5px;
}
/* Leaflet tooltip container override */
.air-quality-popup-container,
.leaflet-tooltip.air-quality-popup-container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.air-quality-popup-container .leaflet-tooltip-content,
.leaflet-tooltip.air-quality-popup-container .leaflet-tooltip-content {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

/* Override default Leaflet tooltip styles for our custom tooltips */
.leaflet-tooltip.air-quality-popup-container::before {
  display: none !important;
}

/* Remove conflicting animations that cause tooltip positioning issues */
.air-quality-popup {
  /* Animation removed to prevent conflict with Leaflet positioning */
  opacity: 1 !important;
}

/* Hover effects matching marine temperature tooltip */
.air-quality-popup:hover {
  transform: translateY(-2px);
}

body.light-theme .air-quality-popup:hover {
  box-shadow: 0 6px 32px 0 rgba(0,0,0,0.2) !important;
}

body:not(.light-theme) .air-quality-popup:hover {
  box-shadow: 0 6px 32px 0 rgba(0,0,0,0.4) !important;
}

/* Light theme adjustments */
body.light-theme .air-quality-popup {
  color: var(--text-dark);
  background-color: var(--light-panel);
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow);
}
body.light-theme .air-quality-popup h3 {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
body.light-theme .aqi-details {
  background-color: var(--light-overlay);
}
body.light-theme .aqi-update-time {
  color: rgba(0, 0, 0, 0.6);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .measurement-time {
  color: rgba(0, 0, 0, 0.4);
}
/* Mobile adjustments */
@media (max-width: 768px) {
  .air-quality-popup {
    max-width: 220px;
    padding: 8px;
    font-size: 0.8rem;
  }
  .air-quality-popup h3 {
    font-size: 0.95em;
    margin-bottom: 8px;
  }
  .aqi-display {
    padding: 6px;
    margin-bottom: 8px;
  }
  .aqi-display .aqi-value {
    font-size: 1.3em;
  }
  .aqi-details {
    padding: 6px;
    margin-bottom: 8px;
  }
  .aqi-details p {
    font-size: 0.75em;
    margin: 4px 0;
  }
  .measurement-time {
    font-size: 0.65em;
    margin-left: 4px;
  }
  .aqi-update-time {
    font-size: 0.7em;
    margin-top: 6px;
    padding-top: 4px;
  }
} 

/* Add styles for stale data indicators */

/* Stale pin styling */
.custom-pin.stale-pin .pin-content {
  opacity: 0.25;
  filter: grayscale(30%);
}

/* Stale indicator on pin */
.stale-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 12px;
  height: 12px;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Stale popup styling */
.air-quality-popup.stale-popup {
  border-left: 4px solid #ff6b35;
  background: linear-gradient(135deg, #fff9f7 0%, #ffffff 100%);
}

/* Light theme stale popup styling */
body.light-theme .air-quality-popup.stale-popup {
  border-left: 4px solid var(--primary-color);
  background: var(--light-panel);
  color: var(--text-dark);
}

/* Dark theme stale popup styling */
body:not(.light-theme) .air-quality-popup.stale-popup {
  border-left: 4px solid var(--primary-color);
  background: var(--dark-panel);
  color: var(--text-light);
}

/* Stale warning message */
.stale-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 8px 12px;
  border-radius: 4px;
  margin: 8px 0;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Light theme stale warning */
body.light-theme .stale-warning {
  background: rgba(52, 152, 219, 0.1);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

/* Dark theme stale warning */
body:not(.light-theme) .stale-warning {
  background: rgba(52, 152, 219, 0.2);
  border: 1px solid var(--primary-color);
  color: var(--secondary-color);
}

.stale-warning::before {
  content: "⚠️";
  font-size: 14px;
}

/* Enhanced styling for stale data in popup */
.air-quality-popup.stale-popup .aqi-display {
  opacity: 0.8;
}

.air-quality-popup.stale-popup .aqi-update-time {
  color: #666;
  font-style: italic;
}

/* Light theme stale update time */
body.light-theme .air-quality-popup.stale-popup .aqi-update-time {
  color: var(--text-muted-dark);
  font-style: italic;
}

/* Dark theme stale update time */
body:not(.light-theme) .air-quality-popup.stale-popup .aqi-update-time {
  color: var(--text-muted);
  font-style: italic;
}

/* Hover effect for stale pins */
.custom-pin.stale-pin:hover .pin-content {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.05);
  transition: all 0.2s ease;
}

/* Tooltip for stale indicator */
.stale-indicator:hover::after {
  content: "Data may be stale (older than 24 hours)";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 4px;
}

/* Light theme stale indicator tooltip */
body.light-theme .stale-indicator:hover::after {
  background: var(--dark-panel);
  color: var(--text-light);
  border: 1px solid var(--primary-color);
}

/* Dark theme stale indicator tooltip */
body:not(.light-theme) .stale-indicator:hover::after {
  background: var(--dark-bg);
  color: var(--secondary-color);
  border: 1px solid var(--primary-color);
}

/* Animation for stale warning */
@keyframes stalePulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

.stale-indicator {
  animation: stalePulse 2s infinite;
}

/* Responsive adjustments for stale indicators */
@media (max-width: 768px) {
  .stale-indicator {
    width: 10px;
    height: 10px;
    font-size: 6px;
  }
  
  .stale-warning {
    font-size: 11px;
    padding: 6px 10px;
  }
} 