/* gis related css */
  .container {
    max-width: 100% !important;
    text-align: left !important;
  }
/*  Legend */
  .map-legend {
    position: absolute;
    bottom: 155px;
    right: 10px;
    background: #ddd;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
    z-index: 1000;
  }

  .legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
  }

  .legend-line,
  .legend-box {
    display: inline-block;
    width: 20px;
    height: 12px;
    margin-right: 8px;
    border-radius: 2px;
  }

  /* Colored lines */
  .yellow-line { background: yellow; border: 2px solid black; }
  .blue-line { background: #2196f3; border: 2px solid white; }
  .red-line { background: red; border: 2px solid white;}
  .green-line { background: #4CAF50; border: 2px solid white; }
  .black-line { background: black; }
  .thin-blue-line { background: #87cefa; height: 2px; }


  /* Bordered boxes */
  .top-margin{
    margin-top: 5px;
  }
  .bottom-margin{
    margin-top: 5px;
  }
  .brown-dash {
    border: 3px dashed brown;
    width: 20px;
    height: 12px;
    background: none;
  }
  .orange-dash {
    border: 3px dashed #f57c00;
    width: 20px;
    height: 12px;
    background: none;
  }
 .violet-dash {
  border: 3px dashed #7e57c2;
    width: 20px;
    height: 12px;
    background: none;
  }
  .grey-dash {
    border: 3px dashed #757575;
    width: 20px;
    height: 12px;
    background: none;
  }
  .blue-dash {
    background: none;
    width: 20px;
    height: 12px;
    border: 3px dashed #04baf7;
  }
  .darkblue-dash {
    background: none;
    width: 20px;
    height: 12px;
    border: 3px dashed #323477;
  }

/* Map CSS */
  #map{
    height: 100vh;
    position: relative;
    margin-left: 60px;
    padding: 20px;
    flex: 1;
    transition: margin-left 0.5s ease;
    margin-left: 0;
    border: 1px solid #000;
    border-radius: 10px;
  }


  .top-tab-header {
    flex-shrink: 0;
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f9f9f9;
    border-bottom: 1px solid #ccc;
  }

  .top-tab-header li {
    padding: 10px 15px;
    cursor: pointer;
    border-right: 1px solid #ccc;
  }

  .top-tab-header li:last-child {
    border-right: none;
  }

  .top-tab-header li.active {
    background: #e0e0e0;
    font-weight: bold;
  }

  /* Each top-level tab body fills remaining height */
  .top-tab-body {
    flex-grow: 1;
    overflow: hidden; /* prevent outer scroll */
    display: none;
    flex-direction: column;
  }

  .top-tab-body:not(.hidden) {
    display: flex;
  }

  /* Sub-tab header inside Inventory */
  .tab-header {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f1f1f1;
    border-bottom: 1px solid #ccc;
    overflow-x: auto;
  }

  .tab-header li {
    padding: 8px 12px;
    cursor: pointer;
    background: #eee;
    margin: 2px;
    border-radius: 4px;
    white-space: nowrap;
  }

  .tab-header li.active {
    background: #283979;
    color: white;
    font-weight: bold;
  }

  /* Scroll only tab body content */
  .tab-body {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: auto;
    border-top: 1px solid #ccc;
    background: white;
  }

  /* Hide by default */
  .hidden {
    display: none !important;
  }

  .table-container {
    max-height: 620px;
    overflow-y: auto;
    border: 1px solid #000;
  }

  .popup-table {
    width: 100%;
    border-collapse: collapse;
  }

  .popup-table thead tr th {
    position: sticky;
    top: -2px;
    background: #f8f8f8;
    z-index: 2;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    text-align: left;
  }

  .popup-table th,
  .popup-table td {
    padding: 8px;
    border: 1px solid #ccc;
    text-align: left;
  }

  .popup-table tbody tr:hover {
    background-color: #f0f9ff;
    cursor: pointer;
  }

  /* Keep this for clicked row highlight */
  .popup-table tr.active-row {
    background-color: #dbeafe !important;
  }

  .map input {
    border-radius: 2rem;
    padding: 2px 20px;
  }
  .filter-option {
    margin-bottom: 12px;

  }
  .btn{
    margin: 5px;
    background-color: #283979;
    color: white;
  }

  .bg-light {
    /* --bs-bg-opacity: 1; */
    background-color: rgba(var(--bs-bg-opacity)) !important;
  }

  /* CSS to sidebar */
  #sidebar {
    position: absolute;
    top: 115px;
    left: 0;
    width: 300px;
    bottom: 20px;
    height: calc(100% - 140px); /* flexible height */
    background-color: #f8f9fa;
    padding: 15px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 999;
    border-radius: 10px;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid;
  }

  /* When active, slide into view */
  #sidebar.active-nav {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  #menu-btn{
    position: absolute;
    top: 82px;
    left: 10px;
    z-index: 1000;
    background-color: white;
    border: none;
    padding: 8px;
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  }

  #map-container{
    position: relative;
  }
  /* For Video */

  .styled-video {
    width: 100%;
    height: auto;
    border: 1px solid #283979;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
  }
  /* loader */
  .loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    pointer-events: all;
  }

  .loader-bars {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    gap: 5px;
  }

  .loader-bars .bar {
    width: 8px;
    height: 24px;
    background-color: #283979;
    animation: loader-bar-animation 1s infinite ease-in-out;
  }

  .loader-bars .bar:nth-child(2) {
    animation-delay: 0.2s;
  }

  .loader-bars .bar:nth-child(3) {
    animation-delay: 0.4s;
  }

  @keyframes loader-bar-animation {
    0%, 100% {
      transform: scaleY(1);
    }
    50% {
      transform: scaleY(1.5);
    }
  }

  #videoError{
    display: none;
    color: red;
    font-weight: bold;
    margin-top: 20px;
  }
  /* for cursor on custom popup */
  .popup-panel,
  .tab-body,
  .popup-table {
    cursor: auto !important; /* restores normal cursor */
  }

  .popup-panel,
  .tab-body {
    user-select: text !important;
  }

  /* CSS for fullscreen mode */
  .popup-panel.fullscreen {
    width: 100%;
    height: 100%;

    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    z-index: 1101;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Don't scroll the popup itself */
  }

  .popup-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    margin-left: 215px;
    cursor: pointer;
  }
