@font-face {
  font-family: "hindregular";
  src: url("https://dp.observatory.org.in/themes/bartik/font/Hind-Regular.ttf");
}

@font-face {
  font-family: "hindbold";
  src: url("https://dp.observatory.org.in/themes/bartik/font/Hind-Bold.ttf");
}

@font-face {
  font-family: "hindsemibold";
  src: url("https://dp.observatory.org.in/themes/bartik/font/Hind-SemiBold.ttf");
}

@font-face {
  font-family: "hindlight";
  src: url("https://dp.observatory.org.in/themes/bartik/font/Hind-Light.ttf");
}

::-webkit-scrollbar {
  width: 6px;
  height: 4px;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: "hindregular", sans-serif;
}

body.scrollable-page {
  overflow: auto !important;
}

::-webkit-scrollbar-track {
  background-color: rgba(20, 87, 167, 0);
}

::-webkit-scrollbar-thumb {
  background-color: #b2afaf;
  border-radius: 25px;
}

::-webkit-scrollbar-button,
::-webkit-scrollbar-corner {
  background-color: rgba(20, 87, 167, 0);
}

.infoContainer {
  font-size: 1.1rem;
  /*text-align: justify;*/
  /* margin: 10px 8px; */
  padding: 10px;
  position: relative;
  font-family: "hindregular";
  color: #353535;
}

#regionDetails {
  display: none;
  font-size: 0.95rem;
  position: absolute;
  top: 15px;
  left: 40%;
  padding: 11px 17px;
  background-color: #fff;
  z-index: 1010;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 -1px 0px rgba(0, 0, 0, 0.02);
  color: #464646;
}

#fInfoContainer .infoContent table tr td:last-child {
  width: 40% !important;
  font-size: 0.8rem !important;
}

#fInfoContainer .infoContent table tr td:first-child {
  width: 35% !important;
  font-size: 0.8rem !important;
  word-wrap: break-word;
}

.infoContainer select {
  width: 98% !important;
  padding: 13px 15px;
  font-size: 0.9rem;
  color: #1b1b1b;
  border-radius: 3px;
  border: 1px solid #d0d0d0;
}

#content .section {
  padding: 0 7px !important;
}

.ui-autocomplete.ui-widget-content::-webkit-scrollbar {
  width: 0.4rem;
  height: 0.45rem;
}

.ui-autocomplete.ui-widget-content::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
  border-radius: 10px;
}

.ui-autocomplete.ui-widget-content::-webkit-scrollbar-thumb {
  background-color: #d4d4d4;
  outline: 0px solid #bbb;
}

.ui-autocomplete.ui-widget-content::-webkit-scrollbar-thumb:hover {
  background-color: #a0a0a0;
  outline: 0px solid #bbb;
}

#mapContainer {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#mapContent {
  width: 100% !important;
  flex: 1 !important;
  position: relative !important;
  overflow: hidden !important;
  margin-bottom: 0 !important;
}

/* Responsive Map Control Overlays */
.map-controls-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Allow interaction with map behind */
  z-index: 1005;
}

.map-control-group {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  /* Re-enable for buttons */
}

.map-control-group.top-left {
  top: 15px;
  left: 15px;
  align-items: flex-start;
  width: auto;
  max-width: 40%;
}

.search-region-control {
  position: relative;
  width: min(320px, 100%);
}

.map-control-group.bottom-right {
  bottom: 25px;
  right: 15px;
  align-items: flex-end;
}

.map-control-group.top-right {
  top: 15px;
  right: 15px;
  align-items: flex-end;
}

.map-control-group.bottom-left {
  bottom: 25px;
  left: 15px;
  align-items: flex-start;
}

/* Standardized Map Buttons */
.map-control-group > div:not(.search-region-control),
#layerToggleBtn,
#downloadMapBtn,
#indexLegend,
#kalyaniInfoToggle,
#mapTools {
  background-color: #ffffff;
  color: #2c3e50;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.map-control-group>div:hover {
  background-color: #f8f9fa;
  transform: scale(1.05);
}

#kalyaniInfoToggle {
  width: auto !important;
  padding: 0 12px !important;
  border-radius: 20px !important;
  font-family: 'hindsemibold', sans-serif;
  font-size: 0.9rem !important;
  position: static !important;
  /* Managed by flex group */
}

#kalyaniInfoToggle i {
  margin-right: 6px !important;
}

#searchRegion {
  padding: 12px 44px 12px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 6px !important;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  color: #1e293b !important;
  font-size: 0.95rem;
  width: 280px;
  max-width: 100%;
  position: static !important;
  display: block;
  z-index: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 0;
}

#clearSearchRegion {
  display: none;
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  cursor: pointer;
  color: #64748b;
  font-size: 20px;
  line-height: 18px;
  text-align: center;
  z-index: 1;
}

#clearSearchRegion:hover {
  color: #1e293b;
}

#searchRegion:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#mapTools img {
  width: 22px;
  height: 22px;
}

#rightPanel .container .block {
  padding: 7px 10px;
  border: 1px solid #f1f1f1;
  border-radius: 5px;
}

#rightPanelAccordion .ui-widget-content {
  padding: 5px 10px 0 10px !important;
}

#rightPanel label {
  font-weight: normal;
}

#rightPanel label input[type="checkbox"] {
  vertical-align: top;
  margin-right: 5px;
}

.map-icon-tools {
  z-index: 1005 !important;
}

/* Drupal customized css */
.meta.submitted {
  display: none;
}

.tabs {
  display: none !important;
}

#breadcrumb {
  display: none !important;
}

.p {
  margin: 0 !important;
}

h1#page-title {
  display: none !important;
}

h2 {
  font-weight: bold;
  margin-bottom: 15px !important;
  margin-top: 0;
  font-size: 1.3rem !important;
}

h4 {
  margin: 5px 0 10px 0 !important;
}

.legendRow {
  margin-bottom: 0.5rem;
}

.legendRow p {
  margin: 0 !important;
}

#legendContent {
  max-height: 25rem !important;
  padding: 15px !important;
  display: none;
}

#selectedRegionInfo {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #fff;
  padding: 10px 15px;
  z-index: 1010;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  text-align: center;
}

#fInfoContainer .infoContent table tr td:last-child {
  width: 49% !important;
}

#toolControlToggle {
  z-index: 1100 !important;
}

#outputMapTools {
  z-index: 1100 !important;
}

#mapTools {
  display: none;
}

#fInfoContainer .infoContent {
  max-height: 15rem;
}

.infoContainer ol,
ul {
  list-style: none;
}

.infoContainer a {
  text-decoration: none;
}

.infoContainer ul li {
  width: 10rem;
  min-width: 130px;
  /* height: 399px; */
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 6px 10px 0 rgba(216, 216, 216, 0.5);
  background-color: #ffffff;
  padding: 25px 15px;
  margin-left: 30px;
  float: left;
  margin-bottom: 30px;
  z-index: 10;
  position: relative;
}

.infoContainer .btn-download {
  background: #000;
  color: #fff;
  font-weight: 600;
}

