/* Provider Locator Styles */

#heroMap {
    display: flex;
    justify-content: center;
}

p:empty {
    display: none;
}

.pd_wrapper {
    max-width: 1320px;
    margin: 0 auto;
}

.minimap-wrapper {
    background-color: #F7FBFF;
}

.provider-container_single {
    background-color: #F7FBFF;
}

.pd-add {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.pd-add p {
    margin: 0;
}

#miniMap .pd-add svg {
    width: 16px;
    height: 16px;
}

/* Force inline mini-map SVGs to the requested size */
#miniMap svg {
    width: 100% !important;
    height: clamp(300px, 40vw, 500px) !important;
    max-width: 100%;
}



/* inline SVG state abbreviation labels (inside SVG paths or <text> elements) */
.svg-state-label {
    fill: #103B5D;
    font-weight: 300 !important;
    pointer-events: none;
    font-size: 8px !important;
    font-family: 'Poppins', Sans-serif;
}

/* White label text for states with provider counts */
.svg-state-label.has-count-label,
#heroMap .svg-state-label[fill="#FFFFFF"] {
    fill: #FFFFFF !important;
}

/* Leaflet label box style for hero map */
.state-label {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 8px;
    border-radius: 4px;
    font-weight: 300 !important;
    font-size: 8px;
    color: #103B5D;
    border: 1px solid rgba(10, 31, 61, 0.06);
    box-shadow: 0 4px 12px rgba(9, 20, 40, 0.05);
}

.provider-locator-wrapper {
    /* background: #f7f9fc; */
    min-height: 100%;
    font-family: 'Poppins', Sans-serif;
}

/* Zip / postal search input */
.page-header input#postacode,
.page-header .postal-input {
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 280px;
    max-width: 100%;
    font-size: 15px;
    margin-right: 12px;
    background: #ffffff;
    color: #0b2236;
    z-index: 10003;
    position: relative;
    display: inline-block;
}

#searchButton {
    padding: 12px 18px;
    background: #3456F5;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

#searchButton:hover {
    background: #1d4ed8;
}

/* Navigation removed — styles intentionally omitted */

/* State abbreviation labels */
.state-label {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9em;
    color: #103B5D;
    border: 1px solid rgba(10, 31, 61, 0.06);
    box-shadow: 0 4px 12px rgba(9, 20, 40, 0.05);
}

.provider-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background-color: #E7EEF3;
}

.page-header {
    padding: 30px;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    /* ensure header elements sit above map overlays */
    z-index: 10002;
}

/* visible label for postal input */
.page-header .postal-label {
    color: #103B5D;
    font-weight: 600;
    margin-right: 8px;
    font-size: 0.95em;
}

/* hide inline svg labels inside mini-map & state-level maps (only show on USA hero map) */
#miniMap .svg-state-label,
#map .svg-state-label {
    display: none !important;
}

#heroMap svg path.has-count .state-label {
    color: white;
}

/* hero map: paths that have provider counts get blue on hover/active */
#heroMap svg path.has-count:hover,
#heroMap svg [data-has-count="true"]:hover {
    fill: #3456F5 !important;
    transition: fill 0.15s ease;
}

#heroMap svg path.has-count.active,
#heroMap svg [data-has-count="true"].active {
    fill: #3456F5 !important;
    stroke: #3456F5 !important;
    transition: fill 0.15s ease, stroke 0.15s ease;
}

/* also apply to single-country map when it represents the USA */
#map svg path.has-count:hover,
#map svg path.has-count.active {
    fill: #3456F5 !important;
}

.page-header h1 {
    color: #103B5D;
    font-size: 2.8em;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.page-header p {
    color: #64748b;
    font-size: 1.05em;
    line-height: 1.6;
}

.hero-section {
    background-size: cover;
    background-position: center;
    height: 380px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 60px;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 31, 61, 0.7) 0%, rgba(10, 31, 61, 0.4) 100%);
    z-index: 1;
}

