/* --- 1. GLOBAL SETTINGS & FONTS --- */
:root {
  --header-height: 80px; /* Increased from 60px to 100px for a more spacious navbar */
  --color-summer: #AE3B4A;      
  --color-x-pattern: #656F78; 
  --color-gold: #ecbb0af3;    
  --color-grey: #929497;
  --color-black: #ffffff;
  
  --font-title: "Bebas Neue", "Noto Sans TC", sans-serif;
  --font-body: "Noto Sans TC", sans-serif;
  --panel-width-left: 300px;
  --panel-width-right: 350px;
}

html, body {
  padding: 0; margin: 0;
  height: 100%; width: 100%;
  font-family: var(--font-body);
  overflow: hidden;
}

/* Update the Navbar */
.navbar {
  background-color: var(--color-summer);
  border-bottom: 3px solid var(--color-black);
  z-index: 2000;
  
  /* FORCE VERTICAL ALIGNMENT */
  display: flex !important;
  align-items: center !important; 
  justify-content: flex-start !important; /* Starts everything from the left */
  
  height: var(--header-height); 
  padding: 0 15px !important;
  overflow: hidden;
}

/* Update the Title Text */
.navbar-brand-text {
  font-family: var(--font-title);
  font-size: clamp(20px, 3vw, 40px);
  font-weight: bold; 
  color: var(--color-black);
  white-space: nowrap;
  
  /* RESET MARGINS AND LINE-HEIGHT */
  margin: 0 !important; 
  line-height: 1 !important; /* Forces the text box to be only as tall as the letters */
  display: inline-block;
  vertical-align: middle;
}

/* New class for the large Munsang logo at the start */
.featured-logo {
  height: 65px; /* Makes it significantly larger than the others */
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.featured-logo:hover {
  transform: scale(1.05);
}

/* The Logos at the end */
.partner-logo {
  height: 45px; /* Slightly smaller to ensure they fit */
  width: auto;
  display: block;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}


/* --- 3. MAP CONTAINER --- */
#viewDiv {
  position: absolute; top: var(--header-height); bottom: 0; left: 0; right: 0;
  padding: 0; margin: 0;
}

/* --- 4. LEFT SIDEBAR - LESS DENSE --- */
.sidebar-left {
  position: absolute;
  top: var(--header-height); left: 0;
  width: var(--panel-width-left);
  height: calc(100% - var(--header-height));
  
  /* 1. Base Color */
  background-color: var(--color-summer);
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0,0,0,0.3);
  transition: transform 0.3s ease-in-out;
  color: black;
  
  display: flex;
  flex-direction: column;
}

.panel-collapsed { transform: translateX(-100%); }


/* --- NEW: BOTTOM SLIDER BOX --- */
#panelBottom {
  /* Solid Background (Vacuum Zone style) */
  background-color: var(--color-summer);
  
  /* Borders & Spacing */
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  padding: 15px !important;
  margin: 15px;
  
  /* KEY FIX: This pushes the box to the very bottom */
  margin-top: auto; 
  
  position: relative;
  z-index: 2;
}

/* Left Toggle Button */
.menu-tab {
  position: absolute; top: 40vh; right: -25px; z-index: 1001;
}

.btn-toggle {
  background-color: var(--color-summer);
  
  
  color: var(--color-black);
  border: 1px solid rgba(255,255,255,0.1); border-left: none;
  width: 25px; height: 60px;
  border-radius: 0 5px 5px 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; box-shadow: 2px 0 5px rgba(0,0,0,0.2);
}