/* for photo slideshow*/
.photo-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.photo-popup-content {
  position: relative;
  background: white;
  padding: 20px;
  border-radius: 10px;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.photo-popup-close {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 24px;
  cursor: pointer;
  color: #000;
}

.photo-slideshow {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 600px;
  max-height: 400px;
  overflow: hidden;
}

.photo-slide {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
}

.photo-nav {
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  user-select: none;
}

.photo-nav:hover {
  color: #000;
  font-weight: bold;
}

.photo-counter {
  position: absolute;
  bottom: 10px;
  right: 20px;
  font-size: 14px;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 5px;
  font-weight: bold;
  z-index: 10;
}

/*** Popup Panel**/
#popup-panel {
  position: absolute;
  top: 60px;
  right: 0;
  width: 400px;
  height: 90vh;
  max-height: 90%;
  background: white;
  border: 2px solid #1a3d7c;
  z-index: 9999;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#popup-panel.hidden {
  display: none;
}

.popup-header {
  background: #1a3d7c;
  color: white;
  padding: 8px 10px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-controls button {
  background: none;
  border: none;
  color: white;
  margin-left: 8px;
  cursor: pointer;
  font-size: 16px;
}

.popup-content {
  padding: 10px;
  overflow-y: auto;
}

#popup-panel.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 99vw !important;
  height: 100vh !important;
  /* z-index: 10000; */
}

.video-wrapper video {
  /*width: 100%;*/
  height: auto; /* Maintain aspect ratio */
  max-height: 400px; /* Optional: limit height */
  display: block;
  margin: auto;
}

#popup-panel:not(.maximized) .video-wrapper video {
  width: 100%;
  height: auto;
  object-fit: contain;
}

#popup-panel.maximized .video-wrapper video {
  width: auto;
  height: 100%;
  object-fit: cover;
}
