body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Calibri, sans-serif;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 0 0 0 20px;
  color: white;
  height: 40px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 5px 0;
}

.logo {
  width: 97px;
  height: 30px;
}
.image {
  width: 100%;
  height: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 5px;
  padding: 5px;
  border: 1px solid #ccc;
  height: 20px;
}

.search-box input {
  border: none;
  outline: none;
  padding: 5px;
  min-width: 200px;
}

.search-box button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #2c7a7b;
}
.header-right {
  display: flex;
  align-items: center;
  background: #2c7a7b;
  padding: 0 20px 0 0;
}
.header-right button {
  position: relative; /* for the dot */

  background: transparent;
  border: none;
  margin-left: 1px;
  padding: 10px;
  cursor: pointer;
  font-size: 16px;
  color: #2c7a7b;
  width: 40px;
  height: 40px;
}
/* Active button dot */
.header-right button.active::after {
  content: "•";
  position: absolute;
  bottom: -6px; /* dot position */
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 20px;
}

.map-container {
  height: calc(100% - 40px);
  width: 100%;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}
/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: 40px;
  right: -350px;
  width: 350px;
  height: 100%;
  background: #fff;
  box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.2);
  transition: right 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  right: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 15px;
  border-bottom: 1px solid #ccc;
  color: #000;
  font-weight: bold;
}

.sidebar-header .close-btn {
  background: transparent;
  border: none;
  color: #000;
  font-size: 20px;
  cursor: pointer;
}

.sidebar-body {
  padding: 15px;
  flex: 1;
  overflow-y: auto;
}
/* card */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.card {
  /* background: #f9f9f9; */
  /* border: 1px solid #ddd; */
  /* border-radius: 8px; */
  text-align: center;
  /* padding: 10px; */
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
}

/* .card:hover {
  transform: translateY(-5px);
} */

.card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 6px;
}

.card p {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

/* tree */
.tree {
  list-style-type: none; /* remove bullets */
  padding-left: 0;
  color: #7d7d7d;
  margin: 0;
}

.tree li {
  /* padding-left: 10px; */
  margin: 2px 0;
  line-height: 22px;
}
/* .tree li:hover {
  background-color: #ccc;
} */

/* .tree .toggle {
  cursor: pointer;
  margin-right: 6px;
  font-weight: bold;
  color: #2c7a7b;
} */

.tree .toggle {
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #2c7a7b;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  margin-right: 6px;
  transition: background 0.2s ease;
}
.tree .nested {
  display: none;
  padding-left: 20px;
  list-style-type: none;
}

.tree .nested.active {
  display: block;
}

.tree label {
  display: flex;
  align-items: center;
  gap: 6px; /* spacing between checkbox and text */
  cursor: pointer;
  list-style-type: none;
}

.tree .nested.active {
  display: block;
}

.tree label {
  display: flex;
  align-items: center;
  cursor: pointer;
}
/* Query Description */
.query-description {
  padding: 10px 0px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  border-bottom: 1px solid #eee;
  margin-bottom: 10px;
}

/* Query List Sidebar */
.query-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.query-list li {
  display: flex;
  justify-content: space-between; /* left text, right arrow */
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
}

.query-list li:hover {
  background-color: #f0f0f0;
}

.query-item {
  font-size: 14px;
  color: #333;
}

.arrow {
  font-size: 16px;
  color: #2c7a7b;
}
/* plot */
.plot-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.plot-section {
  border: 1px solid #7d7d9c;
  border-radius: 6px;
  padding: 10px;
  position: relative;
  color: #919191;
}

.plot-title {
  font-weight: bold;
  color: #2d7b7b;
  margin-bottom: 8px;
  border: 1px solid #7d7d9c;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  position: absolute;
  top: -11px;
  background: white;
  font-size: 11px;
}

.plot-input {
  display: flex;
  flex-direction: column;
  margin: 6px 0;
}

.plot-input label {
  font-size: 13px;
  margin-bottom: 2px;
  color: #333;
}

.plot-input select {
  padding: 5px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 13px;
}

/* ward */
.selected-label {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #333;
}
html,body{height:100%;margin:0;font-family:Segoe UI,Arial;}
/* HEADER */
.topbar{
  height:56px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 14px;
  background:#fff;
  border-bottom:1px solid #ddd;
}
.logo{font-weight:700;color:#2f8f8b;font-size:18px;}
.right-header{
  display:flex;
  align-items:center;
  gap:18px;
  background:#2f8f8b;
  color:#fff;
  height:100%;
  padding:0 70px;
  position: relative;
}
.right-header i{
  cursor:pointer;
  opacity:.6;
  font-size: 20px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.right-header i:hover{
  opacity: 1;
  transform: scale(1.15);
}
.right-header i.active{
  opacity: 1;
  transform: scale(1.2);
}

/* Open panel button (hidden by default) */
#openPanelBtn {
  display: none;
  margin-left: 10px;
  font-size: 20px;
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
#openPanelBtn:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* LAYOUT */
.layout{display:flex;height:calc(100% - 56px);}
#map{flex:1;}

/* PANEL */
.info-panel{
  width:360px;
  border-left:1px solid #ddd;
  background:#fff;
  overflow:auto;
  display: flex;
  flex-direction: column;
}
/* Panel header with close button */
.panel-header{
  display:flex;
  justify-content:flex-end;
  padding: 6px 14px;
  border-bottom:1px solid #ddd;
  flex-shrink: 0;
}
#closePanelBtn {
  background:none; 
  border:none; 
  font-size: 22px; 
  cursor:pointer; 
  color:#555;
  line-height: 1;
  padding: 0;
  transition: color 0.3s ease;
}
#closePanelBtn:hover {
  color: #2f8f8b;
}

/* Panel content fills remaining space and scrolls */
.panel-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
}
.panel-content h4{margin-top:0}

