/* Reset body margin/padding */
body {
  margin: 0;
  padding: 0;
}

/* Base container uses flex for larger screens */
.container {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  /* fill the viewport height */
  margin: 0;
  padding: 0;
}

/* SIDEBAR */
.map-overlay {
  width: 25%;
  /* 25% on large screens */
  max-width: 300px;
  background: #ffffff;
  /* background: #f3f0f0; */
  font: 12px/20px 'Helvetica Neue', Arial, sans-serif;
  overflow-y: auto;
  padding: 10px;
}

/* MAP */
#map {
  position: relative;
  /* KEY: needed so .heatbar-container can be absolutely placed inside */
  flex: 1;
  /* fill remaining space on large screens */
  min-width: 0;
  /* fix potential flex overflow in some browsers */
  /* By default, #map will stretch to fill container height. */
}

/* MOBILE VIEW / SMALL SCREENS */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    /* stack top-to-bottom */
    height: auto;
    /* let content define total height, or consider min-height: 100vh; */
  }

  .map-overlay {
    width: 100%;
    height: auto;
    padding: 0px;
    /* padding: 2px; */
    /* automatically sized by content */

  }

  #map {
    width: 100%;
    /* ensure map is visible on mobile */
    height: 50vh;
    /* height: auto; */
    /* or some fixed px, or 60vh, etc. 
       Just ensure a non-zero height so the map is visible 
       and the heatbar is pinned inside it. */
    min-height: 500px;
  }
}

/* HEADINGS / LABELS INSIDE THE SIDEBAR */
.map-overlay h2 {
  margin: 0 0 1em;
}

.map-overlay label {
  font-weight: bold;
  margin-top: 1em;
  display: block;
}

/* Two-sided slider container */
#census-filter-medianIncome {
  margin-top: 45px;
  margin-bottom: 10px;
  margin-left: 15px;
  margin-right: 35px;
}

#census-filter-totalPopulation {
  margin-top: 45px;
  margin-bottom: 10px;
  margin-left: 15px;
  margin-right: 35px;
}


.range-values {
  font-size: 0.85em;
  color: #333;
}

/* noUiSlider: connected portion is green */
.noUi-connect {
  background: green !important;
}

/* Simple button styling */
button {
  margin-top: 10px;
  padding: 6px 12px;
  cursor: pointer;
}

/* LOADING SPINNER */
#loadingContainer {
  /* Position fixed to overlay the entire viewport */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  /* Semi-transparent background */
  background: rgba(255, 255, 255, 0.8);

  /* Flexbox to center the spinner and text */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  /* Ensure it appears above all other elements */
  z-index: 10000;

  /* Hidden by default */
  display: none;
}

/* Spinner Styles (Existing) */
.spinner {
  width: 48px;
  /* Increased size for better visibility */
  height: 48px;
  border: 6px solid #ccc;
  border-top: 6px solid #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
  /* Space between spinner and text */
}

/* Spinner Animation (Existing) */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Optional: Style for the "Refreshing..." text */
#loadingContainer span {
  font-size: 1.2em;
  color: #555;
}

/* MARKERS ON THE MAP */
.marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
}

/* HEATBAR INSIDE THE MAP (top-right corner) */
.heatbar-container {
  position: absolute;
  /* pinned inside #map, not the page */
  top: 10px;
  left: 10px;
  width: 140px;
  display: block;
  /* shown when data is available */
  text-align: center;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.8);
  padding: 6px;
  border-radius: 4px;
  z-index: 9999;
}

.heatbar {
  height: 10px;
  width: 100%;
  background: linear-gradient(to right, red, green);
  margin-bottom: 4px;
}

.heatbar-range {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.heatbar-range .mid {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* MOBILE VIEW (Shrink Heatbar Container) */
@media (max-width: 768px) {
  .heatbar-container {
    width: 75px;
    /* Shrink the container width */
    font-size: 6px;
    /* Smaller font size */
    padding: 2px;
    /* Adjust padding for smaller size */
  }

  .heatbar {
    height: 8px;
    /* Slightly smaller heatbar height */
  }
}

/* Make the popup content rounded and allow auto width */
.mapboxgl-popup-content {
  border-radius: 8px !important;
  max-width: none !important;
  /* let it size to content */
  width: auto !important;
  position: relative;
  padding-right: 30px;
  cursor: grab;
  /* Shows a "grab" cursor */
  /* Increase this value if necessary */
}

.mapboxgl-popup-content:active {
  cursor: grabbing;
  /* When the user clicks/holds, shows "grabbing" */
}

/* .draggable-popup .mapboxgl-popup-content {
  cursor: move;
}

.mapboxgl-popup-dragging {
  user-select: none;
} */



/* Custom Scoring Container Styling */
#custom-scoring-container {
  font-family: Arial, sans-serif;
}

#custom-scoring-container table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  /* Add spacing between rows */
}

