* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  height: 100vh;
  overflow: hidden;
}

h1 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #333;
}

p {
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  margin-bottom: 20px;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
}

#info-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 350px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  z-index: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#info-panel.collapsed {
  transform: translateX(-110%);
  opacity: 0;
  pointer-events: none;
}

/* Button styles */
#toggle-3d,
#toggle-extent,
#toggle-cta {
  width: 100%;
  margin: 5px 0;
  padding: 10px 16px;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#toggle-extent {
  background: #e6a774;
}

#toggle-extent:hover {
  background: #cf6d1d;
}

#toggle-3d {
  background: #228b22;
}

#toggle-3d:hover {
  background: #006400;
}

#toggle-cta {
  background: #0066cc;
}

#toggle-cta:hover {
  background: #004499;
}

/* Quality toggle button */
#toggle-quality {
  width: 100%;
  margin: 5px 0;
  padding: 10px 16px;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: #d84315; /* Purple to differentiate from other buttons */
}

#toggle-quality:hover:not(:disabled) {
  background: #bf360c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
}

#toggle-quality:active:not(:disabled) {
  transform: translateY(0);
}

#toggle-quality:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Quality note/description */
#quality-note {
  font-size: 11px;
  color: #666;
  line-height: 1.4;
  margin: 8px 0 12px 0;
  padding: 8px 12px;
  background: #f8f9fa;
  border-left: 3px solid #d84315;
  border-radius: 0 4px 4px 0;
}

#toggle-quality:disabled + #quality-note {
  border-left-color: #bdc3c7;
  color: #999;
}

#legend {
  margin-top: 20px;
}

#legend h3,
#methodology h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #333;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #666;
}

.legend-color {
  width: 30px;
  height: 20px;
  margin-right: 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
}

#parcel-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

#methodology {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.hidden {
  display: none;
}

#loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#loading-spinner-internal {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0066cc;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#github-repo-section {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

/* Popup/Modal for parcel details */
.maplibregl-popup {
  max-width: 300px;
}

.maplibregl-popup-content {
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.popup-details div {
  margin-bottom: 6px;
  font-size: 13px;
}

.popup-details strong {
  color: #333;
}

/* Panel toggle button (X to close) */
.panel-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #666;
  border: 1px solid #ddd;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
  z-index: 10;
}

.panel-toggle:hover {
  background: #f5f5f5;
  color: #333;
  border-color: #999;
  transform: scale(1.05);
}

.panel-toggle:active {
  transform: scale(0.95);
}

/* Show panel button (hamburger icon) */
#show-panel-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  background: white;
  color: #333;
  padding: 12px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#show-panel-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

#show-panel-btn:active {
  transform: translateY(0);
}

#show-panel-btn.visible {
  display: flex;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  #info-panel {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    max-height: 85vh;
  }

  #show-panel-btn {
    top: 10px;
    left: 10px;
  }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
  #info-panel {
    max-width: 320px;
  }
}
