html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
    position: relative;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

.info-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 300px;
    opacity: 0.85;
}

.info-panel h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.info-panel-content {
    margin-top: 10px;
    max-height: 500px;
    overflow: hidden;
    transition:
        max-height 0.3s ease-out,
        opacity 0.3s ease-out;
}

.info-panel.collapsed .info-panel-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.info-panel p {
    margin: 5px 0;
    font-size: 12px;
    color: #333;
}

.toggle-btn {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.collapsed .toggle-btn {
    transform: rotate(-90deg);
}

.status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status.connected {
    background-color: #4caf50;
}

.status.disconnected {
    background-color: #f44336;
}

.legend {
    position: absolute;
    bottom: 90px;
    left: 10px;
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0.9;
}

.legend h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.legend-content {
    margin-top: 10px;
    max-height: 500px;
    overflow: hidden;
    transition:
        max-height 0.3s ease-out,
        opacity 0.3s ease-out;
}

.legend.collapsed .legend-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
    font-size: 12px;
}

.legend-color {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    border: 1px solid #ccc;
}

.error-message {
    background: #f44336;
    color: white;
    padding: 10px;
    text-align: center;
    font-size: 14px;
}

.raster-overlay {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgb(0, 77, 64);
    color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0.99;
    display: flex;
    flex-direction: column;
}

.tabs {
    display: flex;
    background: rgb(0, 77, 64);
    overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    align-items: center;
}

.bottom-sheet-toggle {
    margin-left: auto;
    padding: 10px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    color: white;
}

.bottom-sheet-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bottom-sheet.collapsed .bottom-sheet-toggle .toggle-btn {
    transform: rotate(-90deg);
}

.bottom-sheet-content {
    height: 0;
    overflow: hidden;
    transition:
        height 0.3s ease-out,
        opacity 0.3s ease-out;
    opacity: 0;
}

.bottom-sheet-content.open {
    height: 50vh;
    opacity: 1;
    overflow-y: auto;
}

.bottom-sheet.collapsed .bottom-sheet-content {
    height: 0 !important;
    opacity: 0 !important;
}

.tab-button {
    padding: 20px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-button.active {
    color: white;
    border-bottom-color: white;
    background: rgba(255, 255, 255, 0.1);
}

.tab-content {
    padding: 20px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: white;
}

.tab-panel h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
    color: white;
}

.tab-panel details {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-panel details:last-child {
    border-bottom: none;
}

.tab-panel summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
    list-style: none;
}

.tab-panel summary::-webkit-details-marker {
    display: none;
}

.tab-panel summary::after {
    content: "▼";
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 10px;
    transition: transform 0.3s ease;
    transform: rotate(-90deg);
}

.tab-panel details[open] summary::after {
    transform: rotate(0deg);
}

.tab-panel summary:hover {
    color: rgba(255, 255, 255, 0.8);
}

.inline-icon {
    height: 1.2em;
    width: auto;
    vertical-align: middle;
    margin-right: 4px;
}

.tip-box {
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 4px solid rgba(255, 255, 255, 0.5);
    padding: 10px 15px;
    border-radius: 4px;
}

.tab-panel p {
    margin: 10px 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.tab-panel ul {
    margin: 10px 0;
    padding-left: 25px;
    line-height: 1.8;
}

.tab-panel li {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 5px 0;
}

.tab-panel a {
    color: #80deea;
    text-decoration: none;
}

.tab-panel a:hover {
    text-decoration: underline;
    color: #b2ebf2;
}

.logo-container {
  display: flex;
  flex-wrap: wrap;        /* allows wrapping on small screens */
  gap: 24px;
  align-items: flex-start;
}

.logo-container figure {
  margin: 0;
  flex: 1 1 180px;        /* equal importance, wrap naturally */
  text-align: left;
}

.logo-container img {
  max-width: 180px;
  height: auto;
  display: block;
}

.logo-container figcaption {
  margin-top: 0.5em;
  font-size: 0.8em;
}

/* === Alert popup overlay === */
#alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000; /* higher than Leaflet controls */
  display: none;
  align-items: center;
  justify-content: center;
}

#alert-overlay.show {
  display: flex;
}

#alert-popup {
  background: #fff;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  padding: 1.5em;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
}

#alert-content {
  overflow-y: auto;
}

#alert-close {
  align-self: flex-end;
  margin-top: 1em;
  padding: 0.6em 1.4em;
  font-size: 1em;
  background: #2e7d32;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#alert-close:hover {
  background: #256528;
}





/* ===== Carousel ===== */
.carousel {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  height: 340px;
  font-family: sans-serif;
}

/* Hide radios */
.carousel input {
  display: none;
}

/* Slides */
.slide {
  position: absolute;
  inset: 0;
  display: none;
}

/* Show active slide */
#s1:checked ~ .slide:nth-of-type(1),
#s2:checked ~ .slide:nth-of-type(2),
#s3:checked ~ .slide:nth-of-type(3),
#s4:checked ~ .slide:nth-of-type(4),
#s5:checked ~ .slide:nth-of-type(5) {
  display: block;
}

/* Image wrapper */
.image-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.image-wrap img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* Caption overlay */
.caption {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Navigation arrows */
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 34px;
  color: white;
  background: rgba(0,0,0,0.4);
  padding: 8px 14px;
  cursor: pointer;
  user-select: none;
  z-index: 2;
}

.prev { left: 8px; }
.next { right: 8px; }

/* Dots */
.dots {
  position: absolute;
  bottom: -8px;
  width: 100%;
  text-align: center;
}

.dots label {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #ccc;
  border-radius: 50%;
  margin: 0 4px;
  cursor: pointer;
}

#s1:checked ~ .dots label[for="s1"],
#s2:checked ~ .dots label[for="s2"],
#s3:checked ~ .dots label[for="s3"],
#s4:checked ~ .dots label[for="s4"],
#s5:checked ~ .dots label[for="s5"] {
  background: #333;
}

/* 📱 Mobile tightening */
@media (max-width: 600px) {
    .bottom-sheet-content.open {
        height: 60vh;
    }

    .tab-button {
        padding: 24px 8px;
        font-size: 13px;
    }

    .bottom-sheet-toggle {
        padding: 24px 8px;
    }

    .legend {
        bottom: 100px;
    }

    .tab-content {
        padding: 15px;
    }

    .tab-panel h3 {
        font-size: 16px;
    }

    .tab-panel h4 {
        font-size: 15px;
    }

    .tab-panel p,
    .tab-panel li {
        font-size: 13px;
    }
    
      .carousel {
    height: 260px;
  }

  .image-wrap img {
    max-height: 200px;
  }

  .nav {
    display: block;
    opacity: 0.25;          /* faint but visible */
    pointer-events: auto;  /* tappable */
  }

  .caption {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
}
