html, body {
    height: 100%;
    margin: 0;
    font-family: sans-serif;
    color: #ccc;
}

a, a:visited, a:hover, a:active {
    color: white;
    font-weight: bold;
    text-decoration: underline;
}
        
#logo-container {
    position: absolute;
    bottom: 10px;
    left: 0;
    z-index: 500;
}

#logo {
    height: 50px;
    width: 200px;
}

#map {
  position: absolute;
  top:    0;
  right:  0;
  bottom: 0;
  left:   0;
}

#info-panel {
    box-sizing: border-box;
    height: 100%;
    width: 0;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    background-color: #222;
    overflow-x: hidden;
    transition: width 0.5s ease-in-out, padding 0.5s ease-in-out;
    margin: 0;
    padding: 16px 0;
    box-shadow: -5px 0 5px -5px #333;
}

#close-btn, #expand-btn {
    position: absolute;
    top: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

#close-btn {
    right: 10px;
}

.image-container {
    position: relative;
}

#main-image {
    display: block;
    width: 100%;
    height: auto;
}

.expand-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.expand-btn img {
    width: 24px;
    height: 24px;
}

#close-btn img {
    width: 24px;
    height: 24px;
}
        
.meta {
    font-weight: bo900ld;
    text-transform: uppercase;
    color: #666;
}

.habitat p {
    padding: 8px 0 0 0;
    margin: 2px 0;
}
        
.habitat-list-heading, .habitat-key-heading {
    border-top: #666 solid 3px;
    margin: 12px 0 0 0;
    padding: 12px 0 0 0;
    color: #666;
    font-weight: 900;
    text-transform: uppercase;
}

.habitat-key {
    color: #666;
}

.habitat-name {
    /*white-space: nowrap;*/
}

.density {
    font-weight: 900;
    color: #fff;
}

.note {
    color: #666;
}

.about {
    border: 1px #666 solid;
    margin: 10px 0px;
    padding: 10px;
    color: #666;
}

.about a:link, .about a:visited, .about a:hover, .about a:active {
    color: #fff;
    text-decoration: none;
}

/* Button positioning */
#my-location {
    position: absolute;
    top: 80px;
    left: 12px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 2px;
    cursor: pointer;
    background-color: #fff;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    z-index: 501;
}

#draw-boundaries {
    position: absolute;
    top: 117px;
    left: 12px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 2px;
    cursor: pointer;
    background-color: #fff;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    z-index: 502;
}

#btn-habitats {
    position: absolute;
    left: 12px;
    top: 170px;
    width: 30px;
    height: 30px;
    background: #fff;
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
}

#btn-substrates {
    position: absolute;
    left: 12px;
    top: 206px;
    width: 30px;
    height: 30px;
    background: #fff;
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
}

#reset {
    position: absolute;
    left: 12px;
    top: 242px;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
}

#btn-habitats img, #btn-substrates img { 
    width: 20px; 
    height: 20px; 
    filter: none; 
}

#btn-habitats.active { 
    background: #b54fff; 
}

#btn-habitats.active img { 
    filter: brightness(0) invert(1); 
}

#btn-substrates.active { 
    background: #bf7500; 
}

#btn-substrates.active img { 
    filter: brightness(0) invert(1); 
}

/* Custom marker styles scoped to the unique class */
.my-custom-marker .my-custom-marker-circle {
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 0 5px 2px black;
    border: 1px solid black;
    transform: translate(-50%, -50%);
    position: relative;
}

.leaflet-left .leaflet-control-scale {
    margin-left: 210px;
}

.leaflet-bottom .leaflet-control-scale {
    margin-bottom: 22px;
}

#image-overlay {
    flex-direction: column;
}

.caption {
    height: 1rem;
    color: #666;
}

.caption a:link, .caption a:visited, .caption a:hover, .caption a:active {
    color: #fff;
    text-decoration: none;
}

/* Selected marker highlight for base SVG pins and thumbnails */
.selected-marker, .sf-marker.selected-marker svg circle {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45));
}

.custom-thumbnail.selected-marker img {
  border-color: transparent !important;
  box-shadow: 0 0 0 20px var(--sf-colour, currentColor) !important;
}

/* Panel theme */
#info-panel { 
    background: #222; 
    color: #f5f5f5; 
}

#info-panel a { 
    color: #9cd6ff; 
}

#info-panel .meta, #info-panel .meta-row { 
    color: #f5f5f5; 
}

/* Base pins: emulate a ring by increasing stroke width */
.svg-marker-icon { 
    filter: none; 
}

.sf-marker.selected-marker svg circle {
  stroke: #fff;
  stroke-width: 4;
}

/* Keep the panel visible styling */
#info-panel.open {
  position: fixed;
  right: 0;
  top: 0;
  width: min(420px, 90vw);
  max-width: 90vw;
  height: 100vh;
  background: #222;
  color: #f5f5f5;
  box-shadow: 0 0 12px rgba(0,0,0,0.25);
  z-index: 99999;
  display: block;
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 12px;
}

/* Overrides to remove drop-shadow and use color rings without shifting */
.selected-marker { 
    filter: none !important; 
}

.sf-marker.selected-marker svg { 
    filter: none !important; 
}

.sf-marker.selected-marker svg circle { 
    filter: none !important; 
}

/* Base pin ring: centered, uses the same color via CSS variable */
.sf-marker { 
    border-radius: 50%; 
}

.sf-marker.selected-marker { 
    box-shadow: 0 0 0 14px var(--sf-colour, currentColor) !important; 
}

/* Density control */
#density-control { 
    position: fixed !important;
    left: 52px !important;
    top: 12px !important;
    z-index: 2000 !important;
    width: 260px; 
    background: #fff; 
    color: #111; 
    border-radius: 4px; 
    box-shadow: 0 1px 4px rgba(0,0,0,.3); 
    overflow: visible; 
    font: 13px/1.3 sans-serif;
    display: none;
    pointer-events: auto !important;
}

