html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #111;
  font-family: 'Segoe UI', sans-serif;
}

#topbar {
  height: 40px;
  background: #222;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 2px solid #FFF;
}

#panorama-container {
  height: calc(100vh - 63px);
  overflow: hidden;
}

#scroll-wrapper {
  height: 100%;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

#panorama-scroll {
  position: relative;
}

#scroll-wrapper::-webkit-scrollbar {
  display: none;
}

#panorama-scroll, #bearing-scroll {
  display: flex;
  height: 100%;
}

body, #topbar, .segment, .bearing-label, .dot-loader, .image-wrapper {
  box-sizing: border-box;
}

.segment, .bearing-label {
  position: relative;
  flex-shrink: 0;
  height: 100%;
  margin: 0; /* Ensure no margin between segments */
}

.segment img {
  width: 100%; /* Ensure the image fits the full width of the container */
  height: 100%; /* Ensure the image fits the full height of the container */
  object-fit: cover; /* Make sure the entire image fits within the height without cutting off */
  display: block; /* Remove any space below the image */
  position: absolute;
  top: 0;
  left: 0;
  /* opacity: 0; */
  transition: opacity 0.5s ease;
  border: none; /* Remove any border that may be added */
}

.dot-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 6px;
  z-index: 9;
}

.dot-loader span {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: blink 1s infinite ease-in-out;
}

.dot-loader span:nth-child(2) {
  animation-delay: 0.2s;
}

.dot-loader span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

#bearing {
  height: 30px;
  background: #161515;
  color: #fff;
  font-size: 10px;
  overflow: hidden;
}

.bearing-label {
  width: calc((1382 * 8) / 72px);
  text-align: center;
  line-height: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#map-tile {
  position: absolute;
  top: 70px;
  right: 20px;
  width: 100px;
  height: 100px;
  background: #666;
  cursor: pointer;
  z-index: 20;
  overflow: hidden;
  transition: all 0.3s ease;
  border-radius: 12px;
  box-shadow: 0 0 10px #000;
}

#map-tile img {
  padding: 5px;
}

#map-tile.expanded {
  width: 50vw;
  height: calc(100vh - 135px);
  border: 3px solid #fff;
  border-radius: 12px;
}

@media (max-width: 768px) {
  #panorama-container {
    height: calc(100vh - 25px) !important;
  }
  
  #map-tile {
    width: 60px;
    height: 60px;
  }
  #map-tile.expanded {
    width: calc(100vw - 45px);
    left: 20px;
    right: 20px;
    margin: 0 auto;
    border-radius: 12px;
  }
}

#minimap, #miniimg {
  width: 100%;
  height: 100%;
}

#miniimg {
  background: #666;
  border: 3px solid #fff;
  border-radius: 12px;
  object-fit: cover;
}

#map-tile.expanded #minimap {
  display: block;
}

#map-tile:not(.expanded) #miniimg {
  display: block;
}

.image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

#collapse-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  display: none;
}

#collapse-btn i {
  font-size: 18px;
  color: #000;
}

#map-tile.expanded #collapse-btn {
  display: block;
}

#map-tile:not(.expanded):hover {
  transform: scale(1.05);
}

#compass-overlay {
  position: absolute;
  bottom: 60px;
  right: 20px;
  width: 100px;
  height: 100px;
  opacity: 1;
  z-index: 10;
  display: none;
}

.compass-bg {
  width: 100%;
  height: 100%;
  background: #666;
  border: 2px solid #fff;
  border-radius: 12px;
  box-shadow: 0 0 10px #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#compass-sector {
  transform-origin: 60px 60px;
  transition: transform 0.4s ease;
}

#bearing-tooltip {
  position: fixed;
  bottom: 60px;
  left: 20px;
  width: auto;
  height: auto;
  background: #666;
  border: 3px solid #fff;
  border-radius: 12px;
  color: #fff;
  padding: 8px 12px;
  display: flex;
  gap: 10px;
  flex-direction: column; /* Change direction to stack vertically */
  align-items: center;
  font-weight: bold;
  font-size: 14px;
  pointer-events: none;
  z-index: 15;
}

#zoom-preview {
  width: 100%; /* Make the zoom image take full width */
  height: 150px; /* Adjust the height to make it square or larger */
  margin-top: 5px; /* Add space below the zoom image */
}

#bearing-text {
  font-size: 14px; /* Keep text font size */
  text-align: center;
}

#zoom-preview canvas {
  width: 100%;  /* Make canvas fill the parent container */
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 3px white solid;
}

@media (max-width: 768px) {
  #bearing-tooltip {
    padding: 4px 8px;  /* Smaller padding on mobile */
    gap: 5px;
  }

  #zoom-preview {
    height: 100px;  /* Smaller height for zoom preview */
  }

  #zoom-preview canvas {
    height: 100%;  /* Adjust canvas size to match */
  }

}

/* Prevent box-sizing interference on Leaflet tiles */
.leaflet-container *, .leaflet-tile, #minimap, #map-tile.expanded {
  box-sizing: content-box !important;
}

#map-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
}


