/* ========= Global Styles ========= */
body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f8f9fa;
  margin: 0;
}

main {
  flex: 1;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 800px;
}

/* ========= Header ========= */
header {
  background-color: #002855;
  color: white;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

header img {
  height: 50px;
}

nav {
  display: flex;
  gap: 20px;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

/* ========= Hamburger ========= */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}
.hamburger div {
  width: 25px;
  height: 3px;
  background: white;
}

/* ========= Sidebar ========= */
.sidebar {
  background: #002855; /* changed from white */
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100%;
  overflow-y: auto;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  display: none; /* hidden on desktop */
}

.sidebar.active {
  transform: translateX(0);
}

/* Sidebar close button */
.sidebar .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #fff;
  display: block;
}

/* Sidebar nav */
.sidebar ul {
  list-style: none;
  padding: 80px 20px 20px; /* space below close icon */
  margin: 0;
}

.sidebar ul li {
  margin: 20px 0;
}

.sidebar ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  display: block;
}

.sidebar ul li a:hover {
  color: #ffd700;
}


/* Sidebar overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out;
  z-index: 1000;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}



/* Sidebar nav should be vertical */
.sidebar nav {
  display: block;   /* override global flex */
  color: #fff;
}

.sidebar nav a {
  display: block;   /* force stacking */
  padding: 15px 20px;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
}

.sidebar nav a:hover {
  background: #004080;
}

.sidebar-header{
    padding-left:20px;
}

/* ========= Responsive ========= */
@media (max-width: 766px) {
  .desktop-nav { display: none; }   /* hide top nav */
  .hamburger { display: flex; }     /* show hamburger */
  .sidebar { display: block; }      /* sidebar usable */
  .close-btn { display: block; }    /* show X button */
}

@media (min-width: 767px) {
  .sidebar { display: none !important; } /* force hide on desktop */
}

/* ========= Footer ========= */
footer {
  background: #002855;
  color: white;
  text-align: center;
  padding: 15px;
  margin-top: auto;
}

/* ========= Table ========= */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  background: white;
}
table th, table td {
  padding: 12px;
  text-align: left;
  border: 1px solid #ddd;
}
table th {
  background: #002855;
  color: white;
}
tr:nth-child(even) {
  background: #f2f2f2;
}
.total-row {
  font-weight: bold;
  background: #e6f0ff;
}

/* ========= Buttons ========= */
.btns {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}
button {
  padding: 10px 20px;
  background: #002855;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}
button:hover {
  background: #004080;
}

/* ========= Loading Overlay ========= */
#loadingOverlay {
  display: none; /* JS will toggle this */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #002855;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}





#breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
}
#breadcrumb .sep {
  color: #888;
}
#breadcrumb .crumb {
  color: #666;
  cursor: pointer;
}
#breadcrumb .crumb.active {
  color: #0d6efd; /* Bootstrap primary blue */
  font-weight: bold;
}




.leaflet-popup-content {
  font-size: 14px;
  line-height: 1.4;
}

.leaflet-tooltip {
  font-size: 14px;
  font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .leaflet-popup-content {
    font-size: 16px;
  }

  .leaflet-tooltip {
    font-size: 16px;
  }
}




/* Make all map text and popups bigger */
  .leaflet-popup-content {
    font-size: 1rem; /* ~16px desktop */
    line-height: 1.5;
  }

  .leaflet-tooltip {
    font-size: 1rem;
    font-weight: 600;
    padding: 6px 10px;
  }

  /* Responsive adjustments for smaller screens */
  @media (max-width: 768px) {
    .leaflet-popup-content {
      font-size: 1.25rem; /* ~20px */
      line-height: 1.6;
    }

    .leaflet-tooltip {
      font-size: 1.25rem;
      padding: 8px 12px;
    }

    /* Optional: increase map padding so popups aren't clipped */
    #map {
      height: 95vh;
    }
  }
  
  
  
  /* Base style for tooltip */
.leaflet-tooltip {
  --tooltip-scale: 1;
  font-size: calc(1.5em * var(--tooltip-scale)) !important;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid #222;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  text-align: center;
  transition: all 0.2s ease;
}

.leaflet-popup-content {
  font-size: calc(1.2em * var(--tooltip-scale)) !important;
  line-height: 1.5;
}



  /* Make tooltips huge and readable */
  .leaflet-tooltip {
    font-size: 5em !important;     /* 5x the normal font size */
    font-weight: 900;              /* very bold */
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 15px 25px;
    border-radius: 12px;
    border: 2px solid #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    text-align: center;
    transform: scale(1);           /* ensures proper scaling */
  }

  /* Optional: equally boost popup readability */
  .leaflet-popup-content {
    font-size: 2em !important;
    line-height: 1.6;
    font-weight: 600;
  }

  /* Increase marker z-index to make tooltips sit clearly above them */
  .leaflet-tooltip-pane {
    z-index: 10000 !important;
  }

  /* Optional: add transition for smoother tooltip appearance */
  .leaflet-tooltip {
    transition: all 0.3s ease;
  }


