:root {
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.1);
  --text-primary: #333333;
  --text-secondary: #555555;
  --accent-color: #00bcd4;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: #e0e0e0;
  color: var(--text-primary);
  overflow: hidden;
  /* Prevent scroll on full-screen map */
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

/* UI Overlay Container */
.overlay-container {
  position: absolute;
  top: 20px;
  left: 0;
  z-index: 1;
  /* Above map */
  pointer-events: none;
  /* Let clicks pass through around the card */
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}


/* Glassmorphism Card */
.glass-card {
  pointer-events: auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  width: fit-content;
  /* Fit content tightly */
  max-width: 350px;
  transition: transform 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.transparent-card {
  pointer-events: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  width: fit-content;
  max-width: 350px;
  transition: transform 0.3s ease;
}

.transparent-card:hover {
  transform: translateY(-2px);
  /* Optional: drop shadow on the image itself if needed, or keep hover effect simple */
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.brand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
  /* Removed bottom margin since text is gone */
}

.brand-logo {
  max-width: 60%;
  /* Doubled from 25% */
  height: auto;
  margin-bottom: 2px;
  border-radius: 2px;
  /* Optional slight rounding */
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Loader */
#loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile Tweaks */
@media (max-width: 600px) {
  .overlay-container {
    top: auto;
    bottom: 10px;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    align-items: center;
    /* Center card on mobile bottom */
  }

  .glass-card {
    width: calc(100% - 40px);
    max-width: 100%;
  }
}

/* Premium Popup Styles */
.mapboxgl-popup-content {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #333 !important;
  border: 1px solid var(--glass-border);
  border-radius: 8px !important;
  padding: 15px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
  font-family: var(--font-family);
  backdrop-filter: blur(5px);
}

.mapboxgl-popup-tip {
  border-top-color: rgba(255, 255, 255, 0.95) !important;
  border-bottom-color: rgba(255, 255, 255, 0.95) !important;
}

.mapboxgl-popup-close-button {
  color: #555;
  font-size: 16px;
  padding: 4px;
}

.mapboxgl-popup-close-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
}


/* Map Legend */
.legend-container {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1;
  pointer-events: none;
}

.legend-card {
  padding: 12px 16px;
  /* Increased padding */
  font-size: 0.9rem;
  /* Slightly larger font */
  display: flex;
  flex-direction: column;
  /* Stack items vertically */
  align-items: flex-start;
  /* Align to left */
  gap: 10px;
  /* Spacing between items */
  pointer-events: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-color {
  width: 20px;
  height: 20px;
  background-color: #DA70D6;
  /* Orchid to match boundary */
  opacity: 0.5;
  /* Match fill opacity */
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

.legend-line-black {
  width: 20px;
  height: 3px;
  background-color: #333333;
  border-radius: 2px;
}

.legend-line-brown {
  width: 20px;
  height: 3px;
  background-color: #8B4513;
  border-radius: 2px;
}

.legend-color-areas {
  width: 20px;
  height: 20px;
  background-color: #DA70D6;
  /* Orchid */
  opacity: 0.5;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 3px;
}

/* Mobile Tweaks Legend Override */
@media (max-width: 600px) {
  .legend-container {
    top: auto;
    left: auto;
    bottom: 30px;
    right: 10px;
    width: auto;
    /* Don't stretch */
  }
}