/* Base layout */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

body {
  position: relative;
}

/* Ensure map and canvas layers stay behind UI elements */
.deckgl-overlay, canvas {
  position: absolute !important;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Wrapper for UI elements overlaid on map */
/* #ui-wrapper {
  position: absolute;
  top: 1rem;
  left: 1rem;
  bottom: 1rem;           
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  overflow-y: auto;        
  padding-right: 0.5rem;    
} */

#ui-wrapper {
  position: absolute;
  top: 1rem;
  left: 1rem;
  bottom: 1rem;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;

  /* Slide-in behavior */
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

#ui-wrapper.slide-in {
  transform: translateX(0);
}

/* Panel-style card UI for charts and slider */
#controls,
#chart-container,
#pop-chart-container,
#gdp-chart-container {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

/* Donut chart max width on small screens */
.spectral-donut {
  max-width: 300px;
  width: 100%;
  height: auto;
}

/* Hint displayed in corner for user guidance */
#hint {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.9rem;
  color: rgb(0, 0, 0);
  background: rgb(255, 255, 255);
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-weight: 500;
  z-index: 10;
  transition: background 0.3s ease;
}

/* Label text next to slider value */
#participant-value {
  display: inline-block;
  min-width: 1.5em;
  text-align: right;
}

/* Layout for slider control row */
#participant-control {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

#participant-control label {
  flex-shrink: 0;
}

#participant-slider {
  flex-grow: 1;
  min-width: 0;
}

/* Modal for intro message */
#info-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.modal-box {
  background: white;
  padding: 2rem 2.5rem;
  border-radius: 10px;
  max-width: 480px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.modal-box p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #333;
}

/* Dismiss button in modal */
#dismiss-btn {
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background-color: #007aff;
  color: white;
  cursor: pointer;
}

#dismiss-btn:hover {
  background-color: #005ecb;
}

/* Treaty list panel */
#treaty-list {
  position: absolute;
  top: 1rem;
  right: 1rem;
  max-width: 300px;
  background: white;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  color: #333;
  z-index: 1000;
  overflow-y: auto;
  max-height: 80vh;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* Heading inside treaty list panel */
.treaty-title {
  margin: 0 0 8px 0;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
}

/* Tooltip for donut chart segments */
.donut-tooltip {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  color: #333;
  white-space: nowrap;
}

/* Slider styling with colored fill and custom thumb */
#participant-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: linear-gradient(to right, #B0ADCA 0%, #B0ADCA 29%, #e0e0e0 29%, #e0e0e0 100%);
  outline: none;
  transition: background 0.3s ease;
}

/* Slider thumb for Chrome/Safari */
#participant-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #B0ADCA;
  cursor: pointer;
  border: none;
  margin-top: -7px;
  position: relative;
  z-index: 1;
}

/* Firefox slider track and thumb */
#participant-slider::-moz-range-track {
  background: none;
  height: 6px;
}

#participant-slider::-moz-range-progress {
  background: #B0ADCA;
  height: 6px;
}

#participant-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #B0ADCA;
  border: none;
  cursor: pointer;
}

#ui-toggle-btn {
  position: absolute;
  top: 50%;
  left: 0px; /* move 10px from the left edge */
  transform: translateY(-50%); /* only center vertically */
  z-index: 1000;
  cursor: pointer;
  padding: 0.5rem;
  background: white;
  border-radius: 0 6px 6px 0;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease;
}

#ui-toggle-btn:hover {
  background: #f0f0f0;
}

#ui-toggle-btn img {
  width: 24px;
  height: 24px;
  display: block;
}

#recenter-toggle {
  position: absolute;
  bottom: 3.5rem; /* sits just above the hint */
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-weight: 500;
  color: #333;
}

#recenter-toggle input {
  margin-right: 6px;
}