/* --- GLOBAL LAYOUT RESETS --- */
body, html { 
  margin: 0; 
  padding: 0; 
  height: 100%; 
  overflow: hidden; 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#map { 
  height: 100vh; 
  width: 100%; 
  z-index: 1; 
}

/* --- MAP CONTROL ROW (TOP RIGHT) --- */
.map-controls-row {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

/* Update this specific block right here: */
.control-btn, #themeSelect {
  position: static !important; 
  background: white;
  color: #333;
  border: 1px solid #ccc;
  padding: 8px 14px;
  border-radius: 6px;
  
  /* FORCE THE FONT TO A CLEAN SANS-SERIF TYPEFACE */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500; /* Gives it a crisp, deliberate modern look */
  
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  height: 36px;
  box-sizing: border-box;
  transition: all 0.2s ease-in-out;
}

.control-btn:hover, #themeSelect:hover {
  background: #f5f5f5;
}

/* --- CONDITIONAL VISIBILITY ANIMATION FOR MODETOGGLE --- */
#modeToggle {
  opacity: 1;
  visibility: visible;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease, max-width 0.2s ease, padding 0.2s ease, visibility 0.2s ease;
}

#modeToggle.hidden {
  opacity: 0;
  visibility: hidden;
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  border: none;
  margin: 0;
}

/* --- SIDEBAR INFO PANEL --- */
#infoPanel {
  position: absolute; 
  top: 70px; /* Offset safely down below the top button layout row */
  right: 20px; 
  z-index: 1000;
  background: white; 
  width: 300px; 
  max-height: 70vh; 
  overflow-y: auto;
  padding: 15px; 
  display: none; 
  border-radius: 6px; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* --- COLLAPSIBLE LEGEND PANEL (BOTTOM RIGHT) --- */
#legendContainer {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  width: 300px;
}

#legendToggle {
  background: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  padding: 6px 0;
  font-size: 12px;
  width: 100%;
  outline: none;
}

#legend {
  background: white;
  padding: 15px;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 400px;
  opacity: 1;
  overflow-y: auto;
  transition: max-height 0.3s ease-in-out, opacity 0.2s ease-in-out, padding 0.3s ease-in-out;
}

/* Collapse override states */
#legendContainer.collapsed #legend {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  border: none;
}

.legend-item { display: flex; align-items: center; margin-bottom: 4px; font-size: 12px; }
.legend-color { width: 15px; height: 15px; margin-right: 8px; border-radius: 2px; }

/* --- CUSTOM SPECIAL VECTOR EFFECTS --- */
.glow-line { 
  filter: drop-shadow(0 0 2px rgba(255,255,255,0.5)); 
}

/* --- LEAFLET POP-UP TYPOGRAPHY --- */
.leaflet-popup-content-wrapper {
  font-family: "Helvetica Neue", Roboto, sans-serif;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* Target the text inside the pop-up specifically */
.leaflet-popup-content {
  font-size: 13px;
  line-height: 1.5;
  color: #333;
  margin: 12px 15px; /* Clean internal margins */
}

/* Style the attribute titles/labels inside the pop-up */
.leaflet-popup-content strong {
  font-weight: 600;
  color: #000;
  text-transform: capitalize; /* Changes display text casing style if desired */
}

/* Prevent pure black flashes behind your smooth new tiles */
.dark-mode #map {
  background-color: #242426 !important; 
}
#satelliteFilterContainer {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 16px 24px 10px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
  border: 1px solid #ddd;
}

#satelliteFilterContainer.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ruler-container {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 200px;
}

/* Generates procedural geometric tick lines mimicking a drafting rule */
.ruler-track-ticks {
  height: 6px;
  width: 100%;
  margin-bottom: 4px;
  background: repeating-linear-gradient(
    90deg,
    #999,
    #999 1px,
    transparent 1px,
    transparent 10px
  );
  opacity: 0.6;
}

#satelliteSaturationSlider {
  width: 100%;
  margin: 0;
  cursor: pointer;
  accent-color: #222;
}

.ruler-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10px;
  font-family: monospace;
  color: #666;
}

/* Add this at the bottom of style.css */
.satellite-tile-target {
  transition: filter 0.8s ease-in-out !important;
}

/* --- TOP-LEFT THEME DESCRIPTION BOX --- */
#themeDescriptionBox {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 13px;
  line-height: 1.4;
  max-width: 280px;
  display: none; /* Hidden by default until populated */
  pointer-events: auto;
}