.infoContainer .btn {
  display: inline-block;
  font-weight: 400;
  color: #ffffff;
  text-align: center;
  vertical-align: middle;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* background-color: transparent; */
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.olControlLayerSwitcher .maximizeDiv,
.olControlLayerSwitcher .minimizeDiv {
  top: 15px !important;
  right: 15px !important;
  padding: 5px !important;
  border-radius: 4px !important;
  background-color: #fff !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
  z-index: 1020 !important;
}

.olControlLayerSwitcher .maximizeDiv img,
.olControlLayerSwitcher .minimizeDiv img {
  width: 1.6rem !important;
  min-width: 25px !important;
  vertical-align: middle !important;
}

.olControlLayerSwitcher {
  /*position: absolute; */
  top: 10px !important;
  right: 0 !important;
  width: 30% !important;
  min-width: 300px;
  font-size: 0.8em !important;
  color: white !important;
  background-color: transparent !important;
  display: inline-block !important;
}

.olControlLayerSwitcher .layersDiv {
  background-color: #fffffff0 !important;
  color: rgba(60, 60, 60, 0.84) !important;
  font-size: 0.8rem !important;
  /* border-radius: 5px !important; */
  max-height: 250px !important;
  height: unset !important;
  overflow-y: auto !important;
  font-weight: normal !important;
  margin-right: 16% !important;
  margin-top: 10px !important;
  padding: 10px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.olControlLayerSwitcher .layersDiv .baseLbl,
.olControlLayerSwitcher .layersDiv .dataLbl {
  margin-top: 10px !important;
  margin-left: 3px !important;
  margin-bottom: 7px !important;
  /* text-transform: uppercase !important; */
  font-size: 0.85rem !important;
  color: #8a8a8a !important;
}

.baseLayersDiv .labelSpan,
.dataLayersDiv .labelSpan {
  vertical-align: top !important;
  display: inline-block !important;
  font-size: 0.9rem !important;
  font-weight: normal !important;
  width: 85% !important;
  margin: 6px 0 !important;
  line-height: 0.6rem !important;
}


.olControlLayerSwitcher .layersDiv::-webkit-scrollbar {
  width: 0.4rem;
  height: 0.45rem;
}

.olControlLayerSwitcher .layersDiv::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
  border-radius: 10px;
}

.olControlLayerSwitcher .layersDiv::-webkit-scrollbar-thumb {
  background-color: #d4d4d4;
  outline: 0px solid #bbb;
}

.olControlLayerSwitcher .layersDiv::-webkit-scrollbar-thumb:hover {
  background-color: #a0a0a0;
  outline: 0px solid #bbb;
}

.buttonGO {
  width: 9% !important;
  min-width: 100px !important;
  font-size: 1rem;
  padding: 10px;
}

.buttonGO.noSubmit {
  background: #f7f7f7;
  color: #014e38;
  font-weight: normal;
  border: 1px solid #06a779;
}

#migrantsAccordion .buttonGO,
#vulnerableAccordion .buttonGO {
  font-weight: normal;
  font-size: unset;
  padding: 5px;
  margin-bottom: 10px;
}

.map-icon-tools {
  position: absolute !important;
  bottom: 25px !important;
  right: 15px !important;
  text-align: right !important;
  z-index: 1005 !important;
}

#processAddLayer {
  position: absolute !important;
}

.processWait {
  position: absolute !important;
  top: 25% !important;
  left: 45% !important;
  width: 300px !important;
}

.grey.lighten-3 {
  background-color: rgba(238, 238, 238, 0.63) !important;
}

#exportMapIcon {
  cursor: pointer;
  display: block;
  margin: 0px;
  margin-bottom: 5px;
  padding: 0;
  color: #424242;
  font-size: 17px;
  font-family: -webkit-body;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  height: 30px;
  /* width: 30px; */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  /* background: url(https://dp.observatory.org.in/explore/images/export-map.png) no-repeat center !important; */
  user-select: none;
  background-size: 80%;
  background-color: #fff;
  background-image: url(https://dp.observatory.org.in/explore/images/export-map.png) !important;
  background-position: center;
  background-repeat: no-repeat;
}

#processMapExport {
  top: 0;
  left: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 100000;
  background-color: rgb(226, 226, 226);
  background-position: center;
  background-size: 100% 100%;
  position: inherit;
  z-index: 100;
}

.processWaitME {
  position: absolute !important;
  top: 25% !important;
  left: 45% !important;
  width: 300px !important;
}

.processWaitME {
  display: inline-block;
  background-color: #fff;
  border-radius: 3px;
  color: #000;
  font-size: 15px;
  margin: auto;
  position: fixed;
  padding: 10px;
  text-align: center;
  top: 30%;
  left: 50%;
  width: 300px;
  margin-left: -140px;
}

#processTitleME {
  margin-bottom: 30px;
}

#usefulLinks,
#surveyForm {
  border: 1px solid #efefef;
  padding: 10px 30px;
  background-color: #f4f4f4;
  border-radius: 5px;
  margin: 25px 0;
  font-size: 1rem;
}

#surveyForm p {
  padding: 10px 0;
  margin-bottom: 0 !important;
}

.ui-helper-reset {
  font-size: 0.9rem !important;
}

.lswitch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  vertical-align: top;
  margin-bottom: 7px;
}

.lswitch input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.lslider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.lslider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 2px;
  background-color: #2a6d9f;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

/* Rounded sliders */
.lslider.round {
  border-radius: 34px;
}

.lslider.round:before {
  border-radius: 50%;
}

.lswitch input:checked+.lslider {
  background-color: #40e29e;
}

.lswitch input:focus+.lslider {
  box-shadow: 0 0 1px #2196f3;
}

.lswitch input:checked+.lslider:before {
  -webkit-transform: translateX(13px);
  -ms-transform: translateX(13px);
  transform: translateX(13px);
}

#leftPanel .label {
  line-height: 1.3rem;
  margin-left: 10px;
  display: inline-block;
}

.ui-accordion-content {
  overflow: auto;
  margin-top: 0 !important;
}

.migranttabs {
  width: 98%;
  padding: 10px;
  background-color: #fbfbfb;
}

.migranttabs .mtab {
  display: inline-block;
  padding: 10px;
  font-size: 1rem;
  background-color: #ececec;
  cursor: pointer;
  width: 11%;
  text-align: center;
  border-radius: 2px;
  font-weight: bold;
}

.migranttabs .mtab:hover,
.migranttabs .mtab.active {
  background-color: #06a879;
  color: #fff;
}

div.olControlZoom {
  top: 15% !important;
}

div.olControlZoom a {
  height: 35px !important;
  width: 35px !important;
  line-height: 2.2rem !important;
  color: #4c4c4c !important;
}

#fInfoContainer .infoContent table {
  width: 100% !important;
}

#legendContent::-webkit-scrollbar {
  width: 0.7rem !important;
}

.jh_map_layer_opacity {
  width: 40%;
  font-size: 17px;
  vertical-align: top;
  padding-top: 3px;
  float: right;
}

.jh_map_layer_opacity_start {
  display: inline-block;
}

.jh_map_layer_opacity_slider {
  display: inline-block;
}

.jh_map_layer_opacity_end {
  display: inline-block;
}

[aria-labelledby="spLayers"] p {
  margin-bottom: 1.7rem;
}

#leftPanel .ui-widget-content::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.45rem;
}

#leftPanel .ui-widget-content::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgb(34 41 130);
  border-radius: 10px;
}

#leftPanel .ui-widget-content::-webkit-scrollbar-thumb {
  background-color: #242c86;
  outline: 0px solid #bbb;
}

#leftPanel .ui-widget-content::-webkit-scrollbar-thumb:hover {
  background-color: #1a1f61;
  outline: 0px solid #bbb;
}

