/* --- Main Content Area --- */
#main-container {
  flex-grow: 1;
  display: flex;
}

#map {
  width: 66%;
  height: 100%;
  box-sizing: border-box;
  position: relative;
}

#sidebar {
  width: 34%;
  height: 100%;
  background: #f8f8f8; /* Dark theme */
  color: #595959; /* Light text */
  padding: 20px;
  border-left: 1px solid #555;
  /* overflow-y: auto; */
  box-sizing: border-box;
  position: relative;
}

.sidebar-panel {
  /*box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* The requested shadow */
  /*overflow: hidden; /* This makes the inner elements conform to the panel's shape */
  border-radius: 4px; /* A clean radius for the entire panel */

  /* Pin the panel to the inside edges of the sidebar's padding area */
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 20px;
  right: 20px;

  /* Use a simple grid to manage the tabs and content */
  display: grid;
  grid-template-rows: auto 1fr; /* First row fits the tabs, the second row fills ALL remaining space */
}

.tab-header {
  display: flex;
  gap: 6px;
  margin-bottom: 0px;
  flex-wrap: wrap;
}

.tab-button {
  flex: 1;
  background-color: #487b99;
  color: #fff;
  border: none;
  padding: 18px 10px; /* More top/bottom padding */
  border-radius: 4px 4px 0 0; /* Add back rounded top corners */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  position: relative;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.85em;
  transition: background-color 0.15s;
  z-index: 2; /* Ensure buttons sit on top of the content box edge */
}

.tab-button:hover {
  background-color: #35597b;
}

.tab-button.active {
  background-color: #ffffff;
  color: #25385b;
  /* This creates a shadow on the top, left, and right, but NOT the bottom,
       allowing a seamless connection. */
  box-shadow:
    0 -5px 10px -5px rgba(0, 0, 0, 0.2),
    /* Top */ -5px -1px 5px -5px rgba(0, 0, 0, 0.2),
    /* Left */ 5px -1px 5px -5px rgba(0, 0, 0, 0.2); /* Right */
}

.tab-content {
  display: block;
  background-color: #ffffff;
  color: #25385b;
  padding: 25px;
  border-radius: 0 0 4px 4px;
  border: none;
  position: relative;
  z-index: 1;
  margin-top: 0;
  box-shadow: 0 0px 12px rgba(0, 0, 0, 0.2);
  /* The height will now be set by JavaScript */
  overflow-y: auto;
  min-height: 0;
  padding-top: 20px;
}

.hidden {
  display: none !important;
}

.tab-button:not(.active) {
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

#info_panel_result {
  margin-top: 0; /* Was 20px */
  background-color: transparent;
  color: inherit;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 1em;
  white-space: normal;
  scroll-behavior: smooth;
}

#sidebar h2 {
  margin-top: 0;
  margin-bottom: 0;
  color: #487b99;
}

/* Move default Leaflet zoom controls downward */
.leaflet-control-zoom {
  top: 60px !important;
  right: 10px !important;
  left: auto !important;
}

#custom-layer-control {
  position: absolute;
  top: 11px;
  right: 10px; /* Perfectly spaces it next to the satellite toggle pill */
  z-index: 1000;
}

#custom-layer-control .dropbtn {
  background-color: #f8f8f8;
  color: #494949;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  border-radius: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#custom-layer-control .dropdown-content {
  right: 0;
  left: auto;
  width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 15px;
  box-sizing: border-box;
}
