/* =========================================================
   GLOBAL VARIABLES AND PAGE LAYOUT
   ========================================================= */

:root {
  --leftPanelWidth: 400px;
}

html,
body {
  height: 100%;
  margin: 0;
}

#app {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.ui.button {
  position: relative;
  margin: 0 auto;
  padding: 10px 15px;
  opacity: 1 !important;
}

.ui.button:hover {
  background-color: #0056b3;
}

input[type="file"] {
  display: none;
}


/* =========================================================
   MAP
   ========================================================= */

#map {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-width: 0;
  height: 100%;
  transform: translateX(0);
  transition: transform 0.35s ease-in-out;
}

/* Moves the map left when the left panel is closed. */
#map.shifted {
  transform: translateX(-400px);
}

img.leaflet-tile {
  image-rendering: pixelated;
}

/* =========================================================
   RASTER LEGEND
   ========================================================= */
#legend {
  position: absolute;
  right: calc(15px + var(--leftPanelWidth));
  bottom: 30px;
  min-width: 150px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
}

#legend-ramp-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#legend-ramp {
  flex: 1;
  height: 12px;
  margin: 0 6px;
  border: 1px solid #999;
  border-radius: 3px;
}

.legend-min,
.legend-max {
  font-size: 12px;
  color: #333;
}

.font-awesome-toolbar {
  position: absolute;
  top: 12px;
  left: 0;
  transform: scale(1.3);
  opacity: 0.7;
}


/* =========================================================
   MAP SEARCH
   ========================================================= */

#sidePanelToggle,
#search {
  left: calc(var(--leftPanelWidth) + 10px);
  transition: left 0.35s ease-in-out;
}

#search {
  position: fixed;
  top: 14px;
  z-index: 500;
  width: 20vw;
}

#search .text {
  max-height: 100%;
  overflow: hidden;
}

#search .selection {
  width: 100%;
  height: 5px;
  padding-left: 10px;
  border: 2px solid #bbb;
}

#search .dropdown.icon {
  display: none;
}

#search i {
  position: absolute;
  top: 12px;
  right: 10px;
  font-size: 14px;
  opacity: 0.4;
}


/* =========================================================
   LEAFLET CONTROLS
   These classes are generated dynamically by Leaflet.
   ========================================================= */

.leaflet-top.leaflet-left .leaflet-control:first-child {
  margin-top: 40px;
  background-color: transparent;
  border-color: transparent;
}

.leaflet-control-layers-base {
  display: none;
  align-items: center;
  justify-content: center;
  font-family: Bahnschrift, sans-serif !important;
}

.leaflet-control-layers-base>label>span {
  padding: 5px;
}

.leaflet-left .leaflet-control-layers-base label>span:has(.checked) {
  color: red;
  font-weight: 600;
}

.leaflet-left .leaflet-control-layers-base>label:not(:first-child) {
  border-left: 1px solid #ccc;
}

.leaflet-control-layers-base input[type="radio"] {
  display: none;
}

.leaflet-top.leaflet-right {
  position: absolute !important;
  top: 100px;
  right: unset !important;
  left: 10px !important;
  z-index: 999;
  width: fit-content;
  margin: 0;
  padding: 0;
}

.leaflet-top.leaflet-right>.leaflet-control {
  display: none;
  float: none !important;
  margin-right: auto !important;
  margin-left: 0 !important;
  background-color: rgb(223, 223, 15);
}

.leaflet-right .leaflet-control-layers-base {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  background-color: rgb(180, 80, 15);
  transition: 0.2s;
}

.leaflet-right .leaflet-control-layers-base label {
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
}

.leaflet-right .leaflet-control-layers-base label:hover {
  text-shadow: 1px 1px 0 #aaa;
}

.leaflet-right .leaflet-control-layers-base label:has(span.checked) {
  background-color: #ccc;
  font-weight: normal !important;
}

.leaflet-right .leaflet-control-layers-separator {
  display: none;
}

div.leaflet-control-layers-overlays {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: 0.3s;
}

div.leaflet-control-layers-overlays label {
  font-size: 14px;
  cursor: pointer;
}





/* =========================================================
   LEFT PANEL
   ========================================================= */

#sidePanelLeft {
  position: relative;
  width: 400px;
  min-width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: rgb(30, 30, 30);
  border: 2px solid #000;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  /* Firefox */
  scrollbar-color: #666 #1e1e1e;
  transform: translateX(0);
  transition: transform 0.35s ease-in-out;
}