@media (min-width: 320px) {
  #map {
    width: 100%;
    float: center;
  }

  #mapContent {
    width: 100% !important;
    flex: 1 !important;
    position: relative;
    /*float: right;*/
    margin-bottom: 0 !important;
  }


  #gettingstartedPopup {
    display: block;
    position: absolute;
    z-index: 1020;
    margin-left: 13%;
    width: 70%;
    top: 19%;
    background-color: rgb(9, 45, 93);
    color: rgb(255, 255, 255);
    padding: 0 3.5vw 1vh;
    font-size: 14px;
    border-radius: 8px;
    box-shadow: 0 0 10px 1px #0000002e;
  }

  #gettingstartedPopup span {
    font-size: 18px !important;
    margin-top: 1vh !important;
  }

  #valLat,
  #valLon {
    padding: 7px;
    border: 1px solid #ccc;
    border-radius: 5px !important;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    color: #444444 !important;
    font-size: 0.9rem;
    font-size: 14px;
    width: 30%;
    display: inline-block;
  }

  #valGo,
  #dateGo {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px !important;
    background: #5aab23;
    outline: none;
    box-sizing: border-box;
    color: #ffffff !important;
    font-size: 0.9rem;
    /* margin: 5px 0; */
    font-size: 14px;
    width: 25%;
    display: inline-block;
    text-align: center;
    font-weight: bold;
    margin-left: 15px;
  }

  #quickRefPopup {
    position: absolute;
    z-index: 1010;
    top: 10%;
    left: 10%;
    width: 70%;
    padding: 3vw;
    font-size: 1.5rem;
    background-color: #fff;
    color: #2f2f2f !important;
    box-shadow: 0 0 10px 1px #0000002e;
    border-radius: 8px;
    display: none;
  }

  #quickRefPopup table {
    color: #2f2f2f !important;
    font-size: 1.1rem !important;
    width: 100%;
  }

  #explorerIntro {
    background-color: #2a6d9f;
    color: #fff;
    font-size: 11px;
    padding: 10px;
    /* font-weight: bold; */
    border-radius: 5px;
  }

  #closeLayer {
    float: right;
    padding: 13px 4px 5px 5px !important;
    font-size: 17px !important;
    margin-bottom: 10px !important;
    z-index: 1000;
  }
}


/* Enhancements for Map Controls and Legend Responsiveness on smaller screens */
@media (max-width: 768px) {

  /* Legend Content constraints */
  #legendContent {
    max-height: 40vh !important;
    width: 85vw !important;
    max-width: 320px !important;
    overflow-y: auto !important;
    padding: 10px !important;
  }

  /* Make sure legend dialog itself adapts */
  .ui-dialog {
    max-width: 95vw !important;
  }

  /* Mobile stacking for top-left controls */
  .map-control-group.top-left {
    top: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-width: calc(100% - 70px) !important;
    gap: 8px !important;
  }

  .search-region-control {
    width: 100%;
  }

  .map-control-group.top-right {
    top: 10px !important;
    right: 10px !important;
  }

  .map-control-group.bottom-left {
    bottom: 20px !important;
    left: 10px !important;
    align-items: flex-start !important;
  }

  .map-control-group.bottom-right {
    bottom: 20px !important;
    right: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 8px !important;
  }

  #searchRegion {
    width: 100% !important;
    font-size: 0.9rem !important;
    padding: 10px 40px 10px 12px !important;
  }

  .map-overlay-panel {
    top: 55px !important;
    right: 10px !important;
    width: calc(100% - 20px) !important;
    max-width: 300px !important;
  }


  /* Layer Switcher Adjustments */
  .olControlLayerSwitcher {
    width: 90% !important;
    min-width: unset !important;
    right: 5% !important;
  }

  .olControlLayerSwitcher .layersDiv {
    max-height: 35vh !important;
    margin-right: 0 !important;
  }

  #exportMapIcon {
    height: 35px;
    background-size: 60%;
  }
}

/*@media (min-width:480px)  { /* smartphones, Android phones, landscape iPhone */
/*}*/
/*@media (min-width:600px)  { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */
/*}*/
/*@media (min-width:801px)  { /* tablet, landscape iPad, lo-res laptops ands desktops */
/*}*/
@media (min-width: 1025px) {
  .infoContainer {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    height: calc(100vh - 70px);
    overflow: hidden;
  }

  #leftPanel {
    width: 20%;
    height: 98%;
    background-color: #f1f1f1;
    padding: 15px 20px;
    border-radius: 5px;
    overflow-y: auto;
    box-sizing: border-box;
  }

  #statsBar {
    flex-shrink: 0;
    margin: 10px 15px;
    z-index: 1011;
  }

  #mapContent {
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    position: relative;
  }

  /* Desktop overrides for better integration */
  .map-control-group.top-left {
    top: 20px !important;
    /* left: 20px !important; */
    width: auto !important;
  }

  .map-control-group.top-right {
    top: 20px !important;
    right: 20px !important;
  }

  .map-control-group.bottom-left {
    bottom: 25px !important;
    left: 20px !important;
  }

  #searchRegion {
    width: 320px !important;
  }

  .search-region-control {
    width: 320px;
  }

  .map-overlay-panel {
    top: 70px !important;
    right: 20px !important;
  }

}



#fInfoContainer {
  font-size: 1rem;
  right: 16px;
  top: 4%;
  z-index: 1010;
  width: 33vw;
  text-align: right;
  min-width: 180px;
  border-radius: 10px;
}

#Legends {
  background-color: rgba(255, 255, 255, 0.95) !important;
  display: inline-block;
  z-index: 1005 !important;
  bottom: 30px !important;
  width: 15% !important;
  min-width: 240px !important;
  right: 60px !important;
}

#layerSwitcher {
  display: none;
  background-color: #ffffff;
  color: #484848;
  position: absolute;
  font-size: 0.75em;
  right: 15px;
  top: 65px;
  /* Position below desktop top-left row or mobile stack */
  z-index: 1010;
  width: 60%;
  min-width: 300px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
}

#leftPanel h5 {
  margin: 10px 0;
  font-size: 1rem;
}

#rightPanel h5 {
  margin: 6px 0;
  font-size: 0.92rem;
}

#rightPanel .container {
  padding: 7px 10px;
  border: 1px solid #06a779;
  border-radius: 5px;
  margin-bottom: 5px;
  background-color: #ffffff;
  top: 0;
  font-size: 0.9rem;
}

#rightPanel .container p {
  margin: 0;
  margin-bottom: 4px;
  padding: 5px 10px;
  cursor: pointer;
  /*border-left: 4px solid #e8e8e8;*/
  border-bottom: 1px solid #efefef;
}

#accordion .ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover,
#rightPanelAccordion .ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
  /*border-left: 7px solid #06a779 !important; */
  background: #f1f1f1 !important;
  font-weight: normal !important;
  color: #4a4a4a !important;
  font-weight: bold !important;
  /* border: 1px solid #f1f1f1 !important; */
  border-bottom: none !important;
  border-radius: 5px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  padding-bottom: 0 !important;
  font-size: 1rem !important;
}

.ui-accordion .ui-accordion-header {
  border: 0 !important;
  /* border: 1px solid #f3f3f3 !important; */
  background: #00000000;
  font-weight: bold !important;
  color: #484848 !important;
  border-radius: 5px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin: 3px 0 0 0 !important;
}

.ui-widget-content {
  border: 1px solid #343fc7 !important;
  border-top: none !important;
  border-radius: 5px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding: 15px 15px 10px 15px !important;
}

