* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.navbar span {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

html,
body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.main {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.navbar {
  position: relative;
  z-index: 2000;
  flex: 0 0 auto;
  background: #000000;
}

#map3d {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.my-location-btn {
  position: absolute;
  top: 55vh;
  right: 10px;
  z-index: 3000;
  /* above map/toolbars */
  width: 34px;
  height: 34px;
  display: flex;
  /* center the icon */
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  /* sets FA icon color */
  border: none;
  border-radius: 4px;
  font-size: 18px;
  /* icon size */
  box-shadow: 0 0 12px rgba(255, 255, 255, .4);
  cursor: pointer;
}

.my-location-btn i {
  pointer-events: none;
}

/* click hits the button */
.my-location-btn:hover {
  background: rgba(101, 133, 5, 0.9);
}


.card {
  /* background: #000000 !important; */
  background-color: rgba(0, 0, 0, 0.6) !important;
  color: white;
  padding: 16px;
  width: 350px;
}

#data-warehouse-panel {
  max-height: calc(100vh - 150px);
  /* leave space for navbar and padding */
  overflow-y: auto;
  overflow-x: hidden;
}

/* scrolling style  start */
/* Works in Chrome, Edge, Safari */
#data-warehouse-panel::-webkit-scrollbar,
#dataDisplay::-webkit-scrollbar {
  width: 8px;
  /* thin scrollbar */
}

#data-warehouse-panel::-webkit-scrollbar-track,
#dataDisplay::-webkit-scrollbar-track {
  background: #1a1a1a;
  /* dark track */
}

#data-warehouse-panel::-webkit-scrollbar-thumb,
#dataDisplay::-webkit-scrollbar-thumb {
  background-color: #555;
  /* grey handle */
  border-radius: 4px;
  border: 1px solid #222;
  /* subtle border */
}

#data-warehouse-panel::-webkit-scrollbar-thumb:hover,
#dataDisplay::-webkit-scrollbar-thumb:hover {
  background-color: #888;
  /* lighter on hover */
}

/* Firefox */
#data-warehouse-panel,
#dataDisplay {
  scrollbar-width: thin;
  scrollbar-color: #555 #1a1a1a;
}

/* scrolling style end  */


.folder>.child-items {
  margin-left: 15px;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background-color: #000000 !important;
  /* keep same bg */
  color: white !important;
  /* keep same text color */
}

/* Style all input and select fields */
.form-control,
.form-select {
  background-color: #1a1a1a;
  /* light black background */
  color: white;
  /* text color */
  border: 1px solid #444;
  /* subtle dark border */
}

/* Style placeholder text for inputs */
.form-control::placeholder {
  color: #bbbbbb;
  /* lighter placeholder for contrast */
  opacity: 1;
  /* full opacity */
}

/* For dropdown option styling */
.form-select option {
  background-color: #1a1a1a;
  /* dark dropdown background */
  color: white;
}

/* Keep dark theme when focusing */
.form-control:focus,
.form-select:focus {
  background-color: #1a1a1a !important;
  /* stay light black */
  color: white !important;
  border-color: #00e651;
  /* green border */
  box-shadow: 0 0 0 0.2rem rgba(0, 230, 81, 0.25);
  /* subtle green glow */
}

.close-btn {
  position: absolute;
  top: 5px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  z-index: 1001;
}

.close-btn:hover {
  color: #ff5c5c;
}

/* Query panel: use viewport height, allow vertical scroll */
#query-container-id {
  height: 45vh;
  /* responsive height */
  max-height: 60vh;
  /* cap on big phones */
  overflow-y: auto;
  overflow-x: auto;
  /* horizontal scroll handled by .table-scroll */
}

/* Horizontal scroll for the table only */
#query-container-id .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* smooth on iOS */
}

/* Table sizing: let it grow wider than viewport if needed */
#query-container-id table {
  width: max-content;
  /* expands to fit columns */
  min-width: 700px;
  /* adjust to your columns */
  font-size: 13px;
  /* your default */
  margin: 0;
  /* remove gaps in scroll container */
  border-collapse: separate;
  /* keeps sticky header shadow cleaner */
}

/* Sticky header so column names stay visible while scrolling */
#query-container-id thead th {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1;
}

/* Make the close button not overlap scrollers */
#query-container-id .close-btn {
  z-index: 2;
}

#map-legend {
  position: absolute;
  top: 6vh;
  right: 10px;
  z-index: 1000;
  background: white;
  height: fit-content;
  width: fit-content;
  max-height: none;
  /* or adjust if needed */
  display: none;
  background-color: rgba(0, 0, 0, 0.6) !important;
  color: white;
}

.legend-block {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 14px;
}

.color-box {
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border: 1px solid #ccc;
}

.gradient-box {
  width: 20px;
  height: 100px;
  background: linear-gradient(to top, darkgreen, lightgreen);
  margin-right: 8px;
  border: 1px solid #ccc;
}

.gradient-box-blue {
  background: linear-gradient(to top, darkblue, lightblue);
}

.legend-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100px;
  font-size: 13px;
}

