html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: "Segoe UI", sans-serif;
  background: #f7f9fc;
  overflow: hidden;
}

#map {
  display: block;
  width: 100%;
  height: 100%;
}

/* Floating Controls */
#map-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 15px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  gap: 8px;
  z-index: 10;
}

#map-controls button {
  background: #007acc;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

#map-controls button:hover {
  background: #005fa3;
  transform: scale(1.05);
}

/* Tooltip */
.tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
}

/* Legend */
.legend rect {
  opacity: 0.95;
}

circle.dc,
circle.moredc,
circle.usage {
  cursor: pointer;
  transition: r 0.2s, fill 0.2s;
}

/* Floating panel on top-left */
.btn-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

/* Button styling */
.btn-panel .btn {
  border-radius: 6px;
  padding: 6px 10px;
  font-weight: 500;
  transition: background 0.2s, transform 0.1s;
}

/* Hover effect for buttons */
.btn-panel .btn:hover {
  background-color: #005fa3; /* darker blue */
  transform: scale(1.05);
}

/* Optional: active state for toggle button */
.btn-panel .btn:active {
  transform: scale(0.95);
}

#sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 28%;
  height: 100%;
  background: #f0f8ff;
  padding: 20px;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
}

#water-container {
  position: relative;
  width: 100%;
  height: 300px;
  background: linear-gradient(to top, #004080, #80cfff);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}

#water-level {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: rgba(0, 119, 255, 0.7);
  height: 0; /* updated dynamically */
  transition: height 1s ease-in-out;
  border-top-left-radius: 50% 20px;
  border-top-right-radius: 50% 20px;
}

/* optional gentle wave animation */
@keyframes wave {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-10px);
  }
  100% {
    transform: translateX(0);
  }
}

#water-level::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  width: 200%;
  height: 20px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: wave 2s infinite linear;
}

#water-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: #f0f8ff;
  padding: 15px;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
}

#water-sidebar .sidebar-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

#ai-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: #f0f8ff;
  padding: 15px;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
}

#ai-sidebar .sidebar-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

#map-container {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
