/* Map-specific styles (MapLibre GL) */

.map-shell { position: relative; }
#map, .map-canvas {
    width: 100%;
    height: 70vh;
    min-height: 380px;
    background: #dfe9e6;
}
.map-full #map, .map-full .map-canvas { height: calc(100vh - 60px); }

/* Filter bar */
.map-filters {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
    padding: 12px 16px; background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.map-filters .filter { display: flex; flex-direction: column; gap: 4px; }
.map-filters label { font-size: .78rem; font-weight: 600; color: var(--color-muted); }
.map-filters select, .map-filters input {
    padding: .5em .7em; border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); font: inherit; background: #fff;
}
.map-filters .filter-check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 6px; }
.map-filters .filter-check label { font-size: .9rem; color: var(--color-text); }
.map-status { margin-left: auto; align-self: center; font-size: .85rem; color: var(--color-muted); }

/* Legend */
.map-legend {
    position: absolute; bottom: 16px; left: 16px; z-index: 5;
    background: rgba(255,255,255,.94); border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow);
    font-size: .8rem;
}
.map-legend .row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.dot-green  { background: #16a34a; }
.dot-blue   { background: #2563eb; }
.dot-yellow { background: #d97706; }
.dot-gray   { background: #6b7280; }

/* Custom markers */
.hb-marker {
    width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: pointer;
}
.hb-marker.has-photo { width: 20px; height: 20px; }
.hb-marker.status-verified  { background: #16a34a; }
.hb-marker.status-community  { background: #2563eb; }
.hb-marker.status-probable   { background: #d97706; }
.hb-marker.status-rejected, .hb-marker.status-historical { background: #6b7280; }

/* Cluster bubbles */
.hb-cluster {
    display: flex; align-items: center; justify-content: center;
    background: rgba(15,118,110,.92); color: #fff; font-weight: 700;
    border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35);
    cursor: pointer;
}

/* Popup / detail card (shared between desktop popup and mobile sheet) */
.sighting-card { font-family: var(--font); max-width: 260px; }
.sighting-card .sc-species { font-weight: 800; font-size: 1.05rem; margin: 0 0 2px; }
.sighting-card .sc-meta { color: var(--color-muted); font-size: .85rem; margin: 0 0 8px; }
.sighting-card .sc-thumb { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: #eef2f0; }
.sighting-card .sc-notes { font-size: .9rem; margin: 6px 0; }
.sighting-card .sc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sighting-card .sc-actions a, .sighting-card .sc-actions button {
    font-size: .82rem; padding: .4em .7em; border-radius: 6px; border: 1px solid var(--color-border);
    background: #fff; cursor: pointer; color: var(--color-text); text-decoration: none;
}
.sighting-card .sc-actions .primary { background: var(--color-primary); color: #fff; border-color: transparent; }

/* Mobile bottom sheet */
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    background: #fff; border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg);
    transform: translateY(110%); transition: transform .25s ease; padding: 16px 16px 24px;
    max-height: 70vh; overflow-y: auto;
}
.sheet.open { transform: translateY(0); }
.sheet .sheet-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 1.4rem; cursor: pointer; }

/* Migration timeline control */
.timeline {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    z-index: 6; background: rgba(255,255,255,.96); border: 1px solid var(--color-border);
    border-radius: 999px; padding: 8px 14px; display: flex; align-items: center; gap: 12px;
    box-shadow: var(--shadow); width: min(560px, calc(100% - 32px));
}
.timeline input[type=range] { flex: 1; }
.timeline .tl-play { border: 0; background: var(--color-primary); color: #fff; border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.timeline .tl-date { font-size: .82rem; font-weight: 600; min-width: 84px; text-align: center; }

@media (max-width: 820px) {
    #map, .map-canvas { height: 62vh; }
    .map-legend { font-size: .72rem; bottom: 84px; }
}