.hero-section h1,
.hero-section p {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    color: white;
    font-size: 3.5em;
    margin-bottom: 18px;
    font-weight: 300;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 2px;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.15em;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.3);
    max-width: 600px;
}

#heroMapSection {
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    overflow: hidden;
}

#heroMap {
    height: clamp(300px, 40vw, 500px) !important;
    background: transparent;
    position: relative;
}

.leaflet-container {
    background: #eef2f7 !important;
    font-family: "Poppins", Sans-serif;
}

.leaflet-control-zoom,
.leaflet-control-attribution,
.leaflet-control {
    display: none !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    display: none !important;
}

.leaflet-tile-pane {
    display: none !important;
}

.minimap-wrapper {
    display: none;
}

.minimap-wrapper.active {
    display: block;
}

#miniMapSection,
#mapSection {
    /* display: none; */
    background: #F7FBFF;
    border-radius: 0;
    padding-bottom:50px;
}

/* #miniMapSection.active,
#mapSection.active {
    display: block;
} */

.section-header {
    background: #F7FBFF;
    padding: 40px 60px 30px;
}

.section-title {
    color: #103B5D;
    font-size: 1.4em;
    margin: 0;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.mini-map-container,
.map-container {
    display: flex;
    gap: 0;
    align-items: center;
}

#miniMapWrapper,
#mapWrapper {
    flex: 1;
    padding: 50px 60px;
    background: #F7FBFF;
}

#miniMap,
#map {
    height: 550px;
    background: transparent;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    /* border: 1px solid #d9e2ec; */
}

/* map SVG path base styling (applies to hero, mini and single maps) */
#map svg path,
#heroMap svg path,
#miniMap svg path {
    fill: #D0DDE7;
    stroke: #D0DDE7;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.2s ease;
}

/* remove any overlay backgrounds that obscure SVG visuals */
.leaflet-container,
#heroMap,
#miniMap,
#map {
    background: transparent !important;
}

/* pin overlay for SVG maps */
.svg-pin-overlay {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    /* allow SVG pointer events; pins will enable pointer-events */
}

.svg-pin {
    position: absolute;
    width: 28px;
    height: 28px;
    pointer-events: auto;
    transform: translate(-50%, -100%);
    cursor: pointer;
}


/* label style for inline svg state abbreviations */
.svg-state-label {
    fill: #103B5D;
    font-weight: 600;
    font-family: 'Poppins', Sans-serif;
    pointer-events: none;
    transition: fill 0.15s ease;
}

/* make pin styles specific to maps so they override generic map path rules */
.custom-pin {
    width: 50px;
    height: 50px;
    position: relative;
    animation: pinDrop 0.5s ease-out;
}

.custom-pin .pin-inner svg path {
    width: 50px !important;
    height: 50px !important;
    transition: all 0.3s ease;
    fill: #656E74 !important;
    stroke: #F7FBFF !important;
}

.custom-pin.active .pin-inner svg path {
    fill: #3456F5 !important;
    stroke: #F7FBFF !important;
}

.custom-pin.hover .pin-inner svg path {
    fill: #3456F5 !important;
    stroke: #F7FBFF !important;
}


@keyframes pinDrop {
    0% {
        transform: translateY(-50px) scale(0);
        opacity: 0;
    }

    50% {
        transform: translateY(10px) scale(1.1);
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}



.custom-pin:hover {

    z-index: 1000 !important;
}



/* make inline svg fit their container */
#heroMap svg,
#miniMap svg,
#map svg {
    width: 100%;
    height: clamp(300px, 40vw, 500px) !important;
    display: block;
}

#miniMap svg path {
    fill: #D0DDE7 !important;
    stroke: #D0DDE7 !important;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.2s ease;
}

/* Ensure custom pins inside maps take priority over generic map path rules */
#heroMap .custom-pin .pin-inner svg path,
#miniMap .custom-pin .pin-inner svg path,
#map .custom-pin .pin-inner svg path {
    /* keep same pin appearance but scoped inside each map container */
    fill: #656E74 !important;
    stroke: #F7FBFF !important;
}

