/* General styles for the page */
body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  background-color: #f4f4f4;
  box-sizing: border-box;
}

#map {
  height: 400px;
  width: 100%;
  margin: 0 auto;
  display: block;
}

/* Title for the graph */
.graph-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  z-index: 10;
}

#elevation {
  width: 100%;
  height: auto;
  max-height: 600px;
}

/* Style for SVG graph */
svg {
  border: 1px solid #ccc;
  background-color: #fff;
  margin-top: 50px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  width: 100%; /* Ensure full width for responsiveness */
  max-width: 900px; /* Ensure it's responsive */
  height: 400px;
}

/* Styling for the route toggle controls */
.route-toggle {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.route-toggle label {
  font-size: 16px;
  margin: 5px 0;
  color: #333;
  transition: color 0.3s;
}

.route-toggle input[type="checkbox"] {
  margin-right: 10px;
}

/* Hover effect for route labels */
.route-toggle label:hover {
  color: #007bff;
}

.route-line {
  stroke-width: 2;
  fill: none;
}

.route-point:hover {
  r: 5; /* increase radius on hover */
  stroke-width: 2;
  stroke: black;
  transition: r 0.2s ease;
}

/* Styling for Legend Item */

#legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
  font-family: sans-serif;
  gap: 15px;
}

.legend-item {
  cursor: pointer;
  margin: 5px;
  font-size: 14px;
  transition: color 0.3s, text-decoration 0.3s, transform 0.1s;
}

.legend-item.inactive {
  color: gray;
  text-decoration: line-through;
}

/* Hover effect for legend items */
.legend-item:hover {
  color: #007bff;
  text-decoration: underline;
  transform: scale(1.05); /* Slight scale for interaction */
}

/* Mediarender queries for better responsiveness */
@media (max-width: 768px) {
  .route-toggle {
    align-items: center;
  }

  .legend-item {
    font-size: 12px;
    margin: 3px;
  }

  /* Adjust tooltip positioning for mobile */
  #tooltip {
    font-size: 12px;
    padding: 4px;
    max-width: 200px; /* Prevent tooltip overflow */
  }
}

