/* Style for the popup */
#popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 999;
    display: none;
    top: 50%;
    left: 50%;
    justify-content: center;
    align-items: center;
}
#popup1 {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  padding: 20px;
  border-radius: 20px;
  z-index: 999;

  justify-content: center;
  align-items: center;
}

.pdf-viewer {
  width: 90vw;
  height: 90vh;
  border-radius: 12px;
  background: #fff;
}

#popup2 {
  display: none;
  position: fixed;
  justify-content: center;
  align-items: center;
  top: 52.5%;
  left: 50%;
  width: 90%;
  height: 90vh;
  max-height: 800px;
  border-radius: 20px;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  padding: 20px;
  border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 999;
}
#popup3 {
  display: none;
  position: fixed;
  justify-content: center;
  align-items: center;
  top: 52.5%;
  left: 50%;
  width: 90%;
  max-width: 1600px;
  height: 90vh;
  max-height: 800px;
  border-radius: 20px;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  padding: 20px;
  border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 999;
}
#popup4 {
  display: none;
  position: fixed;
  justify-content: center;
  align-items: center;
  top: 52.5%;
  left: 50%;
  width: 90%;
  max-width: 1600px;
  height: 90vh;
  max-height: 800px;
  border-radius: 20px;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  padding: 20px;
  border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 999;
}
#popupStep {
  display: none;
  position: fixed;
  justify-content: center;
  align-items: center;
  top: 52.5%;
  left: 50%;
  width: 90%;
  max-width: 1600px;
  height: 90vh;
  max-height: 800px;
  border-radius: 20px;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  padding: 20px;
  border: 1px solid #ccc;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 999;
}
.top-bar {
  width: 100%;
  height: 50px;
  color: #fff;
  text-align: center;
  line-height: 50px;
  font-weight: bold;
  font-size: 20px;
}
.popup-content {
  height: 70vh;
  width: 900px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 4px;
  border: 2px solid #ccc;
  gap: 0.7em;
  overflow-y: scroll;
}
.content1 {
  height: 650px;
  display: flex;
  justify-content: left;
}
.content2 {
  height: 650px;
  display: flex;
  justify-content: right;
}
.content3 {
  height: 650px;
  display: flex;
  justify-content: left;
}
.content4 {
  height: 650px;
  display: flex;
  justify-content: right;
}
.content5 {
  height: 650px;
  display: flex;
  justify-content: left;
}
.content6 {
  height: 650px;
  display: flex;
  justify-content: right;
}
.imageStep {
  width: 600px;
  height: 100%;
}

/* Style to overlay the background when the popup is active */
#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}
#overlay1 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}
#overlay2 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}
#overlay3 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}
#overlay4 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}
#overlayStep {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}
.dl {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  top: 10px;
  right: 40px;
  cursor: pointer;
}
i {
  width: 20px;
  color: #fff;
}
/* Style for the close button */
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: rgb(0 0 0 / 57%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 5px;
}
.close-btn:hover {
    background: rgba(0,0,0,0.3);
}

.imgWrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.imgWrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;  /* keep aspect ratio */
    transform-origin: top left;
}

/* Hotspots inside map container */
.hotspot {
    position: absolute;
    /*background-color: rgba(128,128,128,0.5);*/
    /*border: 2px solid #333;*/
    cursor: pointer;
    z-index: 10;
    border-radius: 8px;
}

.hotspot.hidden {
    display: none;
}

.back-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    padding: 6px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.back-btn:hover {
    background-color: rgba(0,0,0,0.9);
}

.imgWrap1 {
  width: 90%;
  height: 80%;
  overflow-y: scroll;
}

.image {
  width: 90%;
  height: 90%;
}

/*details*/


/* Keep old modal styles */
.quarry-modal {
    display: none;
    position: absolute;
    top: 50%;  
    left: 50%; 
    transform: translate(-50%, -50%);
    z-index: 999;
    max-width: 95%;
    width: auto;
}

.quarry-modal-content {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.3);
    padding: 15px;
    position: relative;
    font-family: Arial, sans-serif;
    animation: popin 0.25s ease;
    max-height: 80vh; /* limit modal height */
    overflow: hidden;  /* hide overflowing content outside container */
}

.modal-values-container {
    max-height: 75vh;
    overflow-y: auto;
}

