/*Legend-specific*/
.legend {
    padding: 6px 8px;
    font: 14px Arial, Helvetica, sans-serif;
    background: white;
    background: rgba(255, 255, 255, 0.8);
    /*box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);*/
    /*border-radius: 5px;*/
    line-height: 24px;
    color: #555;
  }
  .legend h4 {
    text-align: center;
    font-size: 16px;
    margin: 2px 12px 8px;
    color: #777;
  }
  
  .legend span {
    position: relative;
    bottom: 3px;
  }
  
  .legend i {
    width: 18px;
    height: 18px;
    float: left;
    margin: 0 8px 0 0;
    opacity: 0.7;
  }
  
  .legend i.icon {
    background-size: 18px;
    background-color: rgba(255, 255, 255, 1);
  }
  /* End Legend-specific */

  .scroll button {
    width: 35px;
    height: 35px;
    border: 2px solid grey;
    background-color: white;
    color: black;
    border-radius: 5px;
    font-size: 14px;
  }

/* Pool legend / status control */
.pool-legend {
    background: rgba(255,255,255,0.92);
    padding: 6px 10px;
    border-radius: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    font: 13px/1.6 Arial, Helvetica, sans-serif;
    color: #333;
}
.pool-legend-title {
    font-weight: 600;
    font-size: 12px;
    color: #555;
    margin-bottom: 2px;
}
.pool-legend-item {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.pool-legend-item svg {
    flex-shrink: 0;
}
label.pool-legend-toggle {
    cursor: pointer;
    user-select: none;
}
label.pool-legend-toggle:hover {
    background: rgba(0,0,0,0.04);
    border-radius: 3px;
}
.pool-legend-count {
    font-size: 11px;
    color: #888;
    margin-left: 2px;
}
.map-narrow .pool-legend-count {
    display: none;
}

/* Collapsible legend — toggle always visible so users can expand/collapse */
.pool-legend-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    color: #555;
    padding: 2px 0;
    user-select: none;
    border-bottom: 1px solid #ccc;
    margin-bottom: 4px;
    padding-bottom: 4px;
}
.pool-legend-arrow {
    font-size: 14px;
    transition: transform 0.2s;
}
.pool-legend-collapsible.collapsed .pool-legend-toggle-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 2px;
}
.pool-legend-collapsible.collapsed .pool-legend-arrow {
    transform: rotate(-90deg);
}
.pool-legend-collapsible.collapsed .pool-legend-body {
    display: none;
}

/* On narrow screens (mobile), constrain legend width */
@media (max-width: 768px) {
    .pool-legend-collapsible {
        max-width: 130px;
    }
}

.btn-disabled {
    background: #95a5a6;
    color: #7f8c8d;
    cursor: not-allowed;
    position: relative;
}

.btn-disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 47%,
        #e74c3c 47%,
        #e74c3c 53%,
        transparent 53%
    );
    pointer-events: none;
}

/* Map zoom toolbar — top-left of map (used by Pool Finder and Explore) */
.pf-zoom-bar {
    position: absolute; top: 10px; left: 10px; z-index: 1000;
    display: flex; gap: 6px;
}
.pf-zoom-btn {
    background: white; border: 2px solid rgba(0,0,0,0.2); border-radius: 4px;
    height: 40px; padding: 0 10px; display: flex; align-items: center; gap: 4px;
    cursor: pointer; font-size: 14px; font-weight: 600; color: #333;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2); white-space: nowrap;
    transition: color 0.15s;
}
.pf-zoom-btn i { font-size: 18px; }
.pf-zoom-btn:hover, .pf-zoom-btn:active { background: #e8f5e9; }

/* Standard zoom-button labeling, consistent across PoolFinder, Explore,
   and all map detail views:
     crosshair + fa-tint            → zoom to selected/visible pool(s)
     crosshair + fa-user            → zoom to my GPS location
     crosshair + .zoom-both-icons   → zoom to both pools and GPS
   The "both" icon nests fa-tint and fa-user inside a small circle so the
   button visually communicates that it encompasses both targets. */
.zoom-both-icons {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 2px 5px;
    border: 1.5px solid currentColor;
    border-radius: 9999px;
    line-height: 1;
}
.pf-zoom-btn .zoom-both-icons i { font-size: 12px; }

/* GPS button state colors */
.pf-zoom-btn.gps-acquiring { color: #f39c12; animation: gps-pulse 1.5s infinite; }
.pf-zoom-btn.gps-tracking { color: #27ae60; }
.pf-zoom-btn.gps-denied { color: #e74c3c; }
@keyframes gps-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* User GPS location marker — blue person glyph matching the GPS button,
   wrapped in a pulsing blue halo. Built as a single Leaflet divIcon by
   createUserLocationMarker() in /js/map_common.js. */
.user-loc-marker {
    background: transparent;
    border: none;
}
.user-loc-icon {
    position: relative;
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
}
.user-halo {
    position: absolute;
    top: 50%; left: 50%;
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 3px solid #4285F4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.35);
    transform-origin: center;
    animation: user-halo-pulse 1.4s ease-in-out infinite;
    pointer-events: none;
}
.user-loc-icon i {
    position: relative; z-index: 1;
    width: 28px; height: 28px;
    background: #4285F4; color: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    line-height: 1;
}
@keyframes user-halo-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(0.85); opacity: 1; }
    50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 0.45; }
}

/* Pulsing green halo for the single-selected (pinned) pool. The marker is
   positioned in the markerPane (above the canvas pool layer) but the inner
   ring is hollow so the pool marker remains fully visible through it. */
.pool-halo-marker {
    background: transparent;
    border: none;
    pointer-events: none;
}
.pool-halo {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 3px solid #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
    transform-origin: center;
    animation: pool-halo-pulse 1.4s ease-in-out infinite;
}
@keyframes pool-halo-pulse {
    0%, 100% { transform: scale(0.85); opacity: 1; }
    50%      { transform: scale(1.15); opacity: 0.45; }
}

/* Combined tooltip — surfaces info from every overlapping layer under the
   cursor in a single panel. Each row corresponds to one layer's tooltip
   content. See wireCombinedTooltip in /js/map_common.js. */
.combined-tooltip {
    background: white;
    border: 1px solid #888;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.35;
    color: #222;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    max-width: 280px;
    white-space: normal;
}
.combined-tooltip > div {
    padding: 2px 0;
}
.combined-tooltip > div + div {
    border-top: 1px solid #eee;
    margin-top: 2px;
    padding-top: 4px;
}