/* 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;
}

.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: rgba(8, 145, 178, 0.1);
    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: rgba(8, 145, 178, 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 rgba(8, 145, 178, 0.3);
    transition: transform 200ms ease-out;
}
.cluster-marker:hover {
    transform: scale(1.05);
}
.cluster-small {
    width: 30px;
    height: 30px;
    background: #0891b2;
}
.cluster-medium {
    width: 40px;
    height: 40px;
    background: #0e7490;
    font-size: 14px;
}
.cluster-large {
    width: 50px;
    height: 50px;
    background: #0c5e72;
    font-size: 16px;
}
.filing-marker {
    width: 20px;
    height: 20px;
    background: #0891b2;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 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-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    margin: 20px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: var(--text-primary);
}
.modal-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.modal-content p:last-child {
    margin-bottom: 0;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.modal-close:hover {
    background: #f5f5f4;
}
.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: #0c5e72;
    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);
}
