/* Zip Area Map — front-end styles */

.zam-map-wrap {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.zam-map-canvas {
    width: 100%;
    min-height: 300px;
    border-radius: 8px;
    overflow: hidden;
}

/* ---- Hover tooltip ---- */
.zam-tooltip {
    position: absolute;
    z-index: 400;
    background: #1a1a2e;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 13px;
    border-radius: 6px;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    max-width: 260px;
    white-space: normal;
    line-height: 1.4;
}

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

.zam-tooltip-area {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
}

.zam-tooltip-zips {
    color: rgba(255,255,255,0.75);
    font-size: 12px;
}

/* ---- Slide-up panel ---- */
.zam-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.14);
    z-index: 500;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 45%;
    display: flex;
    flex-direction: column;
}

.zam-panel.open {
    transform: translateY(0);
}

.zam-panel[aria-hidden="true"] {
    pointer-events: none;
}

.zam-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.zam-panel-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.zam-panel-title {
    font-size: 15px;
    color: #111;
    font-weight: 600;
}

.zam-panel-count {
    font-size: 12px;
    color: #888;
    margin-left: auto;
}

.zam-panel-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    padding: 0 0 0 4px;
    transition: color 0.1s;
}

.zam-panel-close:hover { color: #333; }

.zam-panel-zips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 16px;
    overflow-y: auto;
}

.zam-zip-badge {
    background: #f3f4f6;
    color: #374151;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 13px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-weight: 500;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.zam-zip-badge.no-boundary {
    border-color: #e5e7eb;
    opacity: 0.65;
    font-style: italic;
}

/* Legend */
.zam-legend {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    padding: 10px 14px;
    z-index: 300;
    font-size: 13px;
    max-width: 200px;
}

.zam-legend-title {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 8px;
}

.zam-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.zam-legend-item:hover { opacity: 0.7; }

.zam-legend-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.zam-legend-label {
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No-data notice */
.zam-no-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    padding: 16px 24px;
    text-align: center;
    font-size: 14px;
    color: #555;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    z-index: 300;
    pointer-events: none;
}
