/* Reset */
* {
    box-sizing: border-box;
  }
  
  html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
  }
  
/* HEADER */
#header {
    padding: 12px 20px;
    background: #1e1e2f;
    color: #ffffff;
    display: flex;
    flex-direction: column;   /* <-- TITLE ON TOP - controls below */
    align-items: flex-start;  /* left align */
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  }

/* Title */
#title {
  font-size: 1.3rem;
  font-weight: 700;
}

  /* MAIN LAYOUT: FLEX */
  #main {
    display: flex;
    height: calc(100vh - 60px);
    gap: 16px;
    padding: 16px;
  }
  
  /* MAP SECTION (LEFT) */
  #map-section {
    flex: 2;
    min-width: 0;
  }
  
  #map-container {
    width: 100%;
    height: 100%;
  }
  
  #map {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: #ddd;
  }
  
  /* SIDE PANEL (RIGHT) */
  #side-panel {
    flex: 1; 
    background: #ffffff;
    border-radius: 30px; /* rounded corners */
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    overflow-y: auto;
  }
  
  .panel-title {
    margin: 0 0 15px;
    font-size: 1.5rem;
    font-weight: bold;
  }
  
  .panel-subtitle {
    margin: 0 0 20px;
    font-size: 1.35rem;
    font-weight: 800;
    color: #555;
  }

  year-analysis-subtitle {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 800;
    color: #555;
  }


  .panel-subtitle-2 {
    margin: 0 0 10px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #555454d1;
  }


  
  /* Responsive: stack on mobile */
  @media (max-width: 900px) {
    #main {
      flex-direction: column;
    }
  
    #side-panel {
      height: 100%;
      max-width: 100%;
    }
  }
  
  /* Wrap both controls side by side */
#header-controls {
  display: flex;
  align-items: center;
  gap: 20px;            /* space between date filter & search box */
  margin-top: 10px;
  flex-wrap: nowrap;    /* force side-by-side, no line break */
}

/* DATE FILTER BOX */
#date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  white-space: nowrap;       /* prevents dates from wrapping */
}

/* Labels */
#date-filter label {
  font-weight: 500;
  color: #333;
}

/* Date inputs */
#date-filter input[type="date"] {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fafafa;
  font-size: 14px;
}

/* Filter button */
#date-filter-btn {
  background: #d32f2f;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

#date-filter-btn:hover {
  background: #b71c1c;
}

/* SEARCH BOX */
#search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

#search-box input {
  padding: 8px 20px;
  border-radius: 50px;
  border: 1px solid #ccc;
  width: 260px;
}

#search-box button {
  background: #b71c1c;
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  color: white;
  cursor: pointer;
}

#search-box button:hover {
  background: #d32f2f;
}

/* Suggestions list */
#suggestions {
  position: absolute;
  top: 40px;          /* directly below input box */
  left: 0;
  width: 100%;
  background: #fff;
  border-top: none;
  max-height: 180px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 9999;      /* ensure visible above map */
  display: block;
}

#suggestions li {
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: #333;      
}

#suggestions li:hover {
  background-color: #ff6b6b;
}


#chart-container {
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 10px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

#chart-container h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.chart-wrapper {
  position: relative;
  height: 300px;   /* adjust as you like */
  margin-bottom: 20px;

}

#reset-year {
  background: #d32f2f;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
}

#reset-year:hover {
  background: #b71c1c;
}

#feature-select {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fafafa;
  font-size: 14px;
  margin-left: 10px;
}


#chart-container p {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 35px;

}
.chart-wrapper {
  margin-top: 10px;
}



#sex-chart-wrapper,
#race-chart-wrapper,
#age-chart-wrapper,
#pyramid-chart-wrapper {
  display: none;
}