#leftPanel .ui-widget-content {
  text-align: left !important;
  background-color: #f1f1f1;
  color: #2b2b2b;
  font-size: 0.9rem !important;
  border: none !important;
}

.ui-accordion .ui-accordion-header {
  padding: 1rem !important;
  font-size: 0.9rem !important;
}

.ui-autocomplete.ui-menu .ui-menu-item {
  font-size: 0.9rem;
}

.ui-autocomplete.ui-menu .ui-menu-item {
  padding: 0.1em 0em !important;
}

.ui-autocomplete.ui-widget-content a {
  color: #383838 !important;
  font-weight: normal !important;
  font-size: 0.9rem !important;
  padding: 0.7em 0.5em !important;
}

.ui-autocomplete.ui-menu {
  padding: 0 !important;
}

#leftPanel .ui-widget-content a {
  color: #142eaf;
  text-decoration: underline;
}

.legendRow img {
  height: auto;
  margin-bottom: 0;
}


/* Custom Layer Controller Panel */
.map-overlay-panel {
  position: absolute !important;
  top: 60px !important;
  right: 15px !important;
  width: 280px !important;
  background: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
  z-index: 10007 !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 100px) !important;
  border: 1px solid #eee !important;
}

.panel-header {
  background: #f8f9fa !important;
  padding: 12px 15px !important;
  font-weight: 600 !important;
  border-bottom: 1px solid #eee !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  color: #2c3e50 !important;
}

.panel-close {
  cursor: pointer !important;
  color: #888 !important;
}

.panel-close:hover {
  color: #e74c3c !important;
}

.panel-content {
  padding: 10px 0 !important;
}

.layer-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 8px 15px !important;
  transition: background 0.2s !important;
}

.layer-item:hover {
  background: #f1f8f4 !important;
}

.layer-item span {
  font-size: 0.9rem !important;
  color: #444 !important;
}

/* Toggle Switch Slider Styling */
.switch {
  position: relative !important;
  display: inline-block !important;
  width: 40px !important;
  height: 22px !important;
  margin-bottom: 0 !important;
}

.switch input {
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.slider {
  position: absolute !important;
  cursor: pointer !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background-color: #ccc !important;
  transition: .4s !important;
}

.slider:before {
  position: absolute !important;
  content: "" !important;
  height: 16px !important;
  width: 16px !important;
  left: 3px !important;
  bottom: 3px !important;
  background-color: white !important;
  transition: .4s !important;
}

input:checked+.slider {
  background-color: #27ae60 !important;
}

input:focus+.slider {
  box-shadow: 0 0 1px #27ae60 !important;
}

input:checked+.slider:before {
  transform: translateX(18px) !important;
}

.slider.round {
  border-radius: 22px !important;
}

.slider.round:before {
  border-radius: 50% !important;
}

.legendRowTitle {
  font-size: 0.85rem !important;
  font-weight: bold !important;
  margin-bottom: 8px !important;
  border-bottom: 1px solid #ddd !important;
  padding-bottom: 4px !important;
}

.legend-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-bottom: 6px !important;
  font-size: 0.85rem !important;
}

.legend-color {
  width: 14px !important;
  height: 14px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
}

.legend-label {
  color: #444 !important;
}

.legend-label {
  color: #444 !important;
}

#activeLayersList {
  margin-bottom: 12px !important;
}

.active-layer-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 5px 0 !important;
  font-size: 0.85rem !important;
  color: #333 !important;
}

.active-layer-item::before {
  content: "\f00c" !important;
  /* FontAwesome check icon */
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  color: #27ae60 !important;
  font-size: 0.75rem !important;
}


#gettingstartedPopup {
  display: block;
  position: absolute;
  z-index: 1020;
  margin-left: 28%;
  width: 40%;
  top: 20%;
  background-color: rgb(9, 45, 93);
  color: rgb(255, 255, 255);
  padding: 0.5vw 2vw;
  font-size: 1.15rem;
  box-shadow: 0 0 10px 1px #0000002e;
  border-radius: 8px;
}

#gettingstartedPopup span {
  font-size: 1.5rem !important;
  margin-top: 1vh !important;
}

#valLat,
#valLon {
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 5px !important;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  color: #444444 !important;
  font-size: 0.9rem;
  font-size: 0.89rem;
  width: 30%;
  display: inline-block;
}

#valGo,
#dateGo {
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 5px !important;
  background: #5aab23;
  outline: none;
  box-sizing: border-box;
  color: #ffffff !important;
  font-size: 0.9rem;
  width: 25%;
  display: inline-block;
  text-align: center;
  margin-left: 10px;
  font-weight: bold;
  cursor: pointer;
}

#quickRefPopup {
  position: absolute;
  z-index: 1010;
  top: 10%;
  left: 32%;
  width: 35%;
  min-width: 500px;
  padding: 30px;
  font-size: 1rem;
  background-color: #fff;
  color: #2f2f2f !important;
  box-shadow: 0 0 10px 1px #0000002e;
  border-radius: 8px;
  display: none;
}

#quickRefPopup table {
  color: #2f2f2f !important;
  font-size: 0.9rem !important;
  width: 100%;
}

#explorerIntro {
  background-color: #2a6d9f;
  color: #fff;
  font-size: 0.9rem;
  padding: 2px 15px;
  /* font-weight: bold; */
  border-radius: 5px;
  text-align: justify;
}

#closeLayer {
  float: right;
  padding: 20px 20px 10px 10px;
  font-size: 1.8rem;
  margin-bottom: 10px;
  z-index: 1000;
}


#fInfoContainer .infoContent table tr td:first-child {
  width: 34% !important;
  font-size: 0.8rem !important;
  word-wrap: break-word;
}


/*@media (min-width:1281px) { /* hi-res laptops and desktops */
/*}*/

.noUi-handle {
  border: 1px solid #40e29e !important;
  background: #40e29e !important;
}

.noUi-horizontal .noUi-handle {
  width: 11px !important;
  height: 11px !important;
}

.ui-widget {
  font-family: inherit !important;
}

#gettingStartedBtn {
  width: fit-content;
  padding: 7px 15px;
  background-color: #5aab23;
  border-radius: 5px;
  margin-top: 10px;
  cursor: pointer;
  display: table;
}

#spLayersDiv {
  display: none !important;
}

#quickRefPopupC {
  width: 100%;
  overflow: auto;
  padding-right: 10px;
}

#quickRefPopupC::-webkit-scrollbar {
  width: 0.7rem !important;
  height: 0.45rem;
}

#quickRefPopupC::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
  border-radius: 10px;
}

#quickRefPopupC::-webkit-scrollbar-thumb {
  background-color: #d4d4d4;
  outline: 0px solid #bbb;
}

#quickRefPopupC::-webkit-scrollbar-thumb:hover {
  background-color: #a0a0a0;
  outline: 0px solid #bbb;
}

#layerSwitcher::-webkit-scrollbar {
  width: 0.6rem;
  height: 0.45rem;
}

#layerSwitcher::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
  border-radius: 10px;
}

#layerSwitcher::-webkit-scrollbar-thumb {
  background-color: #d4d4d4;
  outline: 0px solid #bbb;
}

#layerSwitcher::-webkit-scrollbar-thumb:hover {
  background-color: #a0a0a0;
  outline: 0px solid #bbb;
}

#leftPanel label input[type="date"] {
  padding: 4px 5px;
  border: 1px solid #ccc;
  border-radius: 5px !important;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  color: #444444 !important;
  font-size: 0.9rem;
  font-size: 0.89rem;
  /* width: 30%; */
  display: inline-block;
}