#density-control .dc-buttons { 
    display: none !important; 
}

#density-control .dc-btn { 
    appearance: none; 
    border: 1px solid #ddd; 
    background: #fff; 
    padding: 6px; 
    border-radius: 4px; 
    cursor: pointer; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
}

#density-control .dc-btn img { 
    display: block; 
    width: 20px; 
    height: 20px; 
}

/* Headers per section */
#density-control .dc-header { 
    cursor: pointer; 
    padding: 8px 10px; 
    font-weight: 700; 
    color: #fff; 
}

#density-control .dc-header.purple { 
    background: #b54fff; 
}

#density-control .dc-header.orange { 
    background: #bf7500; 
}

/* Body: no scroll limit so full list can show */
#density-control .dc-body { 
    display: none; 
    padding: 8px 10px; 
    max-height: none; 
    overflow: visible; 
}

#density-control .dc-body.open { 
    display: block; 
}

/* Items + custom radios */
#density-control .dc-item { 
    padding: 6px 0; 
    cursor: pointer; 
    color: #111; 
}

#density-control .dc-item label { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: #111; 
}

#density-control .dc-item input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: none !important;
  outline: none !important;
  background: #fff;
  border-radius: 50%;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  box-shadow: none !important;
}

#dc-biogenic .dc-item input[type="radio"]:checked::after,
#dc-substrate .dc-item input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

#dc-biogenic .dc-item input[type="radio"]:checked::after { 
    background: #b54fff; 
}

#dc-substrate .dc-item input[type="radio"]:checked::after { 
    background: #bf7500; 
}

#density-control .dc-footer { 
    display: none; 
}

#density-control .dc-none { 
    cursor: pointer; 
    color: #0077cc; 
    text-decoration: underline; 
}

/* Color entire section menus */
#dc-biogenic { 
    background: #b54fff; 
    color: #fff; 
}

#dc-substrate { 
    background: #bf7500; 
    color: #fff; 
}

#dc-biogenic .dc-item label, #dc-substrate .dc-item label { 
    color: #fff; 
}

/* Map mode visibility */
body:not(.sf-thumbs-mode):not(.sf-density-mode) .marker-cluster,
body:not(.sf-thumbs-mode):not(.sf-density-mode) .svg-marker-icon {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Hide clusters and base markers when density mode is active */
.sf-density-mode .marker-cluster,
.sf-density-mode .svg-marker-icon,
.sf-density-mode .custom-thumbnail {
  display: none !important;
  pointer-events: none !important;
}

/* Thumbs mode: hide clusters and base pins, keep thumbnails visible */
.sf-thumbs-mode .marker-cluster,
.sf-thumbs-mode .svg-marker-icon {
  display: none !important;
  pointer-events: none !important;
}

/* Cluster marker style: white background with #222 border and text */
.marker-cluster,
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large { 
    background: transparent !important; 
}

.marker-cluster div {
  background: #fff !important;
  border: 2px solid #222 !important;
  color: #222 !important;
}

.marker-cluster span { 
    color: #222 !important; 
}

/* Remove pseudo-element rings and forced outlines/shadows on base markers */
.leaflet-marker-icon::before,
.leaflet-marker-icon::after,
.svg-marker-icon::before,
.svg-marker-icon::after,
.sf-marker::before,
.sf-marker::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Ensure marker containers don't show inherited box-shadows */
.svg-marker-icon,
.sf-marker {
    box-shadow: none !important;
    outline: none !important;
}

/* Keep halo clean */
.leaflet-marker-icon .sf-halo {
    box-shadow: none !important;
    outline: none !important;
}

/* Remove default borders from all density markers and their children */
.sf-density-icon,
.sf-density-icon *,
.sf-density-pin,
.sf-density-halo {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Z-index layering: habitat markers on top of substrate markers */
.sf-density-icon[style*="181,79,255"] {
    z-index: 200 !important;
}

.sf-density-icon[style*="191,117,0"] {
    z-index: 100 !important;
}

/* Transparency for sparse and moderate density markers */
.sf-density-icon[data-density*="Sparse"],
.sf-density-icon[data-density*="sparse"] {
    opacity: 0.75 !important;
}

.sf-density-icon[data-density*="Moderate"],
.sf-density-icon[data-density*="moderate"] {
    opacity: 0.75 !important;
}

/* Dense markers remain fully opaque */
.sf-density-icon[data-density*="Dense"],
.sf-density-icon[data-density*="dense"] {
    opacity: 1 !important;
}

/* Selection styling for density markers - habitat markers (purple) */
.sf-density-icon[style*="181,79,255"].selected,
.sf-density-icon[style*="181,79,255"].selected .sf-density-pin,
.sf-density-icon[style*="181,79,255"].selected .sf-density-halo {
    border: 3px solid #b54fff !important;
    border-radius: 50% !important;
    box-shadow: 0 0 8px rgba(181, 79, 255, 0.8) !important;
}

/* Selection styling for density markers - substrate markers (orange) */
.sf-density-icon[style*="191,117,0"].selected,
.sf-density-icon[style*="191,117,0"].selected .sf-density-pin,
.sf-density-icon[style*="191,117,0"].selected .sf-density-halo {
    border: 3px solid #bf7500 !important;
    border-radius: 50% !important;
    box-shadow: 0 0 8px rgba(191, 117, 0, 0.8) !important;
}

/* Fallback selection styling for any density icon */
.sf-density-icon.selected {
    border: 3px solid #b54fff !important;
    border-radius: 50% !important;
    box-shadow: 0 0 8px rgba(181, 79, 255, 0.8) !important;
}

