/**
 * WP Content Map - Popup Styles
 * Generic popup styling for map marker popups.
 */

/* ── Popup Base ── */
.wcm-popup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    padding: 15px;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ── Popup Title ── */
.wcm-popup-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    line-height: 1.3;
}

/* ── Popup Fields ── */
.wcm-popup-field {
    margin-bottom: 8px;
}

.wcm-popup-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.wcm-popup-value {
    display: block;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* ── Popup Excerpt ── */
.wcm-popup-excerpt {
    font-size: 13px;
    color: #555;
    max-height: 120px;
    overflow-y: auto;
    padding-right: 5px;
}

/* ── Grouping Value ── */
.wcm-popup-grouping {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: #e67e22;
    margin-bottom: 4px;
}

/* ── Current Post Indicator ── */
.wcm-popup-current {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: #2a7d2e;
    background-color: #eaf7eb;
    padding: 3px 8px;
    border-radius: 3px;
}

/* ── Read More Link ── */
.wcm-popup-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: #2271b1;
    text-decoration: none;
    margin-top: 4px;
}

.wcm-popup-link:hover {
    color: #135e96;
    text-decoration: underline;
}

/* ── Filter Bar ── */
.wcm-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}

.wcm-filter-bar + .wcm-map-container {
    border-radius: 0 0 5px 5px !important;
}

.wcm-filter-bar + .wcm-map-container .wcm-map {
    border-radius: 0 0 5px 5px !important;
}

/* Search input */
.wcm-filter-search {
    flex: 1;
    min-width: 180px;
    max-width: 300px;
}

.wcm-search-input {
    width: 100%;
    padding: 7px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}

.wcm-search-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Filter terms container */
.wcm-filter-terms {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* Button style */
.wcm-filter-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 20px;
    font-size: 13px;
    color: #50575e;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
}

.wcm-filter-btn:hover {
    background: #f0f0f1;
    border-color: #999;
}

.wcm-filter-btn.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Dropdown style */
.wcm-filter-dropdown {
    padding: 7px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    min-width: 180px;
}

/* Checkbox style */
.wcm-filter-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 13px;
    color: #50575e;
    cursor: pointer;
    white-space: nowrap;
}

.wcm-filter-count {
    color: #999;
    font-size: 12px;
}

/* ── Mobile Popup Overrides ── */
@media screen and (max-width: 767px) {
    .wcm-popup-mobile {
        overflow: hidden;
    }

    .wcm-popup-mobile .wcm-popup-title {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .wcm-popup-mobile .wcm-popup-field {
        margin-bottom: 6px;
    }

    .wcm-popup-mobile .wcm-popup-label {
        font-size: 11px;
        margin-bottom: 1px;
    }

    .wcm-popup-mobile .wcm-popup-excerpt {
        font-size: 12px;
        max-height: 100px;
        overflow-y: auto;
        padding-right: 5px;
    }

    .wcm-popup-mobile .wcm-popup-grouping {
        font-size: 12px;
    }
}

/* ── Filter Bar Mobile ── */
@media screen and (max-width: 767px) {
    .wcm-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px;
    }

    .wcm-filter-search {
        max-width: 100%;
    }

    .wcm-filter-terms {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .wcm-filter-btn {
        flex-shrink: 0;
        font-size: 12px;
        padding: 5px 12px;
    }

    .wcm-filter-dropdown {
        width: 100%;
    }
}
