body, html {
  margin: 0;
  padding: 0;
  height: 100%;
}

#map {
  height: 100%;
  width: 100%;
}

/* Move Leaflet layers control to top-left */
.leaflet-top.leaflet-right {
  right: auto;
  left: 10px;
}

/* Move the layers control to the right of the zoom buttons */
.leaflet-control-layers {
  margin-left: 50px !important;
  margin-top: 0 !important;
}

/* Zoom buttons are now shown at top left */


#splashScreen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

/* Splash content box */
#splashContent {
  background: white;
  width: 85%;
  max-width: 420px;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  text-align: left;
  font-family: sans-serif;
  position: relative;
  border-top: 6px solid #8dc63f; /* subtle green accent */
}

/* Title styling */
#splashContent h2 {
  margin-top: 0;
  text-align: center;
  color: #552988; /* purple accent */
  font-weight: 700;
}

/* Section header */
#splashContent h3 {
  margin-top: 18px;
  color: #552988;
  border-bottom: 2px solid #8dc63f;
  padding-bottom: 4px;
  display: inline-block;
}


#splashLogo {
  display: block;
  width: 150px;        /* safe size */
  max-width: 80%;
  margin: 0 auto 20px auto;
  pointer-events: none;   /* prevents blocking clicks */
}

/* Continue button */
#splashBtn {
  display: block;
  margin-left: auto;
  margin-right: 0;
  margin-top: 22px;
  padding: 10px 18px;
  font-size: 16px;
  background: #552988;      /* purple primary */
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#splashBtn:hover {
  background: #8dc63f;      /* green hover */
}

/* Tool rows */
.tool-row {
  display: flex;
  align-items: center;
  margin: 6px 0;
  font-size: 15px;
}

/* Tool icons */
.tool-icon {
  width: 28px;
  display: inline-block;
  font-size: 20px;
  text-align: center;
  margin-right: 6px;
}

/* TOP-RIGHT TOOLBAR CONTAINER */
#toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

/* TOOLBAR BUTTONS */
.tool-btn {
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.tool-btn.active {
  background: #e0e0e0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

/* Legend / basemap panels */
.legend-panel {
  position: absolute;
  top: 60px;
  right: 10px;
  z-index: 1500;
  background: white;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: none;
  width: 200px;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.popup-box {
  background: white;
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  max-width: 420px;
  min-width: 280px;
}

.popup-content {
  display: flex;
  flex-direction: column;
}

.popup-content p {
  margin: 0 0 18px;
  line-height: 1.6;
  color: #222;
  font-size: 16px;
}

.popup-content button {
  margin-left: auto;
  background: #1f78b4;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px 18px;
  cursor: pointer;
}

.popup-content button:hover {
  background: #16608f;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 4px 0;
}

.legend-header {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.legend-header:hover {
  text-decoration: underline;
}

.legend-chevron {
  transition: transform 0.2s ease;
  margin-right: 6px;
  font-size: 12px;
}

.legend-chevron.expanded {
  transform: rotate(90deg);
}

/* Measure + elevation points */
.measure-point {
  background: red;
  border: 2px solid white;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.elev-point {
  background: red;
  border: 2px solid white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  line-height: 14px;
}

/* Cursors */
.crosshair-cursor {
  cursor: crosshair !important;
}

.info-cursor {
  cursor: default !important;
}

/* Basemap options */
.basemap-option {
  padding: 6px 4px;
  cursor: pointer;
}

.basemap-option:hover {
  background: #eee;
}

/* Elevation panel container */
#elevPanel {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  max-height: 260px;     /* keeps the panel from getting too tall */
  overflow-y: auto;      /* allows scrolling if needed */
  background: white;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 1500;
}

/* Pull the chart upward slightly */
#elevPanel canvas {
  margin-bottom: 50px;  /* lifts the x-axis title into view */
}


/* Print styles */
@media print {
  #toolbar {
    display: none;
  }
  #elevPanel {
    position: static;
    height: auto;
    box-shadow: none;
  }
}
