/* US Map Pins Frontend Styles */

.usmp-map-container {
    position: relative;
    margin: 0 auto;
    background: #fff;
}

.usmp-map-wrapper {
    position: relative;
    width: 100%;
}

.usmp-map-svg {
    position: relative;
    width: 100%;
}

.usmp-map-svg svg {
    display: block;
    width: 100%;
    height: auto;
}

/* SVG Styling - White background, light gray states, darker outlines */
.usmp-map-svg svg {
    background: #fff;
}

.usmp-map-svg svg .state {
    fill: #e5e5e5 !important;
}

.usmp-map-svg svg .borders {
    stroke: #999999 !important;
    stroke-width: 1 !important;
}

/* Hide DC circle if desired, or style it */
.usmp-map-svg svg .dccircle {
    fill: #e5e5e5 !important;
    stroke: #999999 !important;
}

/* Pins Layer */
.usmp-pins-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Individual Pin */
.usmp-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    pointer-events: auto;
    cursor: pointer;
    z-index: 10;
}

.usmp-pin-icon {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
    transition: transform 0.15s ease;
}

.usmp-pin:hover .usmp-pin-icon {
    transform: scale(1.15);
}

.usmp-pin.active {
    z-index: 20;
}

.usmp-pin.active .usmp-pin-icon {
    transform: scale(1.15);
}

/* Pin Colors */
.usmp-pin-broadrange .usmp-pin-icon path {
    fill: #f58220;
}

.usmp-pin-ngroup .usmp-pin-icon path {
    fill: #007ac2;
}

/* Tooltip */
.usmp-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.usmp-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.usmp-pin.active .usmp-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Legend */
.usmp-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 50;
}

.usmp-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.usmp-legend-item + .usmp-legend-item {
    margin-top: 8px;
}

.usmp-legend-pin {
    flex-shrink: 0;
}

.usmp-legend-pin.usmp-pin-broadrange path {
    fill: #f58220;
}

.usmp-legend-pin.usmp-pin-ngroup path {
    fill: #007ac2;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .usmp-map-container {
        width: 95% !important;
    }

    .usmp-legend {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 15px;
        display: flex;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .usmp-legend-item + .usmp-legend-item {
        margin-top: 0;
    }

    .usmp-tooltip {
        font-size: 12px;
        padding: 6px 10px;
        white-space: normal;
        max-width: 150px;
        text-align: center;
    }

    .usmp-pin-icon {
        width: 20px;
        height: 30px;
    }

    /* Larger tap target for touch */
    .usmp-pin {
        padding: 10px;
        margin: -10px;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .usmp-map-container {
        width: 100% !important;
    }

    .usmp-legend {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 10px;
    }

    .usmp-legend-item {
        font-size: 13px;
    }

    .usmp-pin-icon {
        width: 18px;
        height: 27px;
    }

    .usmp-tooltip {
        font-size: 11px;
        padding: 5px 8px;
        max-width: 120px;
    }

    .usmp-tooltip::after {
        border-width: 5px;
    }
}