.login-btn {
  background: #fff;
  color: #222;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.login-btn:hover {
  background: #2a6d9f;
  color: #fff;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  z-index: 2000;
  padding: 20px;
  box-sizing: border-box;
}

/* Ensure SweetAlert2 is always on top of EVERYTHING, including loaders and modals */
.swal2-container {
  z-index: 999999999 !important;
}

#viModal {
  justify-content: flex-start;
}

#map {
  position: relative;
  z-index: 1;
  /* Ensure map stays below the modal */
}

.modal-content {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close:hover {
  color: #333;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  font-size: 14px;
  transition: border-color 0.3s;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #3498db;
}

textarea {
  height: 100px;
  resize: vertical;
}

.submit-btn {
  width: 100%;
  padding: 10px;
  background: #fff;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  transition: 0.3s;
}

.submit-btn:hover {
  background: #2a6d9f;
  color: white;
}

#viModal .modal-content {
  background: rgba(255, 255, 255, 0.95);
  padding: 25px;
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  text-align: left;
  width: 73%;
  margin-left: 314px;
  height: 89%;
  margin-top: -20px;
  animation: fadeIn 0.3s ease-in-out;
  max-width: none;
  max-height: none;
}

#viModal .modal-body {
  overflow-y: auto;
  max-height: 87%;
}

#registerModal .modal-content {
  max-width: 600px;
  text-align: left;
}

#loginModal .modal-content {
  max-width: 350px;
  text-align: center;
}

#viModal h2 {
  font-size: 22px;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
}

#viModal label {
  font-size: 14px;
  font-weight: bold;
  color: #444;
  display: block;
  margin-top: 10px;
  text-align: left;
}


.submit-btn {
  width: 100%;
  padding: 12px;
  margin-top: 15px;
  background: #1090d3;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  transition: 0.3s;
}

.submit-btn:hover {
  background: #2a6d9f;
}

.submit-btn.reject-btn {
  background: #e74c3c;
}

.submit-btn.reject-btn:hover {
  background: #c0392b;
}

#loader {
  display: none;
  position: absolute;
  /* Change from fixed to absolute */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 20px;
  border-radius: 5px;
  z-index: 1000;
  /* Ensure it's above the map */
}

.dropdown-container {
  position: relative;
  width: 100%;
}

.suggestion-dropdown {
  position: absolute;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
  display: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.suggestion-item {
  padding: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

.suggestion-item:hover {
  background: #007bff;
  color: white;
}

.no-match-message {
  color: red;
  font-size: 16px;
  font-style: italic;
  display: none;
  margin-top: 5px;
}

.error {
  color: red;
  display: none;
  font-size: 12px;
}

.user-profile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: left;
  /* Pushes everything to the right */
  gap: 8px;
  width: 100%;
  /* Ensures full width for proper spacing */
}

.username {
  /* font-weight: bold; */
  /* order: -1; */
  /* Moves the text to the left */
  font-size: 0.95rem;
  margin-top: 0.1rem;
  color: #2a6d9ff7;
}

.user-profile i {
  font-size: 30px;
  cursor: pointer;
  color: #2a6d9f;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 35px;
  left: 0;
  /* Aligns dropdown to the right under the icon */
  background: white;
  border: 1px solid #ccc;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  padding: 5px;
  min-width: 150px;
  z-index: 10;
  /* Ensures it appears above other content */
}

.dropdown-menu button {
  display: block;
  width: 100%;
  padding: 8px;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
}

.dropdown-menu button:hover {
  background: #f0f0f0;
}

input[type="radio"] {
  margin-right: 5px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
  min-width: 220px;
  top: 35px;
  left: 0;
  padding: 10px 0;
  z-index: 1000;
}

.dropdown-item {
  padding: 12px 20px;
  border-bottom: 1px solid #eee;
  transition: background 0.3s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.menu-title {
  /* font-weight: bold; */
  color: #333;
  display: block;
  font-size: 16px;
  margin-bottom: 10px;
}

.submenu a {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #555;
  padding: 1px 5px;
  transition: color 0.3s ease;
  color: #007bff;
}

.submenu a:hover {
  color: #007bff;
}

.submenu span {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #555;
  transition: color 0.3s ease;
}

.logout a {
  /* font-weight: bold; */
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 15px;
}

.logout a:hover {
  background: rgba(255, 0, 0, 0);
}

i {
  font-size: 16px;
  color: #666;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.default-search {
  display: inline-flex;
  align-items: right;
  white-space: nowrap;
  /* Prevents text from breaking into new lines */
}



/* Stats Bar Styles */
#statsBar {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #f0f2f5 100%);
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e1e4e8;
  font-family: 'hindsemibold', sans-serif;
  width: 97%;
  margin-left: auto;
  margin-right: auto;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 15px;
  border-right: 1px solid #e0e0e0;
  flex: 1;
}

.stat-item:last-child {
  border-right: none;
}

.stat-label {
  font-size: 0.85rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.4rem;
  color: #2c3e50;
  font-weight: bold;
  font-family: 'hindbold', sans-serif;
}

/* Responsive adjustments for stats bar */
@media (max-width: 400px) {
  #statsBar {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 10px;
  }

  .stat-item {
    border-right: none;
    min-width: 30%;
    margin-bottom: 5px;
  }
}

/* Main Header Styles */
.main-header {
  background: #f8fafc;
  color: #2c3e50;
  padding: 0 20px;
  min-height: 70px;
  height: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  font-family: 'hindsemibold', sans-serif;
  box-sizing: border-box;
  border-bottom: 2px solid #e2e8f0;
  flex-shrink: 0;
}

.header-left .logo {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  min-height: 70px;
  margin-right: 10px;
}

.nav-link {
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 0 10px;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.nav-link.active {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.03);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #3b82f6;
  border-radius: 3px 3px 0 0;
}

.nav-link i {
  font-size: 16px;
  opacity: 0.8;
}

.header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  justify-content: flex-end;
}

.header-btn {
  background: #3b82f6;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .main-header {
    padding: 0 15px;
  }

  .nav-link {
    padding: 0 8px;
  }
}

@media (max-width: 768px) {
  .header-left .logo {
    font-size: 18px;
  }

  .main-header {
    padding: 5px 10px;
  }

  .nav-link {
    font-size: 12px;
    padding: 0 5px;
    min-height: 40px;
    height: 40px;
  }

  .header-nav {
    min-height: 40px;
  }

  .header-right {
    min-height: 40px;
    gap: 5px;
  }

  .header-user-profile {
    padding: 2px 5px;
  }
}

@media (max-width: 640px) {
  .nav-link span {
    display: none;
  }

  .nav-link {
    padding: 0 10px;
  }

  .nav-link i {
    font-size: 18px;
  }
}

.header-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.header-btn.btn-add-user {
  background: #ffffff;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #e2e8f0;

}

.header-btn.btn-add-user:hover {
  background: #3b82f6;
}

.header-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.header-user-profile:hover {
  background: #f1f5f9;
}

.header-user-profile i.fa-circle-user {
  font-size: 20px;
  color: #64748b;
}

.header-username {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#headerProfileDropdown,
.header-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background: #fff;
  color: #333;
  min-width: 280px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  overflow: visible;
  z-index: 2001;
  border: 1px solid rgba(0, 0, 0, 0.08);
  animation: dropdownFadeIn 0.2s ease-out;
}

#headerProfileDropdown::before,
.header-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 10px;
  background: transparent;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#headerProfileDropdown.show,