@media (max-width: 768px) {
  /* Ensure the segment container does not have any margin or padding */
  .segment {
    margin: 0 !important;  /* Force no margin */
    padding: 0 !important;  /* Force no padding */
  }

  /* Set images to full width and height on mobile without extra space */
  .segment img {
    width: 100% !important;  /* Ensure it fills the full width */
    height: 100% !important; /* Ensure it fills the full height */
    object-fit: cover !important; /* Ensure image covers the container */
    display: block !important;  /* Ensure no inline-block space or margin */
    border: none !important;   /* Remove borders */
  }

  /* Remove any padding or margins in the image wrapper */
  .image-wrapper {
    padding: 0 !important; /* No padding */
    margin: 0 !important;  /* No margin */
    overflow: hidden; /* Hide any overflow */
  }

  /* Adjust the zoom preview size and bearing tooltip on mobile */
  #zoom-preview {
    height: 100px !important; /* Set a smaller height */
  }

  #zoom-preview canvas {
    height: 100% !important;  /* Ensure canvas fills the zoom preview container */
  }

  #bearing-tooltip {
    padding: 4px 8px !important;  /* Smaller padding */
    gap: 5px !important;  /* Reduce gap */
  }

  #bearing-text {
    font-size: 12px !important; /* Smaller text size */
  }
}

#notifications {
  position: absolute;
  top: 40px !important;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fire-notification {
  position: relative;
  background: linear-gradient(to bottom, #dc3545, #b02a37);
  color: white;
  padding: 8px 8px;
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  animation: zoomIn 0.25s ease;
  z-index: 1;
}

.fire-notification::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  animation: shimmer-fire 3s infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes shimmer-fire {
  0% { left: -100%; }
  100% { left: 200%; }
}

.fire-notification:hover {
  transform: scale(1.04);
  transition: transform 0.2s ease;
}

.fire-notification:active {
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.fire-dot {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(to bottom, #dc3545, #b02a37);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  border: 1px solid #911a28;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.fire-dot::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 0;
}

.fire-line {
  position: absolute;
  width: 100px; /* Length of the line */
  height: 15px; /* 50% of the dot's height */
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); /* Add shadow to match the dot style */
  border: 1px solid #911a28; /* Border matching the dot */
  z-index: 4; /* Ensure it's below the dot */
  pointer-events: none; /* Prevent interaction */
}

.fire-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%; /* Match the width of the fire-line */
  height: 100%; /* Ensure the shimmer effect matches the height of the line */
  transform: skewX(-20deg);
  pointer-events: none;
  z-index: 0;
}

.fire-line-left {
  transform: rotate(-45deg);
  background: linear-gradient(to right, #b02a37, #de7a83); /* Lighter at the start, darker at the end */
}

.fire-line-right {
  transform: rotate(45deg);
  background: linear-gradient(to left, #b02a37, #de7a83); /* Lighter at the start, darker at the end */
}

/* Box with no fill, thicker border, and shadow */
.fire-box {
  position: absolute;
  box-sizing: border-box;
  border: 4px solid #dc3545;
  border-radius: 12px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.3); 
  z-index: 1;
  transition: all 0.3s ease;
  
  /* left & right center ticks 
  background:
  linear-gradient(#dc3545, #dc3545) left center/10px 5% no-repeat,
  linear-gradient(#dc3545, #dc3545) right center/10px 5% no-repeat;*/
}

/* Hover effect: lighter color and scale up */
.fire-box:hover {
  border-color: #ff5733; /* Lighter red for hover */
  box-shadow: 0 0 3px 3px rgba(0, 0, 0, 0.4);
  transform: scale(1.05); /* Increase size by 5% */
  cursor: pointer;
}

.fire-box::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: #dc3545;
}

.fire-box::after:hover {
  background: #ff5733;
  transform: scale(1.05);
}

/* Box with no fill, thicker border, and shadow */
.grey-fire {
  border: 4px solid #555151;
  box-shadow: 0 0 2px 2px #afafaf;
  transition: all 0.3s ease;
}

/* Hover effect: lighter color and scale up */
.grey-fire:hover {
  border-color: #555151; /* Lighter red for hover */
  box-shadow: 0 0 2px 2px #afafaf;
  transform: scale(1.05); /* Increase size by 5% */
}

/* bottom tick (long) */
.grey-fire::after {
  bottom: 0px;
  height: 0 !important;
}

.fire-box::after:hover {
  background: #555151;
  transform: scale(1.05);
}

/* bottom tick (long) */
.fire-box::after {
  bottom: 0px;
  height: 40%;
}

#split-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 43px); /* adjust based on topbar height */
}

#map-container {
  height: 50vh;
  min-height: 200px;
  position: relative;
  z-index: 1;
}

#minimap {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  border-top: 3px solid #FFF;
}


/*#panorama-container {
  height: 100vh !important;
  overflow: hidden;
}*/

.leaflet-control-attribution {
  display:none !important;
}

.rotate-icon {
  transform-origin: center center;
  transition: transform 0.3s ease;
}

.smooth-pie {
  transition: d 0.3s ease;
}

.flag-icon {
  height: 12px;
  margin-right: 6px;
  vertical-align: middle;
}

.refresh-button-position {
    margin-right: -2rem;
    position: absolute;
    top: 55px;
    right: 50px;
    z-index: 8;
}