#heroMap .custom-pin.active .pin-inner svg path,
#miniMap .custom-pin.active .pin-inner svg path,
#map .custom-pin.active .pin-inner svg path,
#heroMap .custom-pin.hover .pin-inner svg path,
#miniMap .custom-pin.hover .pin-inner svg path,
#map .custom-pin.hover .pin-inner svg path {
    fill: #3456F5 !important;
    stroke: #F7FBFF !important;
}

/* Canada map: custom pin active position */
#map[data-country="canada"] .custom-pin {
        position: absolute;
    left: 339.164px !important;
    top: 468.606px !important;
}

/* interactive shapes in SVG */
svg [data-slug],
svg [data-state],
svg [id] {
    transition: fill 0.2s ease, stroke 0.2s ease;
}

/* Only apply hover effects to states with provider counts */
#heroMap svg [data-has-count="true"]:hover,
#map svg [data-has-count="true"]:hover {
    opacity: 1;
    filter: brightness(1);
}

/* States without providers should not have hover effects */
#heroMap svg [data-has-count="false"] {
    pointer-events: none;
}

svg .selected-state {
    fill: #1d4ed8 !important;
    stroke: #1d4ed8 !important;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.7);
    }

    50% {
        box-shadow: 0 4px 30px rgba(37, 99, 235, 0.9);
    }
}

#providerSidebar {
    width: 450px;
    background: #E7EEF3;
    overflow-y: auto;
    max-height: 680px;
    height:100%;
}

.sidebar-header {
    padding: 30px;
    background: #E7EEF3;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h3 {
    color: #103B5D;
    margin: 0;
    font-size: 1.15em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-content {
    padding: 25px;
}

.provider-card {
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid #D0DDE7;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.btn-view {
    background-color: #3456F5;
    color: #F7FBFF;
    border-radius: 3px;
    padding: 10px 16px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none !important;
    font-family: 'Poppins', Sans-serif;
    font-size: 14px;
}

.btn-view:hover {
    background-color: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: #F7FBFF;
}

.provider-card:nth-child(1) {
    animation-delay: 0.05s;
}

.provider-card:nth-child(2) {
    animation-delay: 0.1s;
}

.provider-card:nth-child(3) {
    animation-delay: 0.15s;
}

.provider-card:nth-child(4) {
    animation-delay: 0.2s;
}

.provider-card:nth-child(5) {
    animation-delay: 0.25s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.provider-card:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, .15);
    transform: translateX(4px);
}