#add-tree-panel {
  overflow-y: auto !important;
}

/* new start */
/* Floating UI primitives */
.ui-btn,
.ui-btn-wrap {
  position: absolute;
  z-index: 2400;
  /* above map + most panels; adjust if needed */
  pointer-events: auto;
  /* clickable even if inside a non-interactive overlay */
}

.add-tree-btn {
  top: 48vh;
  right: 10px;
}

.layers-btn {
  top: 100px;
  left: 10px;
}

.table-btn {
  top: 160px;
  left: 10px;
}

.poi-btn {
  top: 50px;
  left: 10px;
}

#poi-toggle-btn { background:#1b1b1b; border:1px solid #333; }
#poi-toggle-btn.active { border-color:#2ecc71; }
#poi-toggle-icon { line-height:1; }


/* Icon button – keep same style you already use */
.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #1b1b1b;
  color: #fff;
  border: 1px solid #333;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.icon-btn:hover,
.icon-btn:focus {
  background: #242424;
  color: #fff;
  border-color: #444;
}

/* Make dropdowns align nicely with absolute buttons */
.dropdown-menu-dark {
  /* prevent dropdown from going off-screen on small devices */
  max-height: 50vh;
  overflow-y: auto;
}

/* Dark offcanvas that fits your app */
.offcanvas-dark {
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;
  width: 340px;
  /* adjust 300–380px to taste */
  z-index: 3000;
  /* above map/panels */
}

.offcanvas-dark .btn-close {
  filter: invert(1);
  /* white close icon */
}

.offcanvas-dark .offcanvas-body {
  overflow-y: auto;
  max-height: calc(100vh - 56px);
  /* header height approx */
}

/* Optional: keep inputs matching your theme inside offcanvas */
.offcanvas-dark input[type="checkbox"] {
  transform: translateY(1px);
}


.pick-btn { padding: 2px 8px; line-height: 1.1; border-radius: 6px; }
.map-picking { cursor: crosshair !important; }

.cesium-infoBox {
    top: 40% !important;
    /* move vertically to middle */
    right: 10px !important;
    /* a little away from the edge */
    left: auto !important;
    transform: translateY(-50%);
    /* perfect vertical center */
    max-width: 90vw;
    /* shrink a bit on mobile */
    z-index: 9999 !important;
    /* above toolbars */
  }

  .cesium-infoBox-iframe {
    height: auto !important;
    /* allow flexible height */
  }


@media screen and (max-width: 426px) {
  .navbar .navbar-brand {
    font-size: 14px;
    text-align: center;
  }

  .export-container {
    position: relative;
  }

  .my-location-btn {
    bottom: 200px;
    right: 8px !important;
    width: 30px;
    height: 30px;
    font-size: 18px;
  }

  .card {
    width: 90% !important;
    height: fit-content;
    left: 5% !important;
    right: auto !important;
    top: auto !important;
    bottom: 10px !important;
  }

  /* Fix dropdowns overflow */
  .dropdown-menu {
    font-size: 12px;
    min-width: auto;
  }

  .dropdown-draw-tools {
    padding: 2px;
  }

  #add-tree-panel {
    width: 90% !important;
    left: 5% !important;
    right: auto !important;
    top: auto !important;
    bottom: 0 !important;
    height: 40vh;
    max-height: 30vh;
    overflow-y: auto;
    padding-bottom: 60px;
    /* optional: space for button if fixed */
  }

  #query-container-id {
    height: 40vh;
    max-height: 50vh;
  }

  #query-container-id table {
    font-size: 10px;
    min-width: 600px;
    /* a bit smaller than desktop */
  }

  /* #query-container-id .close-btn {
    right: -155px;
  } */

  #map-legend {
    position: absolute;
    top: 6vh;
    right: 10px;
  }

  #map-legend h6 {
    font-size: small;
  }

  .legend-block span {
    font-size: x-small;
  }

  .legend-labels span {
    font-size: x-small;
  }

  .gradient-box {
    width: 16px;
  }

  .legend-block .color-box {
    width: 12px;
    height: 12px;
  }

  /* new start */
  /* Compact, clean icon-only buttons for dark UI */
  .icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #1b1b1b;
    color: #fff;
    border: 1px solid #333;
  }

  .icon-btn:hover,
  .icon-btn:focus {
    background: #242424;
    color: #fff;
    border-color: #444;
  }

  .toolbar-container .btn-group .dropdown-toggle::after {
    /* Keep the caret small and subtle, or comment this out to keep default */
    margin-left: .35rem;
  }

  .dropdown-menu-dark .dropdown-item i {
    width: 1.1rem;
    /* align icon columns nicely */
    text-align: center;
  }

  .icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

}


/* Optional nice scrollbar (matches your existing style) */
#query-container-id .table-scroll::-webkit-scrollbar {
  height: 8px;
  /* horizontal scrollbar thickness */
}

#query-container-id .table-scroll::-webkit-scrollbar-track {
  background: #1a1a1a;
}

#query-container-id .table-scroll::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
  border: 1px solid #222;
}

#query-container-id .table-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #888;
}