/* main.css */
body {
  margin: 0;
  font-family: Arial, sans-serif;
}

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#navbar-title {
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

#basemap-toggle {
  background: white;
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#map {
  position: absolute;
  top: 50px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 50px);
  z-index: 0;
  overflow: hidden !important;
}
html, body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden !important;
}

body {
  box-sizing: border-box;
  overscroll-behavior: none;
}

#sidebar {
  position: fixed;
  top: 50px;
  left: 0;
  width: 300px;
  height: calc(100vh - 50px);
  max-height: calc(100vh - 50px);
  background: #fff;
  border-right: 1px solid #ccc;
  overflow-y: auto;
  z-index: 2;
  padding: 16px;
  display: none;
  box-sizing: border-box;
}

#sidebar.active {
  display: block;
}

#layer-toggle {
  position: absolute;
  top: 70px;
  right: 20px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(15px);
  padding: 16px;
  z-index: 3;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border: 1px solid #e3e8ee;
  min-width: 220px;
  max-width: 280px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reduce vertical padding between items in Layers toggle */
#layer-toggle label {
  display: block;
  margin-bottom: 0px;
  font-size: 13px;
  color: #2c3e50;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.2s;
}

#layer-toggle label:hover {
  color: #3498db;
}

#layer-toggle label:last-child {
  margin-bottom: 0;
}

#layer-toggle input[type="checkbox"] {
  margin-right: 8px;
  accent-color: #3498db;
}

/* Custom scrollbar for layer toggle if it gets too long */
#layer-toggle {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

#layer-toggle::-webkit-scrollbar {
  width: 6px;
}

#layer-toggle::-webkit-scrollbar-track {
  background: transparent;
}

#layer-toggle::-webkit-scrollbar-thumb {
  background-color: #bdc3c7;
  border-radius: 3px;
}

#layer-toggle::-webkit-scrollbar-thumb:hover {
  background-color: #95a5a6;
}

/* Collapsible layer toggle styles */
#layer-toggle.collapsed {
  width: 44px !important;
  min-width: 0 !important;
  max-width: 44px !important;
  height: 44px !important;
  max-height: 44px !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 50%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  right: 20px;
  top: 70px;
  position: absolute;
  z-index: 1001;
}
#layer-toggle.collapsed *:not(#layer-toggle-collapse-btn) {
  display: none !important;
}
#layer-toggle.expanded {
  /* Use previous styles for expanded state */
}
#layer-toggle-collapse-btn {
  position: static !important;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #3498db;
  z-index: 10;
  padding: 0;
  transition: transform 0.2s;
}
#layer-toggle-collapse-icon {
  font-size: 28px;
  pointer-events: none;
}
