/* Leaflet map containers and calibration page layout. */

.map-canvas {
    height: 65vh;
    min-height: 320px;
    border-radius: 0.5rem;
    background: #0a0d12;
    margin-bottom: 1.25rem;
}

.container-wide {
    max-width: 80rem;
}

.calibration-grid {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) minmax(20rem, 1.4fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 60rem) {
    .calibration-grid {
        grid-template-columns: 1fr;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.click-info {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* --- Public map page --- */

.map-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3rem;
    z-index: 1100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    background: rgba(16, 20, 26, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.map-header-title {
    font-weight: 700;
}

.map-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.map-fullscreen {
    position: fixed;
    top: 3rem;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0d12;
}

.map-empty {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem 1.5rem;
}

.map-crosshair {
    cursor: crosshair;
}

.btn-active {
    outline: 2px solid var(--accent);
}

.marker-panel {
    position: fixed;
    top: 3.75rem;
    right: 0.75rem;
    width: 21rem;
    max-width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    background: var(--panel);
    border-radius: 0.5rem;
    padding: 1.25rem;
    z-index: 1200;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: var(--bg);
    color: var(--text);
}

/* Leaflet popups on the dark theme */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--panel);
    color: var(--text);
}

.marker-popup p {
    margin: 0.5rem 0;
}

.marker-popup-category {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.marker-popup-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    display: inline-block;
}

.marker-popup-coords {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.marker-popup-hidden {
    color: #ffb020;
    font-size: 0.8rem;
    margin-top: 0.35rem;
    font-weight: 600;
}

.marker-popup-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

/* --- Filter panel --- */

.filter-panel {
    position: fixed;
    top: 3rem;
    left: 0;
    bottom: 0;
    width: 20rem;
    max-width: 85vw;
    overflow-y: auto;
    background: rgba(16, 20, 26, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1150;
    padding: 1rem;
    transition: transform 0.2s ease;
}

.filter-panel-hidden {
    transform: translateX(-100%);
}

.filter-search input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: var(--bg);
    color: var(--text);
}

.filter-count {
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.filter-group {
    margin-bottom: 0.75rem;
}

.filter-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    cursor: pointer;
}

.filter-category-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0 0.25rem 0.5rem;
}

.filter-group .filter-category-row {
    padding-left: 1.5rem;
}

.filter-category-row label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.filter-category-row label span:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-category-count {
    font-size: 0.8rem;
}

.filter-expand {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 0 0.25rem;
}

.filter-expand:hover {
    color: var(--text);
}

.filter-marker-list {
    list-style: none;
    padding-left: 2.5rem;
    margin: 0.15rem 0 0.35rem;
}

.filter-group .filter-marker-list {
    padding-left: 3.5rem;
}

.filter-marker-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.15rem 0;
}

.filter-marker-name {
    background: none;
    border: none;
    color: var(--text);
    padding: 0;
    text-align: left;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-marker-name:hover {
    color: var(--accent);
    text-decoration: underline;
}

.filter-marker-off .filter-marker-name {
    color: var(--muted);
    text-decoration: line-through;
}
