body {
  margin: 0;
  font-family: Arial, sans-serif;
}

#map {
  height: 100vh;
  width: 100%;
}

.chart-container {
    width: 400px;
  max-width: 90%;
  margin: 0 auto;
  position: absolute;
  top: 20%;
  right: 5%;
  /* transform: translateY(-50%); */
  width: 40%;
}

.chart-container-collapse {
    width: 600px;
  max-width: 90%;
  margin: 0 auto;
  position: absolute;
  top: 38%;
  left: 5%;
  transform: translateY(-50%);
  width: 40%;
}

#fragilityChart {
  width: 100% !important;
  height: auto !important;
}

#collapseDistChart {
  width: 100% !important;
  height: auto !important;
}

#navbar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  z-index: 1000;
}

#navbar button {
  all: unset;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.7);
  color: #111;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

#navbar button:hover {
  background-color: rgba(255, 255, 255, 0.9);
  transform: scale(1.03);
}

#navbar button:active {
  background-color: rgba(240, 240, 240, 0.9);
  transform: scale(0.98);
}

#form {
  position: absolute;
  top: 80px;
  left: 11.5%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 20px 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #111;
  z-index: 999;
  border: 1px solid rgba(255, 255, 255, 0.3);
  text-align: center;
}

#form h2 {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

#form input[type="text"] {
  padding: 10px 12px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  width: 300px;
  margin-right: 8px;
  background: rgba(255, 255, 255, 0.8);
  outline: none;
}

#form input[type="number"],
#form select {
  padding: 10px 12px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  width: 300px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.8);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

#form select {
  color: #111;
}

#form select:invalid {
  color: #888;
}

#form button {
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 500;
  background-color: #007aff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#form button:hover {
  background-color: #005ecb;
}
.custom-infobox {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-20%, -100%);
  max-width: 280px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #fff;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 999;
  transition: opacity 0.3s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none;
}


#graphTab {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr)); /* two columns */
  gap: 16px 24px;            /* row/column spacing */
  align-items: start;
  padding: 8px 5% 16px;      /* small top padding to kill the "huge gap" */
}

/* Put charts back into normal flow and make them grid items */
#graphTab .chart-container,
#graphTab .chart-container-collapse {
  position: static !important;   /* override absolute */
  top: auto; right: auto; left: auto; transform: none;
  width: 100% !important;        /* fill grid column */
  max-width: none;
  margin: 0;                     /* remove auto-centering margin */
}

/* Make canvas not reserve extra baseline space */
#graphTab #fragilityChart,
#graphTab #collapseDistChart {
  display: block;
}

/* Make the table wrapper span both columns and sit right under charts */
#graphTab .casualty-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 12px;              /* small, controlled gap above table */
}


html.no-scroll,
body.no-scroll {
  height: 100vh;
  overflow: hidden;
}

/* make sure the map tab itself doesn't create scrollbars */
#mapTab {
  min-height: 100vh;
  overflow: hidden;
}

/* (optional, nicer wheel behavior on the map) */
#map {
  overscroll-behavior: contain;
}