/* Chrome / Edge / Safari */
#sidePanelLeft::-webkit-scrollbar {
  width: 10px;
}

#sidePanelLeft::-webkit-scrollbar-track {
  background: #1e1e1e;
}

#sidePanelLeft::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 5px;
}

#sidePanelLeft::-webkit-scrollbar-thumb:hover {
  background: #888;
}

#sidePanelLeft.closed {
  transform: translateX(-400px);
}

#sidePanelToggle {
  position: absolute;
  top: 50%;
  left: calc(var(--leftPanelWidth) + 5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 50px;
  color: white;
  background: rgb(30, 30, 30);
  border-radius: 10%;
  cursor: pointer;
  user-select: none;
  transform: translateY(-50%);
  transition: left 0.35s ease-in-out;
}

#sidePanelToggle .arrow {
  font-size: 20px;
  line-height: 0;
  transition: transform 0.35s ease-in-out;
}

.panel-header {
  width: 100%;
  text-align: center;
  background-color: rgb(30, 30, 30);
  border-bottom: 1px solid rgb(30, 30, 30);
}

.panel-header img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  margin-top: 25px;
  background-color: #ccc;
}

.panel-title {
  padding: 12px;
  color: #e0e0e0;
  background-color: rgb(30, 30, 30);
  text-align: center;
}

.panel-title h2 {
  margin: 0;
  color: #e0e0e0;
  font-size: 20px;
  font-weight: 600;
}


/* =========================================================
   LEFT PANEL: VISUALIZER
   ========================================================= */

.visualizer-container {
  position: relative;
  margin: 0 10px 10px;
  padding: 15px;
  background-color: #e0e0e0;
  border: 1px solid #000;
  border-radius: 6px;
}

.visualizer-container h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #222;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}

/* Semi-transparent cover indicates that these options are disabled. */
.visualizer-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(230, 230, 230, 0.5);
}

.checkbox-group {
  position: relative;
  color: #000;
  font-size: 12px;
  pointer-events: none;
}

.checkbox-group p {
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: bold;
  opacity: 0.9;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  transform: scale(1.1);
}

.year-group {
  display: grid;
  grid-template-columns: repeat(5, 60px);
  gap: 8px 10px;
  margin-top: 5px;
}

.year-group label {
  margin-bottom: 0;
}


/* =========================================================
   LEFT PANEL: PLATFORM SELECTOR
   ========================================================= */

.platform-container {
  margin: 0 10px 10px;
  padding: 15px;
  background-color: #fff; 
  border: 1px solid #000;
  border-radius: 6px;
}

.platform-container h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #222;
  font-size: 16px;
  font-weight: 600;
}

.platform-container select {
  width: 100%;
  padding: 8px;
  background-color: #fff;
  border: 1px solid #999;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
}


/* =========================================================
   LEFT PANEL: ACTION BUTTONS
   ========================================================= */

.icon-box-row {
  display: flex;
  gap: 10px;
  margin-right: 10px;
  margin-left: 10px;
}

.icon-button-box {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 44px;
  box-sizing: border-box;
  background-color: #fff;
  border: 1px solid #999;
  border-radius: 14px;
}

.icon-square-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

.icon-square-button i {
  margin: 0 !important;
  font-size: 20px;
}


/* =========================================================
   LEFT PANEL: VISITOR COUNTER
   ========================================================= */

.visitor-title {
  color: #e0e0e0;
  font-size: small;
  font-weight: lighter;
  letter-spacing: 1.5px;
  text-align: center;
}

.flag-counter {
    display: flex;
    justify-content: center;
    width: 100%;
}

.flag-counter img {
    display: block;
    width: 100%;
    height: auto;
    clip-path: inset(0 0 25px 0);
}


/* =========================================================
   RIGHT PANEL
   ========================================================= */

#sidePanel {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 9000;
  width: 400px;
  min-width: 400px;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  background-color: rgb(30, 30, 30);
  border-left: 2px solid #000;

  /* Hide scrollbar while preserving scrolling. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#sidePanel::-webkit-scrollbar {
  display: none;
}

.right-panel-footer {
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 10px 0;
}

.right-panel-footer img {
  width: 80%;
  max-width: 400px;
  height: auto;
}

/* 1. Select map layer*/
#labelDropdown {
    position: relative;
    left: 10px;
    display: block;
    padding-top: 10px;
    margin-bottom: 5px;
    font-weight: bold;
    color: rgb(230, 230, 230);
}