/* LAYERS */
.layer-list{list-style:none;padding-left:0;}
.layer-list ul{list-style:none;padding-left:16px;}
.layer-list li{margin-bottom:6px; display: flex; align-items: center; gap: 6px;}
.layer-list li label {
  flex-grow: 1;
  cursor: pointer;
}
.layer-info-icon {
  color: #2f8f8b;
  cursor:pointer;
  font-size: 16px;
  transition: color 0.3s ease;
}
.layer-info-icon:hover {
  color: #145a55;
}

/* BASEMAP */
.basemap-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
}
.basemap-item{
  border:1px solid #ccc;
  cursor:pointer;
  text-align:center;
  padding:6px;
  border-radius:6px;
}
.basemap-item img{
  width:100%;
  height:80px;
  object-fit:cover;
  border-radius:4px;
}
.basemap-item:hover{border-color:#2f8f8b}

/* Layer Info Modal */
#layerInfoModal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 1px solid #ddd;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 20px;
  max-width: 320px;
  z-index: 10000;
  display: none;
  border-radius: 8px;
}
#layerInfoModal > div.close-btn-container {
  text-align: right;
  margin-bottom: 10px;
}
#closeLayerInfo {
  border:none; 
  background:none; 
  font-size:18px; 
  cursor:pointer; 
  color:#555;
  transition: color 0.3s ease;
  line-height: 1;
  padding: 0;
}
#closeLayerInfo:hover {
  color: #2f8f8b;
}

/* Modal background overlay */
#layerInfoOverlay {
  display:none;
  position:fixed; top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,0.3);
  z-index: 9999;
}
.opacity-slider{
  width:70px;
  margin-left:5px;
  vertical-align:middle;
}
.layer-tree{
font-family:Arial;
font-size:14px;
}

.tree-title{
cursor:pointer;
padding:6px;
font-weight:600;
border-bottom:1px solid #ccc;
}

.tree-title:hover{
background:#e6f0ff;
}

.tree-content{
padding-left:18px;
display:none;
}

.tree-title.open + .tree-content{
display:block;
}

.toggle{
font-weight:bold;
margin-right:6px;
}

.tree-content label{
display:block;
margin:4px 0;
cursor:pointer;
}