/* ── World Map — shared styles (D3 + TopoJSON) ───────────── */

.map-container {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    min-height: 12.5rem;
}

.map-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #666;
    transition: opacity 150ms ease;
    user-select: none;
}

/* Enabled only when profile.html adds .legend-interactive on the parent */
.legend-interactive .map-legend-item { cursor: pointer; }

.map-legend-item.inactive { opacity: 0.5; text-decoration: line-through; }
.map-legend-item.inactive .map-legend-dot { opacity: 0.3; }

.map-legend-dot {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    flex-shrink: 0;
    transition: opacity 150ms ease;
}

.map-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    pointer-events: auto;
    z-index: 500;
    white-space: nowrap;
}

.map-popup {
    position: absolute;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 22px rgba(0,0,0,0.18);
    padding: 14px 16px;
    z-index: 600;
    min-width: 10.9375rem;
}
.map-popup-header { display: flex; align-items: center; gap: 0.5em; margin-bottom: 0.5em; }
.map-popup-flag { font-size: 1.2rem; }
.map-popup-name { font-weight: 800; font-size: 0.92rem; flex: 1; }
.map-popup-close { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #999; }
.map-popup-actions { display: flex; flex-direction: column; gap: 6px; }
.map-popup-btn {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1.5px solid #61c4b5;
    background: none;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
    transition: background 0.14s;
}
.map-popup-btn:hover { background: rgba(97,196,181,0.1); }
.map-popup-btn--visited { border-color: #4caf50; color: #2e7d32; }
.map-popup-btn--wishlist { border-color: #f0c040; color: #f57f17; }
.map-popup-btn--remove { border-color: #d44; color: #d44; }

.map-loading, .map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 12.5rem;
    color: #666;
    font-size: 0.9rem;
}