/* 1. Select map layer*/
#layerDropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #ffffff;
    border: 1px solid #000000;
    border-radius: 4px;
    color: #000;
    padding: 4px 30px 4px 4px;
    width: 200px;
    position: relative;
    left: 10px;
    z-index: 1000;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg fill='black' height='14' viewBox='0 0 24 24' width='14' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

/* 1b. Optional overlay toggles below layer dropdown */
.overlay-toggle {
  margin-top: 10px;
  margin-left: 10px;
}

.overlay-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  color: rgb(230, 230, 230);
}

.overlay-toggle-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Center text inside the state hover popup */
.state-hover-popup .leaflet-popup-content {
  text-align: center !important;
  margin: 6px 10px !important; /* optional: keeps padding looking nice */
}

/* Optional: also center the popup container itself */
.state-hover-popup .leaflet-popup-content-wrapper {
  text-align: center !important;
}


#opacityControl {
  margin-top: 10px;
  margin-left: 10px; 
    color: rgb(230, 230, 230);
 
}

.opacity-slider {
  width: 90%;
}

/* Slider track */
.opacity-slider .v-slider-track__background {
    background-color: rgb(180, 180, 180) !important;
    opacity: 0.4;
}

/* Filled portion of the track */
.opacity-slider .v-slider-track__fill {
    background-color: rgb(180, 180, 180) !important;
}

/* Slider thumb */
.opacity-slider .v-slider-thumb {
    color: rgb(180, 180, 180) !important;
}

/* Thumb label (100, etc.) */
.opacity-slider .v-slider-thumb__label {
    background-color: rgb(180, 180, 180) !important;
    color: #000 !important;
}

.v-input__details {
  display: none !important; /* hide helper text */
  
} 

/* 2. Desired condition variable*/
#labelConditionDropdown {
    position: relative;
    left: 10px;
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: bold;
    color: rgb(230, 230, 230);
}

/* 2. Desired condition variable*/
#conditionLayerDropdown {
    appearance: none;
    background-color: #ffffff;
    border: 1px solid #000000;
    border-radius: 4px;
    color: #000;
    padding: 4px 30px 4px 4px;
    width: 200px;
    position: relative;
    left: 10px;
    z-index: 1000;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg fill='black' height='14' viewBox='0 0 24 24' width='14' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    margin-bottom: 10px;
}

/* 3. Desired condition of*/
#labelThreshold {
    position: relative;
    left: 10px;
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: rgb(230, 230, 230);
}

/* 3. Desired condition of*/
#thresholdInput {
    position: relative;
    left: 10px;
    top: 0px;
    display: block;
    margin-bottom: 15px;
    background-color: #ffffff;
    border: 1px solid #000000;
    border-radius: 4px;
    color: #000;
    padding: 4px;
    width: 100px;
}

/* 3. Desired condition of*/
#thresholdGroup {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

/* 3. Desired condition of*/
#unitText {
    padding-left: 10px;
    padding-bottom: 15px;
    font-weight: bold;
    color: rgb(180, 180, 180);
}

/* 4. Select forest operation*/
#labelOperation {
    position: relative;
    left: 10px;
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: rgb(230, 230, 230);
}

/* 4. Select forest operation*/
#operationDropdown {
    position: relative;
    left: 10px;
    width: 140px;
    padding: 4px 30px 4px 4px;
    border: 1px solid #000;
    border-radius: 4px;
    background-color: #fff;
    color: #000;
    margin-bottom: 10px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg fill='black' height='14' viewBox='0 0 24 24' width='14' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

/* 5. Estimated operation value*/
#labelOperationValue {
    position: relative;
    left: 10px;
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: rgb(230, 230, 230);
    margin-top: 0px;
}

/* 5. Estimated operation value*/
#operationValueGroup {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;

}

/* 5. Estimated operation value*/
#operationValueInput {
    position: relative;
    left: 10px;
    width: 100px;
    padding: 4px;
    border: 1px solid #000;
    background-color: #ffffff;
    border-radius: 4px;
}

/* 5. Estimated operation value*/
#operationValueUnit {
    position: relative;
    padding-left: 10px;
    font-weight: bold;
    color: rgb(180, 180, 180);
}

/* 6. Revenue*/
#labelPerRemoval {
    position: relative;
    left: 10px;
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: rgb(230, 230, 230);
}

/* 6. Revenue*/
#perRemovalGroup {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;

}