.header-dropdown-menu.show {
  display: block;
}

#headerProfileDropdown .dropdown-item,
.header-dropdown-menu .dropdown-item {
  padding: 15px 20px;
  transition: all 0.2s ease;
}

#headerProfileDropdown .dropdown-item:hover,
.header-dropdown-menu .dropdown-item:hover {
  background: #f8f9fa;
}

#headerProfileDropdown .dropdown-item a,
.header-dropdown-menu .dropdown-item a {
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

#headerProfileDropdown .dropdown-item.logout a,
.header-dropdown-menu .dropdown-item.logout a {
  color: #e74c3c;
}

/* Header Dropdown Enhancements */
#headerProfileDropdown .menu-title,
.header-dropdown-menu .menu-title {
  display: block;
  font-size: 11px;
  color: #95a5a6;
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#headerProfileDropdown .default-search a,
.header-dropdown-menu .default-search a {
  font-size: 13px;
  color: #34495e;
  font-weight: 500;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  white-space: normal;
  word-break: break-word;
}

#headerProfileDropdown .default-search a i,
.header-dropdown-menu .default-search a i {
  margin-top: 3px;
  color: #3498db;
}

#headerProfileDropdown .default-search a:hover,
.header-dropdown-menu .default-search a:hover {
  color: #3498db;
}

#headerProfileDropdown .no-location,
.header-dropdown-menu .no-location {
  font-size: 13px;
  color: #95a5a6;
  font-style: italic;
  display: block;
  margin-top: 5px;
}

#headerProfileDropdown hr,
.header-dropdown-menu hr {
  border: 0;
  border-top: 1px solid #eee;
  margin: 5px 0;
}

#headerProfileDropdown .user-info,
.header-dropdown-menu .user-info {
  padding-bottom: 12px;
}

/* Download Map Button Styling - Map Icon Version */
#downloadMapBtn {
  background-color: #ffffff;
  color: #3498db;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin-top: 10px;
}

#downloadMapBtn:hover {
  background-color: #3498db;
  color: #ffffff;
  border-color: #3498db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: scale(1.1);
}

#downloadMapBtn i {
  font-size: 18px;
}

/* Enhanced VI Popup Styling - Added by UI/UX Update */

/* Base Container Styling Override */
#fInfoContainer {
  background: #ffffff !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: none !important;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

/* Header Styling */
#fInfoContainer .infoTitle {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
  /* Deep Blue Gradient */
  color: #ffffff !important;
  padding: 14px 18px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  text-transform: none !important;
  /* Reset uppercase if any */
  display: flex;
  align-items: center;
}

#fInfoContainerClose {
  color: #ffffff !important;
  opacity: 0.8;
  transition: all 0.2s ease;
  font-size: 16px !important;
  /* margin-top: px; */
}

#fInfoContainerClose:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Popup Content Container */
.vi-popup-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #f4f6f9;
  /* Light grey background for contrast */
}

/* Breadcumbs / Location Header */
.vi-location-header {
  background: #ffffff;
  padding: 10px 18px;
  border-bottom: 1px solid #eaeaea;
  font-size: 13px;
  color: #6c757d;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  z-index: 2;
}

.vi-loc-sep {
  font-size: 11px;
  color: #adb5bd;
}

