/*
 NDG Jobs Map CSS
 Version 1.0.8 - Cluster camera badge + popup photo UX; legend + styling
*/
.ndg-jobs-map-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 20px 0;
    position: relative;
}

/* Lightbox modal */
.ndg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ndg-lightbox.active { display: flex; }

.ndg-lightbox-content {
    max-width: min(96vw, 1200px);
    max-height: 92vh;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.ndg-lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 92vh;
    width: auto;
    height: auto;
}

.ndg-lightbox-close {
    position: absolute;
    top: 8px;
    right: 12px;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Cluster styling */
.ndg-cluster-wrapper {
    /* Leaflet will position this; keep class for specificity */
}

.ndg-cluster {
    background: #1976d2;
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    font-weight: 700;
}

.ndg-cluster.small { width: 36px; height: 36px; font-size: 13px; }
.ndg-cluster.medium { width: 44px; height: 44px; font-size: 14px; }
.ndg-cluster.large { width: 52px; height: 52px; font-size: 15px; }

.ndg-cluster-count { pointer-events: none; }

.ndg-cluster.has-photos {
    background: #2e7d32; /* green to echo photo pins */
}

.ndg-cluster-camera {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: #fff;
    color: #2e7d32;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    border: 1px solid rgba(0,0,0,0.06);
}

/* Map Legend */
.ndg-map-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    font-size: 14px;
}

.ndg-map-legend-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.ndg-map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.ndg-map-legend-pin {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.ndg-map-legend-pin.has-photos {
    background: #28a745;
}

.ndg-map-legend-pin.no-photos {
    background: #0066cc;
}

/* Search Bar */
.ndg-jobs-map-search {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ndg-jobs-map-search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.ndg-jobs-map-search-input:focus {
    outline: none;
    border-color: #0066cc;
}

.ndg-jobs-map-search-btn,
.ndg-jobs-map-reset-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ndg-jobs-map-search-btn {
    background: #0066cc;
    color: white;
}

.ndg-jobs-map-search-btn:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

/* Popup photo grid */
.ndg-job-popup-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.ndg-job-popup-photo {
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.ndg-job-popup-photo:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.ndg-job-popup-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
}

.ndg-jobs-map-reset-btn {
    background: #f5f5f5;
    color: #333;
}

.ndg-jobs-map-reset-btn:hover {
    background: #e0e0e0;
}

/* Map Container */
.ndg-jobs-map {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

/* Map Stats */
.ndg-jobs-map-stats {
    margin-top: 15px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.ndg-jobs-map-stats span {
    font-weight: 700;
    color: #0066cc;
}

/* Error Message */
.ndg-jobs-map-error {
    padding: 20px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: ##c33;
    text-align: center;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 280px;
}

/* Job Popup Card */
.ndg-job-popup {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ndg-job-popup-header {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    padding: 16px;
}

.ndg-job-popup-location {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.ndg-job-popup-address {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.ndg-job-popup-body {
    padding: 16px;
}

.ndg-job-popup-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: ##666;
    margin-bottom: 12px;
}

.ndg-job-popup-date::before {
    content: "📅";
}

.ndg-job-popup-service {
    display: inline-block;
    background: #e8f4fd;
    color: ##0066cc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Photo Gallery in Popup */
.ndg-job-popup-photos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.ndg-job-popup-photo {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.ndg-job-popup-photo:hover {
    transform: scale(1.05);
}

.ndg-job-popup-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox for Full-Size Photos */
.ndg-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.ndg-lightbox.active {
    display: flex;
}

.ndg-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.ndg-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.ndg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.ndg-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* County Breakdown Section */
.ndg-jobs-map-counties {
    margin-top: 30px;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ndg-jobs-map-counties h3 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    text-align: center;
}

/* Accordion headers for counties */
.ndg-county-section {
    border: 1px solid #eee;
    border-radius: 10px;
    margin: 12px 0;
    overflow: hidden;
    background: #fff;
}

.ndg-county-header {
    width: 100%;
.ndg-county-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: ##f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0066cc;
    transition: all 0.3s;
}

.ndg-county-item:hover {
    background: ##e8f4fd;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.ndg-county-name {
    font-weight: 600;
    color: ##333;
    font-size: 15px;
}

.ndg-county-count {
    font-size: 14px;
    color: ##666;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ndg-jobs-map-search {
        flex-direction: column;
    }
    
    .ndg-jobs-map-search-input {
        width: 100%;
    }
    
    .ndg-jobs-map {
        height: 400px !important;
    }
    
    .leaflet-popup-content {
        min-width: 240px;
    }
    
    .ndg-county-grid {
        grid-template-columns: 1fr;
    }
}