/* General Layout */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  overflow: hidden;
}

#map {
  height: 100vh;
}

/* Sidebar Styling */
#sidebar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 320px;
  z-index: 1000;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}

#sidebar.open {
  transform: translateX(0);
}

#sidebar.dark {
  background: linear-gradient(145deg, #1f2937, #111827);
}

/* Sidebar Toggle Button */
#sidebar-toggle {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1001;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  font-size: 28px; /* Adjusted for better icon balance */
  line-height: 1; /* Helps center the icon vertically */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* Synchronize transition with the sidebar's animation */
  transition:
    transform 0.3s ease-in-out,
    background-color 0.2s ease-in-out;
}

#sidebar-toggle:hover {
  background: #f3f4f6;
  transform: scale(1.05);
}

#sidebar.open + #sidebar-toggle {
  transform: translateX(320px);
}

#sidebar.open + #sidebar-toggle:hover {
  transform: translateX(320px) scale(1.05);
}

#sidebar-toggle.dark {
  background: #1f2937;
  border-color: #4b5563;
  color: #ffffff;
}

/* Follow Button */
#follow-btn.following {
  background-color: #34d399;
  color: #047857;
}

.leaflet-mission-waypoint {
  stroke-width: 1.5px;
}

.leaflet-mission-path {
  weight: 2px;
}

/* Responsive Design */
@media (max-width: 640px) {
  #sidebar {
    width: 100%;
    max-width: 280px;
  }

  /* NEW: Adjust the button's movement for the smaller sidebar */
  #sidebar.open + #sidebar-toggle {
    transform: translateX(280px);
  }

  #sidebar.open + #sidebar-toggle:hover {
    transform: translateX(280px) scale(1.05);
  }
}

.vector-pin-marker {
  background: transparent;
  border: none;
}

/* Ensures the SVG element scales correctly inside its container div. */
.vector-pin-svg {
  width: 100%;
  height: 100%;
}
