/* ==========================================================================
   CENTERCOM GLOBAL MAP WIDGET STYLES
   ========================================================================== */

.centercom-global-map {
    position: relative;
    width: 100%;
    overflow: visible;
    /* Allow tooltips to overflow without being cut off */

    /* Allow map to align right if it scales larger than container */
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Wrapper for zooming the map from Elementor settings */
.centercom-map-scaler {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    transform-origin: center right;
    overflow: hidden;
    /* Contains the zoomed map so it doesn't break layout */
}

/* Wrapper for perfectly syncing dots with map pan via JS */
.centercom-map-panner {
    position: relative;
    /* Force panner to at least cover the container */
    min-width: 100%;
    min-height: 100%;
    height: 650px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    /* Smooth pan transition */
}

.centercom-global-map-image {
    /* Scale width and height to cover container while maintaining aspect ratio */
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    flex-shrink: 0;
    display: block;
    pointer-events: none;
}

/* Markers Layer */
.centercom-global-map-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through if needed, though they are just visual */
}

/* --- Individual Marker --- */
.map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    background: rgba(46, 178, 255, 0.3);
    border: 2px solid rgba(46, 178, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 10;
}

/* Inner dot for active state */
.map-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 8px;
    height: 8px;
    background: #2EB2FF;
    border-radius: 50%;
    transition: transform 0.4s ease;
}

/* Outer radial pulse for active state - Made much larger and more visible */
.map-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(46, 178, 255, 0.5) 0%, rgba(46, 178, 255, 0) 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    filter: blur(4px);
    z-index: -1;
}

/* ACTIVE Marker State */
.map-marker.active {
    border-color: #2EB2FF;
    background: transparent;
    z-index: 20;
}

.map-marker.active::after {
    transform: translate(-50%, -50%) scale(1);
}

.map-marker.active::before {
    opacity: 1;
    animation: markerPulse 3.5s infinite ease-in-out;
}

@keyframes markerPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.2;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.2;
    }
}


/* ==========================================================================
   TESTIMONIAL CARD (Base Styles)
   Note: Elementor Style Controls will override many of these.
   ========================================================================== */
.centercom-map-card {
    position: absolute;
    width: 372px;
    padding: 20px;

    /* Default Glassmorphism (Can be overridden by Elementor Background control) */
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #fff;
    border-radius: 12px;
    padding: 36px 41px;

    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: #fff;
    z-index: 30;

    /* Explicit transitions so opacity doesn't overwrite top/left glide */
    transition: left 0.8s cubic-bezier(0.25, 1, 0.5, 1),
        top 0.8s cubic-bezier(0.25, 1, 0.5, 1),
        opacity 0.4s ease;
}

.centercom-map-title {
    font-family: "Montserrat";
    margin: 0 0 10px 0;
    font-size: 30px;
    line-height: 35px;
    font-weight: 700;
    color: #fff;
    /* Default, overridden by Elementor */
}

.centercom-map-desc {
    font-family: "Montserrat";
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    color: rgba(255, 255, 255, 0.9);
    /* Default, overridden by Elementor */
}

/* The Pointer Triangle using a Rotated Square for perfect Glassmorphism */
.centercom-map-pointer {
    position: absolute;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.13); /* Translucent fill */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.5s ease;
    margin-left: 4px; /* Correct alignment with JS math */
    z-index: 10;
}

/* Pointer when card is above the dot (pointer points DOWN) */
.centercom-map-card.pos-top .centercom-map-pointer {
    bottom: -8.5px; /* Center aligns with card bottom edge */
    top: auto;
    border-bottom: 1px solid #fff;
    border-right: 1px solid #fff;
    transform: rotate(45deg);
    /* Clip to ONLY show the bottom-right triangle, preventing interior overlap */
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

/* Pointer when card is below the dot (pointer points UP) */
.centercom-map-card.pos-bottom .centercom-map-pointer {
    top: -8.5px; /* Center aligns with card top edge */
    bottom: auto;
    border-top: 1px solid #fff;
    border-left: 1px solid #fff;
    transform: rotate(45deg);
    /* Clip to ONLY show the top-left triangle, preventing interior overlap */
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 880px) {
    .centercom-global-map {
        height: auto !important;
        min-height: 300px !important;
        /* Room for tooltips */
        max-height: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

        .elementor-1044 .elementor-element.elementor-element-1ca970a {
            width: 100%;
        }
    .centercom-map-scaler,
    .centercom-map-panner {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        display: block !important;
    }

    .centercom-global-map-image {
        width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
        min-height: 0 !important;
    }

    .centercom-map-card {
        width: 180px !important;
        padding: 12px !important;
    }

    .centercom-map-title {
        font-size: 14px !important;
        margin-bottom: 4px !important;
    }

    .centercom-map-desc {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }

    /* Shrink the map dots for mobile */
    .map-marker {
        width: 14px !important;
        height: 14px !important;
        border-width: 1px !important;
    }

    .map-marker::after {
        width: 6px !important;
        height: 6px !important;
    }

    .map-marker::before {
        width: 50px !important;
        height: 50px !important;
    }
}

/* Medium Desktop Overrides */
@media (min-width: 1200px) and (max-width: 1500px) {
    .centercom-map-panner {
        height: 450px;
    }
}


@media (min-width: 1024px) and (max-width: 1199px) {
    .centercom-map-panner {
        height: 350px;
    }
}