.vi-loc-current {
  color: #2a5298;
  /* Match header primary color */
  font-weight: 600;
  background: #eef2f7;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Scrollable Content Area */
.vi-content-scroll {
  overflow-y: auto;
  padding: 15px;
  height: 300px;
  /* Fixed height or consistent with JS */
  /* Smooth Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #cfd8dc #f4f6f9;
}

.vi-content-scroll::-webkit-scrollbar {
  width: 6px;
}

.vi-content-scroll::-webkit-scrollbar-track {
  background: #f4f6f9;
}

.vi-content-scroll::-webkit-scrollbar-thumb {
  background-color: #cfd8dc;
  border-radius: 10px;
}

/* Card Component */
.vi-card {
  background: #ffffff;
  border: none;
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.vi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.vi-card:last-child {
  margin-bottom: 0;
}

/* Card Header */
.vi-card-header {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #d4d4d4;
  border-bottom: 2px solid #d4d4d4;
}

.vi-icon-box {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  /* Vivid gradient icon bg */
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 16px;
  box-shadow: 0 3px 6px rgba(79, 172, 254, 0.3);
}

.vi-name {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.2;
}

/* Details List */
.vi-details {
  padding: 15px;
  box-shadow: 0 3px 6px rgba(79, 172, 254, 0.3);
}

.vi-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 2px solid #f0f0f0;
}

.vi-detail-row:last-child {
  border-bottom: none;
}

.vi-question {
  font-size: 13px;
  color: #718096;
  flex: 1;
  margin-right: 10px;
  font-weight: 500;
}

.vi-answer {
  font-size: 13px;
  font-weight: 600;
  color: #2d3748;
  text-align: right;
  max-width: 65%;
  background: #f7fafc;
  padding: 4px 8px;
  border-radius: 6px;
}

/* Card Footer */
.vi-card-footer {
  background: #f8fafc;
  padding: 10px 15px;
  border-top: 1px solid #edf2f7;
  font-size: 12px;
  color: #a0aec0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.vi-footer-label {
  margin-right: 5px;
  font-style: italic;
}

.vi-footer-value {
  font-weight: 600;
  color: #4a5568;
}

/* Responsive adjustments if needed */
@media (max-width: 768px) {
  .vi-card-header {
    padding: 12px;
  }

  .vi-details {
    padding: 12px;
    box-shadow: 0 3px 6px rgba(79, 172, 254, 0.3);
  }
}

/* Fix for container height to allow full scroll area */
#fInfoContainer .infoContent {
  max-height: none !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Enhanced Labels for Admin Headers */
.vi-loc-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.vi-loc-label {
  font-size: 11px;
  color: #888;
  margin-right: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.vi-loc-val {
  font-weight: 600;
  color: #333;
}

.vi-loc-current {
  color: #2a5298;
}

/* Grid Layout for Q&A */
.vi-detail-row {
  display: grid !important;
  grid-template-columns: 45% 55%;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid #cccccc;
  padding: 10px 0;
}

.vi-question {
  font-weight: 500;
  color: #555;
  word-break: break-word;
  /* Handle long questions */
}

.vi-answer {
  font-weight: 600;
  color: #2d3748;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  text-align: left !important;
  /* Force align left for better readability in grid */
  word-break: break-word;
}

/* Specific Style for Created By row to make it distinct */
.vi-created-by-row {
  margin-top: 10px;
  border-top: 2px solid #c4c4c4;
  padding-top: 15px;
}

.vi-created-by-row .vi-question {
  color: #718096;
  font-style: italic;
}

/* Close Button Fix */
#fInfoContainerClose {
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  z-index: 1000 !important;
  color: #ffffff !important;
  font-size: 18px !important;
  cursor: pointer !important;
  opacity: 0.9 !important;
  background: rgba(255, 255, 255, 0.2);
  width: 24px;
  height: 24px;
  text-align: center;
  line-height: 24px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

#fInfoContainerClose:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
}

/* REPAIR: Close Button Overhaul */
#fInfoContainerClose {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 10000 !important;
  /* Super high z-index */
  color: #ffffff !important;
  font-size: 20px !important;
  cursor: pointer !important;
  opacity: 1 !important;
  background: transparent !important;
  /* Remove bg to look cleaner on gradient */
  width: auto !important;
  height: auto !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

#fInfoContainerClose:hover {
  transform: scale(1.2) rotate(90deg);
  color: #ffcccc !important;
  /* Slight red tint on hover */
}

/* REPAIR: Location Header Cleanup */
.vi-location-header {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  /* Two items per row */
  gap: 8px 15px;
  /* Row gap, Col gap */
  padding: 12px 15px !important;
  background: #fdfdfd;
  border-bottom: 1px solid #e0e0e0;
}

.vi-loc-group {
  display: flex;
  flex-direction: column;
  /* Stack label and value vertically */
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.vi-loc-label {
  font-size: 10px !important;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.vi-loc-val {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #333;
}

.vi-loc-sep {
  display: none !important;
  /* Hide arrows, using grid instead */
}

/* Ensure current village is highlighted */
.vi-loc-current {
  color: #2a5298 !important;
  background: transparent !important;
  padding: 0 !important;
}

/* NEW SPLIT LAYOUT - Added for Step 70 */

.vi-split-layout {
  display: flex;
  flex-direction: row;
  height: 350px;
}

/* Sidebar Styles */
.vi-sidebar {
  width: 140px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 15px;
  flex-shrink: 0;
  overflow-y: auto;
}

.vi-sidebar-title {
  font-size: 10px;
  font-weight: 700;
  color: #6e798a;
  margin-bottom: 15px;
  letter-spacing: 0.8px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 5px;
}

.vi-loc-group-side {
  margin-bottom: 12px;
}

.vi-loc-label-side {
  display: block;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 3px;
}

.vi-loc-val-side {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  word-break: break-word;
  line-height: 1.3;
}

.vi-highlight {
  color: #2563eb;
  /* Blue highlight for Village */
}

/* Main Content Styles */
.vi-main-scroll {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  background: #ffffff;
  /* Smooth Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.vi-main-scroll::-webkit-scrollbar {
  width: 6px;
}

.vi-main-scroll::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.vi-main-scroll::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

/* Move close button up */
#fInfoContainerClose {
  top: 8px !important;
  right: 8px !important;
}

/* Ensure no overlap with fixed sidebar content */
.vi-card {
  margin-right: 2px;
  /* Tiny space for scrollbar visual */
}

/* Responsive tweak */
@media (max-width: 500px) {
  .vi-split-layout {
    flex-direction: column;
    height: auto;
    max-height: 80vh;
  }

  .vi-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .vi-sidebar-title {
    width: 100%;
    margin-bottom: 5px;
  }

  .vi-loc-group-side {
    margin-bottom: 0;
    margin-right: 15px;
  }

  .vi-main-scroll {
    height: 250px;
    /* Force scroll height on mobile */
  }
}

/* Sidebar Structure Improvements */
.vi-sidebar {
  background: #f7f9fc;
  border-right: 1px solid #e1e8ed;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.vi-loc-item-side {
  display: flex;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.vi-loc-item-side:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.vi-loc-item-side.active .vi-loc-icon,
.vi-loc-item-side.active .vi-loc-val-side {
  color: #2a5298;
  font-weight: 700;
}

.vi-loc-icon {
  width: 24px;
  font-size: 14px;
  color: #a0aec0;
  margin-top: 2px;
}

.vi-loc-data {
  flex: 1;
}

.vi-loc-label-side {
  font-size: 10px;
  color: #8898aa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  display: block;
}

.vi-loc-val-side {
  font-size: 13px;
  color: #32325d;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}

/* Close Button Adjustment */
#fInfoContainerClose {
  top: -3px !important;
  right: 4px !important;
}

/* Position Zoom Controls to prevent overlap */
.olControlZoom {
  top: 70px !important;
  left: 15px !important;
  right: auto !important;
  bottom: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  z-index: 1000 !important;
}

.olControlZoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  background: white !important;
  color: #2c3e50 !important;
  text-decoration: none !important;
  text-align: center !important;
  font-weight: bold !important;
  font-size: 1.2rem !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  display: block !important;
  transition: all 0.2s ease !important;
}

.olControlZoom a:hover {
  background: #f8f9fa !important;
  transform: scale(1.05) !important;
}

/* ============================================================
   KALYANI DETAIL SIDE PANEL
   ============================================================ */

/* Flex wrapper: map + side panel sit side-by-side */
#mapWrapper {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  overflow: hidden;
  width: 100%;
  position: relative;
  min-height: 0;
}

/* Map shrinks when panel is visible */
#mapContent {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  transition: flex 0.3s ease;
  height: 100% !important; /* Override fixed height from base CSS */
}

/* ---- Side Panel base ---- */
.kd-panel {
  width: 0;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.3s ease, min-width 0.3s ease;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  z-index: 1015;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
}

/* Panel becomes visible when JS adds this class */
.kd-panel.kd-panel--open {
  width: 40%;
  min-width: 40%;
}

/* ---- Header ---- */
.kd-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #1e293b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.kd-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kd-panel-title i {
  color: #38bdf8;
  font-size: 1rem;
}

.kd-panel-close {
  background: rgba(255, 255, 255, 0.07);
  border: none;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 5px 9px;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}

.kd-panel-close:hover {
  background: #ef4444;
  color: #fff;
}

/* ---- Body / scrollable content ---- */
.kd-panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.55;
  font-family: "sans-serif", sans-serif;
}

.kd-panel-body::-webkit-scrollbar {
  width: 5px;
}

.kd-panel-body::-webkit-scrollbar-track {
  background: transparent;
}

.kd-panel-body::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

/* ---- Loading / Error states ---- */
.kd-loading,
.kd-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: #64748b;
  font-size: 0.9rem;
  text-align: center;
}

.kd-error {
  color: #f87171;
}

/* ---- Content elements ---- */
.kd-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.kd-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 16px;
  line-height: 1.3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 12px;
}

.kd-section-title {
  font-size: 1.0rem;
  font-weight: 700;
  color: #77b8d4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Location grid */
.kd-location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.kd-loc-item {
  background: #1e293b;
  border-radius: 6px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kd-loc-label {
  font-size: 0.65rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kd-loc-val {
  font-size: 0.82rem;
  color: #e2e8f0;
  font-weight: 600;
  word-break: break-word;
}

/* Coordinates */
.kd-coord {
  font-size: 0.75rem;
  color: #64748b;
  margin: 6px 0 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Rejection banner */
.kd-rejection {
  background: #450a0a;
  border: 1px solid #7f1d1d;
  border-radius: 6px;
  padding: 10px 12px;
  color: #fca5a5;
  font-size: 0.8rem;
  margin: 10px 0;
  line-height: 1.5;
}

/* Q&A list */
.kd-qa-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kd-qa-row {
  background: #1e293b;
  border-radius: 6px;
  padding: 8px 11px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: start;
  transition: background 0.15s;
}

.kd-qa-row:hover {
  background: #263349;
}

.kd-qa-q {
  font-size: 0.75rem;
  color: #94a3b8;
}

.kd-qa-a {
  font-size: 0.8rem;
  color: #e2e8f0;
  font-weight: 600;
  word-break: break-word;
  text-align: right;
}

/* Footer */
.kd-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.72rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Image Carousel */
.kd-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.kd-carousel::-webkit-scrollbar {
  height: 6px;
}

.kd-carousel::-webkit-scrollbar-track {
  background: transparent;
}

.kd-carousel::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

.kd-carousel-img {
  flex: 0 0 85%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  scroll-snap-align: center;
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   TASK 3: UI/UX ENHANCEMENTS
   ============================================================ */

/* 1. StatsBar Cards */
#statsBar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 20px;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  /* padding: 20px !important;
  margin: 15px auto !important; */
  width: calc(100% - 40px);
  box-sizing: border-box;
  flex-shrink: 0;
}

#statsBar .stat-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 1 180px;
  /* max-width: 280px; */
  border: 1px solid #eef2f6;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

#statsBar .stat-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
  border-color: rgba(16, 144, 211, 0.2);
}

#statsBar .stat-item.stat-default {
  border-top: 4px solid #acddf1;
}

#statsBar .stat-item.stat-approved {
  border-top: 4px solid #22c55e;
}

#statsBar .stat-item.stat-pending {
  border-top: 4px solid #f59e0b;
}