.provider-card h4 {
    color: #103B5D;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.provider-card .location-icon {
    color: #64748b;
    font-size: 0.9em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.provider-card .location-icon::before {
    content: '📍';
    font-size: 1em;
}

.provider-card .address {
    color: #103B5D;
    line-height: 1.6;
    font-size: 0.92em;
}

.s_add {
    margin-bottom: 10px;
}

.provider-card .address a {
    color: #103B5D;
    line-height: 1.6;
    font-size: 0.92em;
}

.provider-card .btn {
    display: inline-block;
    background: #3456F5;
    color: white;
    padding: 10px 24px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.88em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.provider-card .btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
    font-size: 0.98em;
}

.legend {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: white;
    padding: 18px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    border: 1px solid #e2e8f0;
}

.legend-title {
    font-weight: 600;
    color: #103B5D;
    margin-bottom: 12px;
    font-size: 0.88em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.88em;
    color: #103B5D;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading,
.no-data,
.info,
.error {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 0.95em;
}

.error {
    color: #dc2626;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    position: relative;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.loading-spinner::before {
    width: 50px;
    height: 50px;
    border: 4px solid #e8edf3;
    border-top-color: #3456F5;
    animation: spin 1s linear infinite;
}

.loading-spinner::after {
    width: 50px;
    height: 50px;
    border: 4px solid transparent;
    border-top-color: #60a5fa;
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Additional Enhancements */
body .provider-locator-wrapper {
    margin: 0;
    padding: 0;
}

.leaflet-pane {
    z-index: 1 !important;
}

.leaflet-marker-pane {
    z-index: 600 !important;
}

/* State hover effect enhancement */
.leaflet-interactive {
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (max-width: 1200px) {

    .mini-map-container,
    .map-container {
        flex-direction: column;
    }

    #providerSidebar {
        width: 100%;
        max-height: 500px;
        border-left: none;
        border-top: 2px solid #e2e8f0;
    }

    .page-header,
    .section-header,
    #miniMapWrapper,
    #mapWrapper {
        padding: 30px;
    }

    .hero-section {
        height: 300px;
        padding: 60px 30px;
    }

    .hero-section h1 {
        font-size: 2.5em;
    }
}

@media (max-width: 768px) {
    .provider-nav a {
        padding: 15px 18px;
        font-size: 0.75em;
    }

    .page-header {
        flex-direction: column;
        padding: 20px;
    }

    .page-header h1 {
        font-size: 2em;
        text-align: center;
    }

    .page-header .postal-input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    #searchButton {
        width: 100%;
    }

    .hero-section h1 {
        font-size: 2em;
    }

    .section-title {
        font-size: 1.1em;
    }

    #miniMap,
    #map {
        height: 400px;
    }

    #providerSidebar {
        max-height: 400px;
    }

    .provider-card {
        padding: 16px;
    }

    .custom-pin {
        width: 40px !important;
        height: 40px !important;
    }

    .custom-pin .pin-inner svg {
        width: 40px !important;
        height: 40px !important;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* State Map Styles */
#stateMapSection .section-header {
    display: none !important;
}

#stateMap {
    height: 550px;
    background: transparent;
    position: relative;
    border-radius: 0;
    overflow: visible !important;
    width: 100%;
    display: block;
    /* Ensure it takes space */
    z-index: 10;
}

#stateMap svg {
    width: 100%;
    height: clamp(300px, 40vw, 500px) !important;
    display: block;
}

/* #stateMap svg path {
    fill: #e5e7eb;
    stroke: #e5e7eb;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.2s ease;
} */

#stateMap .custom-pin .pin-inner svg path {
    fill: #3456F5 !important;
    stroke: #F7FBFF !important;
}

#stateMap .custom-pin.active .pin-inner svg path,
#stateMap .custom-pin.hover .pin-inner svg path {
    fill: #3456F5 !important;
    stroke: #F7FBFF !important;
}

/* Hide labels in state map by default unless customized */
#stateMap .svg-state-label {
    display: none !important;
}

/* Force SVG Path Colors for State Map */
#stateMap svg path {
    fill: #D0DDE7 !important;
    stroke: #D0DDE7 !important;
    /* User asked for fill #D0DDE7, usually stroke is white/light */
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.2s ease;
}

#stateMap svg path:hover {
    fill: #b0c4d6 !important;
    /* Slightly darker on hover */
}

#novaScotiaMap svg[aria-label="Map of nova scotia"] path {
    fill: #D0DDE7 !important;
    stroke: #D0DDE7 !important;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.2s ease;
}

/* Custom Pin Tooltip */
.pin-tooltip {
    position: absolute;
    bottom: 65%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #3456F5;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: auto;
    opacity: 0;
    /* Hidden by default */
    display: none;
    /* Removed from flow by default */
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 99999;
}

.pin-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #3456F5 transparent transparent transparent;
}

/* Permanent Tooltip on State Map ONLY */
#stateMap .pin-tooltip {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

/* Hover effect for other maps if needed (currently disabled as per request 'not on usa page') */
/* 
.custom-pin:hover .pin-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
} 
*/

#stateMap .pin-inner svg path {
    fill: #3456F5 !important;
    stroke: #F7FBFF !important;
}

#stateMap svg {
    margin: 0 auto;
    pointer-events: none;
}