.modal-values-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.region-title {
    font-weight: bold;
    font-size: 12px;
    text-align: left;
    padding: 5px;
    background: #ddd;
    margin-top: 10px;
}

/* Close button in modal details */
.quarry-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 22px;
    cursor: pointer;
    color: #000; /* black color */
    background: transparent; /* no background */
    border: none; /* no border */
}


@keyframes popin {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Quarry details table */
.modal-header-row,
.modal-values-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(130px, 1fr));
    gap: 5px;
}

.modal-header-cell,
.modal-value-cell {
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-size: 11px;
}

.modal-header-cell {
    font-weight: bold;
    background-color: #f0f0f0;
    font-size: 10px;
}

.back-btn, .details-btn {
    z-index: 1000;
    position: absolute;
    top:  1vh;
    left: 25vw;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
}
.back-btn:hover, .details-btn:hover {
    background-color: #0056b3;
}

.popup-content-two-column {
    display: flex;
    width: 95vw;
    height: 85vh;
    gap: 20px;
}

.responsive-map {
    transition: transform 0.5s ease; /* smooth zoom */
    transform-origin: top left; /* keep scaling from top-left corner */
}


/* Left: map */
.popup-left {
    flex: 0 0 31%;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}

/* Right: quarry details */
.popup-right {
    flex: 1 1 40%;
    display: block; /* always show */
    background: #f2f2f2; /* light gray */
    border-radius: 10px;
    padding: 10px;
    overflow-x: auto;  
    overflow-y: auto;  
    max-width: 100%;
}

.modal-table-wrapper {
    min-width: 1100px;
}

#quarryMarkers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Number markers */
#zoomImage {
    width: 100%;
    height: auto; /* keeps hotspot alignment correct */
    display: block;
}

#mapScroll {
    width: 100%;
    height: 100%;
    overflow: auto; /* allow scrolling */
    display: flex; /* center horizontally */
    justify-content: center; /* center mapContainer */
    align-items: flex-start; /* keep top aligned */
    position: relative;
}

#mapContainer {
    position: relative;
    width: 100%; /* your desired width */
    height: auto;
    transform: scale(1);
    transform-origin: top left; /* keep scrollable zoom */
    transition: transform 0.25s ease;
    user-select: none;
    cursor: grab;
}

#popupLeft {
    position: relative;
}

.zoom-controls {
    position: fixed; /* 🔥 change from absolute to fixed */
    top: 3vh;
    left: 37.5vw;
    z-index: 9999; /* keep above map */
    gap: 8px;
    display: none;
}

.zoom-controls button {
    padding: 6px 12px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    background: #007bff;
    color: white;
    cursor: pointer;
    display: none;
}

.zoom-controls button:hover {
    background: #0056b3;
}


.marker-number {
    position: absolute;
    width: 9px;
    height: 9px;
    /*background: red;*/
    /*color: white;*/
    border-radius: 50%;
    font-size: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;

    /* ❗ prevents size change on zoom */
    transform: translate(-50%, -50%) scale(1);
}

@media (max-width: 768px) {

  html, body {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden;
  }

  body {
    position: relative;
  }

}

@media (max-width: 768px) {

  .wrapper,
  .content {
    height: auto !important;
    min-height: unset !important;
  }

  .content {
    flex-direction: column;
  }

  .leftPanel,
  .rightPanel {
    width: 100%;
    height: auto !important;
  }

}

@media (max-width: 768px) {

  #popup,
  #popup1,
  #popup2,
  #popup3,
  #popup4,
  #popupStep {
    inset: 0;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    height: 100%;
    max-height: none;
    padding: 10px;
  }

}

@media (max-width: 768px) {

  .popup-content,
  .popup-content-two-column {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    flex-direction: column;
  }

}


@media (max-width: 768px) {

  .popup-left,
  .popup-right {
    flex: none;
    width: 100%;
    max-height: none;
  }

  .modal-table-wrapper {
    min-width: unset;
  }

}

@media (max-width: 768px) {
  #mapContainer {
    height: auto;
    min-height: 100%;
  }
}

@media (max-width: 768px) {

  img {
    max-width: 100%;
    height: auto;
  }

  .image,
  .imageStep {
    width: 100%;
    height: auto;
  }

}