.btn-toggle:hover { background-color: #2c4655; color: var(--color-grey);; }

/* Section Titles */
.section-title {
  border-bottom: 2px solid var(--color-black);
  margin-bottom: 15px; padding-bottom: 5px;
}

.section-title h2 {
  font-family: var(--font-title); color: var(--color-black);
  font-size: 26px; margin: 0; font-weight: bold;
}

/* Layer List Styling */
.layer-list { padding: 5px; }
.layer-item {
  display: flex; align-items: center; margin-bottom: 10px;
  font-family: var(--font-body); font-size: 14px;
  color: black; cursor: pointer;
}
.layer-item input[type="checkbox"] {
  width: 18px; height: 18px; margin-right: 10px;
  accent-color: var(--color-black); cursor: pointer;
}
.layer-item label { cursor: pointer; }

/* --- 5. RIGHT SIDEBAR (black Background) --- */
.sidebar-right {
  position: absolute; top: var(--header-height); right: 0;
  width: var(--panel-width-right); height: calc(100% - var(--header-height));
  background-color: rgb(255, 255, 255); z-index: 1000;
  box-shadow: -2px 0 10px rgba(255, 255, 255, 0.1);
  transform: translateX(100%); transition: transform 0.3s ease-in-out;
  overflow: visible; display: flex; flex-direction: column;
  border-left: 5px solid #AE3B4A; 
}

.sidebar-right.open { transform: translateX(0); }

.panel-header-right {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid var(--color-summer);
  padding: 20px; flex-shrink: 0;
}

.info-title {
  font-family: var(--font-title); color: var(--color-summer);
  font-size: 28px; margin: 0; font-weight: bold; line-height: 1.1;
}

.close-icon {
  font-size: 24px; cursor: pointer; color: var(--color-grey);
}
.close-icon:hover { color: var(--color-summer); }

#sideInfoContent {
  padding: 20px; overflow-y: auto; flex-grow: 1; padding-top: 10px;
}
.info-content p { color: var(--color-summer); }

/* Right Toggle Button */
.menu-tab-right {
  position: absolute; top: 40vh; left: -25px; z-index: 1001;
}

.btn-toggle-right {
  background-color: rgb(255, 255, 255); color: var(--color-summer);
  border: 1px solid #ddd; border-right: none;
  width: 25px; height: 60px; border-radius: 5px 0 0 5px; 
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; box-shadow: -2px 0 5px rgba(0,0,0,0.1); 
}

.btn-toggle-right:hover { background-color: #f8f8f8; color: var(--color-grey); }

/* Scrollbar Styling for Dark Panel */
#panelScrollContent::-webkit-scrollbar { width: 8px; }
#panelScrollContent::-webkit-scrollbar-track { background: #2c4655; }
#panelScrollContent::-webkit-scrollbar-thumb { background: var(--color-black); border-radius: 4px; }

/* --- CUSTOM RANGE SLIDER (Rectangular Style) --- */
#opacitySlider {
  -webkit-appearance: none; /* Required to remove default styling */
  appearance: none;
  width: 100%;
  height: 20px; /* Reduced height for a cleaner look */
  background: transparent; /* Key Fix: Transparent here prevents the "double bar" glitch */
  outline: none;
  margin: 0;
  cursor: pointer;
}

/* --- CHROME / SAFARI / EDGE --- */

/* The Track (Gray Bar) */
#opacitySlider::-webkit-slider-runnable-track {
  width: 100%;
  height: 20px; /* Must match slider height */
  background: #d3d3d3; /* Gray background */
  border-radius: 0; /* Square edges */
  border: none;
}

/* The Handle (summer Square) */
#opacitySlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 20px; /* Match track height to fit perfectly */
  width: 20px;  /* Make it a square */
  background: var(--color-grey); 
  border-radius: 0; /* Square edges */
  border: none;
  margin-top: 0; /* Centers it perfectly */
}

/* --- FIREFOX --- */

/* The Track (Gray Bar) */
#opacitySlider::-moz-range-track {
  width: 100%;
  height: 20px;
  background: #d3d3d3;
  border-radius: 0;
  border: none;
}

/* The Handle (summer Square) */
#opacitySlider::-moz-range-thumb {
  height: 20px;
  width: 20px;
  background: var(--color-summer);
  border: none;
  border-radius: 0;
}

/* ---  BOTTOM TOGGLE --- */
#layerToggleContainer {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--color-summer);
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 15px rgb(255, 255, 255);
  display: flex; align-items: center;
  font-family: var(--font-body);
  font-weight: bold;
  color: var(--color-black);
  z-index: 1000;
}

/* --- FIX: Enable Scrolling for Layer List --- */
#panelScrollContent {
  flex-grow: 1;       /* 1. Forces this section to take up all remaining empty space */
  overflow-y: auto;   /* 2. Adds the scrollbar automatically when needed */
  min-height: 0;      /* 3. Prevents the container from breaking out of the screen */
}



