/* Custom date range inputs */
[x-cloak] { display: none !important; }

/* Map page filter bar - column layout for multi-row support */
.map-page-layout .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

/* Filter bar row layout */
.filter-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.filter-bar-main {
    flex-wrap: wrap;
}

.filing-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* Short labels hidden by default */
.filter-btn-short {
    display: none;
}

/* The "All Time" state pill (CCT-409).
 *
 * Not a button: all-time is a window the backend GRANTS for a selective
 * search, never one the toolbar offers, so this reports state and cannot be
 * pressed. It borrows .filter-btn's look so the toolbar reads as one control,
 * and re-states the parts that came free from <button> — a <span> is inline,
 * so vertical padding would occupy no height — while undoing the two that
 * promise interactivity.
 */
.filter-btn-static {
    display: inline-flex;
    align-items: center;
    cursor: default;
}

.filter-btn-static:hover {
    color: var(--text-primary);
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.map-loading-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

/* Active search filters */
.active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.active-filters-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 13px;
    background: var(--ocean-tint);
    color: var(--primary-color);
    border-radius: 4px;
}

.filter-badge-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: var(--primary-color);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 150ms ease;
    position: relative;
}

.filter-badge-remove::after {
    content: '';
    position: absolute;
    inset: -14px;
}

.filter-badge-remove:hover {
    background: rgb(var(--primary-rgb) / 0.2);
}

.clear-all-filters {
    padding: 4px 10px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 150ms ease;
}

.clear-all-filters:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .filter-bar-main {
        gap: 8px;
    }

    /* Hide "Time Period:" label on mobile */
    .filter-bar .filter-label {
        display: none;
    }

    /* Show short button labels, hide full */
    .filter-btn-full {
        display: none;
    }
    .filter-btn-short {
        display: inline;
    }

    .filter-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Filing count wraps to its own line */
    .filing-count {
        margin-left: 0;
        width: 100%;
        order: 10;
    }

    .date-range-inputs {
        flex-wrap: wrap;
        width: 100%;
    }

    .date-input {
        flex: 1;
        min-width: 120px;
    }

    .active-filters {
        gap: 6px;
    }
}

.marker-cluster-custom {
    background: transparent;
}
.server-cluster-marker {
    cursor: pointer;
}
.cluster-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-weight: 600;
    font-size: 12px;
    box-shadow: 0 4px 12px rgb(var(--primary-rgb) / 0.3);
    transition: transform 200ms ease-out;
}
.cluster-marker:hover {
    transform: scale(1.05);
}
.cluster-small {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
}
.cluster-medium {
    width: 40px;
    height: 40px;
    background: var(--primary-hover);
    font-size: 14px;
}
.cluster-large {
    width: 50px;
    height: 50px;
    background: var(--primary-active);
    font-size: 16px;
}
.filing-marker {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgb(var(--primary-rgb) / 0.4);
}
.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    padding: 0;
    border: 1px solid var(--text-secondary);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
}

/* Enlarge tap target to 44x44 without changing visual size */
.help-btn::after {
    content: '';
    position: absolute;
    inset: -13px;
}
.help-btn:hover {
    background: var(--text-secondary);
    color: white;
}
/* Modal chrome comes from base.css — the help modal uses the global modal
   (CCT-82), whose z-index 3000 clears every Leaflet pane (max 1000). */
.popup-filing-link {
    display: block;
    color: var(--primary-color);
    text-decoration: none;
    padding: 4px 0;
    font-size: 13px;
    transition: color 150ms ease;
}
.popup-filing-link:hover {
    color: var(--primary-active);
    text-decoration: underline;
}
.popup-address {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 2px 0;
}
.popup-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.view-table-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--gray-100);
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 150ms ease;
}
.view-table-btn:hover {
    background: var(--gray-200);
}