#statsBar .stat-item.stat-rejected {
  border-top: 4px solid #ef4444;
}

#statsBar .stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

#statsBar .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-color, #1e293b);
  line-height: 1;
}

/* 2. Lighter Theme for .kd-panel */
.kd-panel {
  background: #ffffff !important;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1) !important;
}

.kd-panel-header {
  background: #f8f9fa !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.kd-panel-title {
  color: #1e293b !important;
}

.kd-panel-title i {
  color: #1090d3 !important;
}

.kd-panel-close {
  background: #f1f5f9 !important;
  color: #64748b !important;
}

.kd-panel-close:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.kd-panel-body {
  color: #475569 !important;
}

.kd-panel-body::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
}

.kd-name {
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.kd-loc-item {
  background: #f8f9fa !important;
  border: 1px solid #e2e8f0 !important;
}

.kd-loc-val {
  color: #1e293b !important;
}

.kd-qa-row {
  background: #f8f9fa !important;
  border: 1px solid transparent !important;
}

.kd-qa-row:hover {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

.kd-qa-q {
  color: #000000 !important;
}

.kd-qa-a {
  color: #0f172a !important;
}

.kd-footer {
  border-top: 1px solid #e2e8f0 !important;
  color: #94a3b8 !important;
}

.kd-carousel-img {
  background: #f1f5f9 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* ============================================================
   RESPONSIVE – stack vertically on small screens
   ============================================================ */
@media (max-width: 768px) {
  #mapWrapper {
    flex-direction: column;
    flex: 1;
    overflow: hidden;
  }

  #mapContent {
    flex: 1 1 auto;
    height: auto;
    min-height: 200px;
    /* Removed max-height: 60% to allow full space usage on tall screens */
  }

  .kd-panel {
    width: 100%;
    min-width: 0;
    height: 0;
    flex: 0 0 0;
    transition: height 0.3s ease, flex 0.3s ease;
  }

  .kd-panel.kd-panel--open {
    width: 100%;
    min-width: 0;
    height: auto;
    flex: 1 1 50%;
    min-height: 200px;
  }

  .kd-location-grid {
    grid-template-columns: 1fr 1fr;
  }
}
/* --- Enhanced Photo Carousel & Modal Viewer --- */
.kd-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 15px 5px;
    scrollbar-width: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.kd-carousel::-webkit-scrollbar {
    height: 8px;
}

.kd-carousel::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.kd-carousel::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

.kd-carousel::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.kd-carousel-item {
    flex: 0 0 250px;
    height: 160px;
    background: #f8f9fa;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    padding: 10px;
    scroll-snap-align: start;
}

.kd-carousel-item:hover {
    transform: translateY(-3px);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.kd-carousel-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.2s;
}

#photoViewerModal .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(26, 26, 26, 0.95);
    border: none;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

#photoViewerModal .close {
    color: #fff;
    z-index: 100;
    right: 30px;
    top: 20px;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

#fullPhoto {
    max-width: 100%;
    max-height: calc(95vh - 120px);
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.viewer-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.viewer-nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.viewer-nav-btn.prev { left: 40px; }
.viewer-nav-btn.next { right: 40px; }

.photo-counter {
    color: white;
    margin-bottom: 10px;
    font-size: 14px;
    background: rgba(0,0,0,0.4);
    padding: 4px 12px;
    border-radius: 20px;
}

.viewer-actions {
    margin-top: 15px;
    display: flex;
    gap: 15px;
}

.download-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.download-btn:hover {
    background: #2980b9;
}

@media (max-width: 768px) {
    .kd-carousel-item {
        flex: 0 0 180px;
        height: 120px;
    }

    .viewer-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .viewer-nav-btn.prev { left: 5px; }
    .viewer-nav-btn.next { right: 5px; }

    #photoViewerModal .modal-content {
        padding: 10px;
    }
}

/* Carousel Autoplay & Controls */
.kd-carousel-wrapper {
    position: relative;
    width: 100%;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-nav-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-nav-btn i {
    font-size: 14px;
}

.carousel-nav-btn.prev { left: -10px; }
.carousel-nav-btn.next { right: -10px; }

@media (max-width: 768px) {
    .carousel-nav-btn.prev { left: 0; }
    .carousel-nav-btn.next { right: 0; }
}

/* Hide map controls on specific small screen sizes */
@media screen and (max-width: 1028px) {
    .olControlLayerSwitcher,
    #mapTools,
    #bottomOverlay {
        display: none !important;
    }

    .olControlZoom {
        display: block !important;
        left: 10px !important;
        top: 80px !important; /* Below header/search if needed */
        z-index: 1006 !important;
    }

    #indexLegend {
        z-index: 2010 !important;
        pointer-events: auto !important;
    }

    /* Hide by default on mobile but allow toggle via .active class */
    #Legends {
        display: none !important;
        z-index: 2005 !important;
        position: absolute !important;
        bottom: 80px !important; /* Above FAB button */
        right: 15px !important;
        left: auto !important;
        width: 250px !important;
        height: auto !important;
        max-height: 60vh !important;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.15) !important;
        border-radius: 12px 12px 12px 12px !important;
        margin-bottom: 0px !important;
    }

    #Legends.active {
        display: block !important;
    }
}

footer {
    background-color: #d9d9d9;
    /* padding: 8px 20px; */
    padding: 0.7rem 1rem 0.7rem 0;
    font-size: 0.75rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    z-index: 2000;
    font-family: "hindregular", sans-serif;
    color: #000000;
    height: 40px;
}

footer div.text-center {
    flex: 1;
    text-align: center;
    font-size: 0.95rem;
}

footer a {
    color: #3b82f6;
    text-decoration: none;
    font-family: 'hindsemibold', sans-serif;
}

footer a:hover {
    text-decoration: underline;
    color: #2563eb;
}

footer .version {
    color: #64748b;
    font-size: 0.8rem;
    white-space: nowrap;
}

footer .version strong {
    font-family: 'hindsemibold', sans-serif;
    color: #1e293b;
}

@media (max-width: 768px) {
    footer {
        flex-direction: column;
        height: auto;
        padding: 10px 15px;
        gap: 5px;
        flex-shrink: 0;
    }
    
    #mapContainer {
        flex: 1; /* Keep taking available space */
    }

    #statsBar {
        display: -webkit-inline-box;
        gap: 10px;
        padding: 10px !important;
        max-height: 25vh;
        overflow-y: auto;
        width: 100%;
        margin: 0;
        border-radius: 0 !important;
    }

    #statsBar .stat-item {
        padding: 10px;
        flex: 1 1 140px;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    #statsBar .stat-value {
        font-size: 1.4rem;
    }

    #statsBar .stat-label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    div.olControlZoom {
        display: none !important;
    }
}