#custom-scoring-container td {
  padding: 0;
  text-align: left;
}

/* Header row styling */
#custom-scoring-container .header-row {
  display: flex;
  align-items: center;
  font-size: 12px;
  /* Smaller font */
  font-weight: bold;
  color: #555;
  /* Dark gray for subtlety */
  padding: 4px 0px 4px 16px;
  margin-bottom: 5px;
  border-bottom: 1px solid #ddd;
  margin-right: 10px;
  /* Light separator */
}

/* Metric (left-aligned) */
#custom-scoring-container .header-row span:first-child {
  flex: 1;
  text-align: left;
}

/* Other items (right-aligned) */
#custom-scoring-container .header-row span:not(:first-child) {
  text-align: center;
  /* Center text */
  width: 60px;
  /* Match the metric row inputs */
  display: flex;
  align-items: center;
  /* Ensures vertical centering */
  justify-content: center;
  /* Ensures horizontal centering */
  text-align: center;
  word-wrap: break-word;
  /* Ensures wrapping */
  overflow-wrap: break-word;
}


#custom-scoring-container .metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f0f8ff;
  /* Light blue for the oval */
  padding: 1px 16px;
  border-radius: 20px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#custom-scoring-container .metric-row>* {
  margin-right: 10px;
}

#custom-scoring-container .metric-name {
  flex: 1;
  font-weight: bold;
}

#custom-scoring-container .weight-input,
.min-comp-class {
  width: 40px;
  text-align: center;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: none;
}

#custom-scoring-container .weight-input::-webkit-outer-spin-button,
#custom-scoring-container .weight-input::-webkit-inner-spin-button,
.min-comp-class::-webkit-outer-spin-button,
.min-comp-class::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#custom-scoring-container .weight-input[type="number"],
.min-comp-class[type="number"] {
  -moz-appearance: textfield;
}


#custom-scoring-container .divide-competitors {
  transform: scale(1.2);
  /* Match checkbox size */
}

#custom-scoring-container .remove-metric-btn {
  background-color: transparent;
  color: #dc3545;
  /* Red color for the X */
  font-size: 1.2rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  margin-left: 5px;
}

#custom-scoring-container .remove-metric-btn:hover {
  color: #a71d2a;
  /* Darker red on hover */
}

#custom-scoring-container #refresh-score-btn {
  margin-top: 10px;
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#custom-scoring-container #refresh-score-btn:hover {
  background-color: #0056b3;
}

/* Layer sidebar */
.layermenu label {
  display: block;
  margin: 0.5em 0;
}

/* Style for expandable sections using details/summary */
summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-left: 1.2em;
  font-weight: bold;
}

summary::before {
  content: "►";
  position: absolute;
  left: 0;
  transition: transform 0.2s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}

/* Indent the content inside details (but not the summary) */
details>*:not(summary) {
  margin-left: 20px;
}

details {
  margin-bottom: 1em;
}

/* Original zoom blurb styling */
#zoom-blurb {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 999;
  display: none;
  /* hidden by default */
  transition: all 0.3s ease;
}

/* Warning state styling */
#zoom-blurb.warning {
  display: block;
  /* force visible */
  background: rgba(255, 0, 0, 0.8);
  /* red background */
  font-size: 1.5em;
  font-weight: bold;
  animation: pulse 1s infinite;
}

/* Traffic zoom blurb styling */
#traffic-zoom-blurb {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 999;
  display: none;
  /* hidden by default */
}

/* Traffic zoom blurb visible state with pulse animation */
#traffic-zoom-blurb.show {
  display: block;
  animation: pulse 1s infinite;
}

/* Pulse animation */
@keyframes pulse {
  0% {
    transform: translateX(-50%) scale(1);
  }

  50% {
    transform: translateX(-50%) scale(1.05);
  }

  100% {
    transform: translateX(-50%) scale(1);
  }
}

/* Loading icon */

/* Loading Spinner */
.loading-icon {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 35px;
  height: 35px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
  /* Hidden by default */
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


/* Select inputs */
/* 1) Base style for every <select> and every Choices input */
/* .choices__inner, */
/* .select {
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 0.5em 0.75em;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  box-sizing: border-box;
} */

/* 2) Extra margins just for your competition filters */
/* .competition-filter {
  margin-left: 30px;
  margin-top: 10px;
  margin-bottom: 10px;
} */

/* show a bold label when nothing’s selected */
/* .choices__inner[data-type*="select-multiple"] {
  content: "Business Type";
  font-weight: bold;
  position: absolute;
  left: 0.75em;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #666;
} */

/* match native <select> line-height */
/* .choices__inner {
  line-height: normal !important;
} */