/* 6. Revenue*/
#perRemovalInput {
    position: relative;
    left: 10px;
    width: 100px;
    padding: 4px;
    border: 1px solid #000;
    background-color: #ffffff;
    border-radius: 4px;
}

/* 6. Revenue*/
#perRemovalUnit {
    position: relative;
    left: 10px;
    font-weight: bold;
    color: rgb(180, 180, 180);
}

/* 7. Revenue*/
#labelWoodSale {
    position: relative;
    left: 10px;
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: rgb(230, 230, 230);
}

/* 7. Revenue*/
#woodSaleGroup {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 7. Revenue*/
#woodSaleInput {
    position: relative;
    left: 10px;
    width: 100px;
    padding: 4px;
    border: 1px solid #000;
    background-color: #ffffff;
    border-radius: 4px;
}

/* 7. Revenue*/
#woodSaleUnit {
    position: relative;
    left: 10px;
    font-weight: bold;
    color: rgb(180, 180, 180);
}

/* 7. Revenue*/
.disabled-input {
    background-color: #e0e0e0 !important;
    cursor: not-allowed;
    color: rgb(180, 180, 180);
}

#buttonGroup {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}


#exportPdfButton {
    padding: 10px 20px;
    width: 200px;
    background-color: #B4500F;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

#exportPdfButton:hover {
    background-color: #FF7115;
}

#optionalMapsButton {
    padding: 10px 20px;
    width: 200px;
    background-color: #B4500F; /* same as Generate Report */
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

#optionalMapsButton:hover {
    background-color: #FF7115;
}

#optionalMapsButton:disabled,
#optionalMapsButton:disabled:hover {
    background-color: #777;
    opacity: 0.6;
    cursor: not-allowed;
}

/* PDF export styling lives in pdf.css (loaded alongside pdf.js); #loadingOverlay2 has no equivalent there since it's ems.css-only. */

#loadingOverlay2 {
    display: none;
    /* hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 20000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    font-family: Arial, sans-serif;
    color: #333;
    font-size: 18px;
    text-align: center;
}

#loadingOverlay2.show {
    display: flex;
}

#loadingOverlay2 img {
    width: 80px;
    height: auto;
    margin-bottom: 20px;
}

/* ----------------------------------------------------------------------------------------------
/* VERTICAL SCREEN MODE */
/*@media screen and (orientation: portrait) and (max-width: 10000px) {

  :root {
    --leftPanelWidth: 100vw !important;
  }

  #app {
    display: flex;
    flex-direction: column;
    height: auto;
    width: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
  }

  #sidePanel {
    height: 100vh !important;
    flex: 0 0 100vh !important;
    width: 100%;
    scroll-snap-align: start;
    overflow-y: auto;
    position: relative !important;
    overflow-y: auto !important;
    order: 1;
    border-bottom: 1vh solid #ffffff;
  }

  .right-panel-footer img {
    content: url("figures/footer3.png");
  }

  #map {
    flex: 0 0 100vh;
    height: 100vh !important;
    width: 100%;
    position: relative;
    order: 2;
    border-bottom: 1vh solid #ffffff;

  }

  #map .mobile-search {
    position: absolute !important;
    top: 15px;
    left: 12px;
    transform: none !important;

    width: 55vw !important;
    max-width: 260px !important;
    height: auto;

    z-index: 6000 !important;
  }

  #map {
    position: relative !important;
  }

  #sidePanelLeft {
    flex: 0 0 100vh;
    max-height: 100vh;
    width: 100%;
    padding-top: 7px;
    border-bottom: 2px solid #000;
    box-sizing: border-box;
    order: 3;
  }

  .panel-title {
    padding: px;
    grid-column: 1 / 2;
    grid-row: 2;
  }

  .panel-title h2 {
    font-size: 4vw;
    color: #e0e0e0;
  }


  .platform-container h3 {
    font-size: 3vw;
    color: #222;
  }

  .platform-container select {
    width: 100%;
    padding: 0.5vh;
    font-size: 1.5vh;
    border: 1px solid #999;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
  }

  .visualizer-container h3 {
    font-size: 1.5vh;
  }

  .visualizer-container::after {
    background: rgba(230, 230, 230, 0.5);
  }

  .checkbox-group {
    font-size: 1.5vh;
  }

  .checkbox-group label {
    display: flex;
    align-items: center;
    margin-bottom: 1vh;
    cursor: pointer;
  }

  .checkbox-group p {
    font-size: 1.5vh;
  }
}*/