/* ============================================================
   Locum State Jobs Map — Frontend Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Condensed:wght@300;400;600;700&display=swap');

/* Wrapper */
.lsjm-map-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0 24px;
    box-sizing: border-box;
}

/* Header */
.lsjm-map-header {
    text-align: center;
    margin-bottom: 24px;
}

.lsjm-map-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: #0d2340;
    margin: 0 0 8px;
    line-height: 1.2;
}

.lsjm-map-subtitle {
    font-size: 1rem;
    color: #5a6a82;
    margin: 0 0 16px;
}

.lsjm-map-total {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0d3b7a, #1a6ec5);
    color: #fff;
    padding: 10px 28px;
    border-radius: 50px;
    box-shadow: 0 4px 18px rgba(13, 59, 122, .28);
    margin-bottom: 8px;
}

.lsjm-map-total-num {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.lsjm-map-total-lbl {
    font-size: .85rem;
    font-weight: 500;
    opacity: .88;
}

/* Legend */
.lsjm-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 8px;
    font-size: .78rem;
    color: #6b7a95;
    font-weight: 500;
}

.lsjm-legend-gradient {
    width: 120px;
    height: 10px;
    border-radius: 6px;
    background: linear-gradient(90deg,
            #c9ddf5 0%,
            #7fb3e8 30%,
            #2a6db8 60%,
            #0d2b5e 100%);
}

/* Map container (D3 renders SVG inside here) */
.lsjm-map-container {
    position: relative;
    width: 100%;
    min-height: 300px;
}

/* Loading spinner */
.lsjm-map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 0;
    color: #6b7a95;
    font-size: .9rem;
}

.lsjm-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #d0ddf0;
    border-top-color: #1a4e96;
    border-radius: 50%;
    animation: lsjm-spin .8s linear infinite;
}

@keyframes lsjm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* SVG Map (D3-rendered) */
.lsjm-svg-map {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* State paths (fill set directly by D3 — solid colour) */
.lsjm-state {
    stroke: #00A5A2;
    stroke-width: 0.6;
    cursor: pointer;
    transition: filter .18s ease, stroke-width .12s ease;
    outline: none;
}

.lsjm-state:hover,
.lsjm-state:focus {
    filter: brightness(1.15) drop-shadow(0 2px 8px rgba(13, 43, 94, .45));
    stroke-width: 1.6;
    stroke: #00A5A2;
}

/* State border mesh (drawn as a single path over all states) */
.lsjm-state-borders {
    fill: none;
    stroke: #00A5A2;
    stroke-width: 0.8;
    stroke-linejoin: round;
    pointer-events: none;
}

/* State labels */
.lsjm-state-lbl {
    font-family: 'Roboto Condensed', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 400;
    fill: #000000;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none; /* Internal labels stay non-interactive */
    user-select: none;
    letter-spacing: .04em;
}

.lsjm-state-inset-lbl {
    font-family: 'Roboto Condensed', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 500;
    fill: #000000;
    cursor: pointer;
    pointer-events: auto;
    transition: fill .15s ease;
}

.lsjm-state-inset-lbl:hover {
    fill: #00A5A2;
    font-weight: 700;
}

/* Tooltip */
.lsjm-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    background: #444;
    color: #fff;
    border-radius: 12px;
    padding: 12px 18px;
    min-width: 160px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, .25),
        0 0 0 1px rgba(255, 255, 255, .12);
}

.lsjm-tooltip.lsjm-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lsjm-tooltip::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom: none;
    border-top-color: #727272;
}

.lsjm-tooltip-state {
    font-size: .78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .7);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.lsjm-tooltip-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 8px;
}

.lsjm-tooltip-count span {
    font-size: .85rem;
    font-weight: 400;
    opacity: .75;
    margin-left: 4px;
}

.lsjm-tooltip-link a {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    color: #7ec8f5;
    text-decoration: none;
    letter-spacing: .02em;
    border-bottom: 1px solid rgba(126, 200, 245, .35);
    padding-bottom: 1px;
    transition: color .15s;
}

.lsjm-tooltip-link a:hover {
    color: #a8daf9;
}

.lsjm-map-updated {
    text-align: right;
    font-size: .72rem;
    color: #9aa8bc;
    margin: 8px 0 0;
}

/* Responsive */
@media (max-width: 600px) {
    .lsjm-map-total {
        flex-direction: column;
        gap: 4px;
        padding: 10px 20px;
    }

    .lsjm-state-lbl {
        font-size: 10px;
        /* Increased from 7px so it remains readable when the SVG scales down */
    }

    .lsjm-tooltip {
        min-width: 130px;
        padding: 10px 14px;
    }

    .lsjm-tooltip-count {
        font-size: 1.2rem;
    }
}

@media (max-width: 767px) {
    .lsjm-map-wrapper.lsjm-hide-mobile {
        display: none !important;
    }
}