/* World Map — Google Maps Integration Premium (v14) */

:root {
    --wm-glass-bg: rgba(255, 255, 255, 0.08);
    --wm-glass-border: rgba(255, 255, 255, 0.15);
    --wm-glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    --wm-text: #ffffff;
    --wm-text-muted: rgba(255, 255, 255, 0.5);
}

.world-map-container {
    position: relative;
    width: 100%;
    height: 650px;
    /* Fixed height for standard integration, can be overridden */
    min-height: 400px;
    background: #f0f4f8; /* Matches new light water color */
    border-radius: 16px;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.world-map-container[data-theme="dark"] {
    background: #000000;
}

.world-map-canvas {
    width: 100%;
    height: 100%;
}

/* === THEME TOGGLE === */
.wm-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 60, 91, 0.12); /* Brighter brand blue with low opacity */
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 6px 14px 6px 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    user-select: none;
    transition: all 0.25s ease;
}

.wm-theme-toggle:hover {
    background: rgba(0, 60, 91, 0.18);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.wm-toggle-track {
    width: 46px;
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 13px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.wm-toggle-track.is-light {
    background: rgba(255, 220, 60, 0.35);
    border-color: rgba(255, 220, 60, 0.5);
}

.wm-toggle-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.wm-toggle-thumb.is-light {
    transform: translateX(20px);
}

.wm-toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.04em;
    min-width: 30px;
    text-align: right;
    transition: color 0.3s;
}

/* === LEGEND === */
.wm-legend {
    position: absolute;
    bottom: 30px;
    left: 20px;
    background: rgba(0, 60, 91, 0.85); /* Brand Blue with opacity */
    backdrop-filter: blur(12px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 500;
    color: white;
    font-size: 11px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    line-height: normal;
}

.wm-legend-title {
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    text-transform: uppercase;
}

.wm-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.wm-legend-item:hover {
    opacity: 0.8;
}

.wm-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* === TOOLTIP === */
.wm-tooltip {
    position: absolute;
    width: 220px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.9);
    z-index: 2000;
    pointer-events: none;
    display: none;
    transform: translate(-50%, -100%) translateY(-20px);
    line-height: initial;
}

.wm-tooltip img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
    background: #dbe7ef;
}

.wm-tooltip-content {
    padding: 12px 16px;
    line-height: 1.2;
}

.wm-tooltip-city {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
    color: #1a202c;
}

.wm-tooltip-region {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Hiding Google Branding === */
.gm-style-cc,
.gm-style-mtc,
.gm-svpc,
.gm-err-container,
a[href^="https://maps.google.com/maps"],
a[href^="https://www.google.com/intl/en-US_US/help/terms_maps.html"],
.gmnoprint {
    display: none !important;
}

.world-map-canvas img[src*="google_white"],
.world-map-canvas img[src*="google4"] {
    display: none !important;
}

/* Status / Error Toast */
.wm-status-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(190, 24, 93, 0.9);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 2100;
    text-align: center;
    backdrop-filter: blur(8px);
}

/* === PULSE MARKER === */
.wm-pulse-marker {
    position: absolute;
    width: 0;
    height: 0;
    z-index: 1000;
}

.wm-pulse-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    z-index: 10;
    cursor: pointer;
    border: 2px solid #fff;
}

.wm-pulse-rings {
    position: absolute;
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
}

.wm-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: currentColor;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: wm-pulse-anim 12s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.wm-pulse-marker:hover .wm-pulse-dot {
    transform: translate(-50%, -50%) scale(1.2);
    transition: transform 0.2s ease;
}

.wm-pulse-ring:nth-child(2) {
    animation-delay: 4s;
}

.wm-pulse-ring:nth-child(3) {
    animation-delay: 8s;
}

@keyframes wm-pulse-anim {
    0% {
        width: 150%;
        height: 150%;
        opacity: 0.6;
    }
    100% {
        width: 350%;
        height: 350%;
        opacity: 0;
    }
}

/* Allow Google Maps Cooperative Gesture Overlay to be visible */
/* .gm-style-pbc {
    display: none !important;
} */