/* Debug: Confirm CSS is loaded */
.projects-map-container::before {
    content: 'Projects Hotspot CSS Loaded';
    display: none; /* Hidden but visible in inspector */
}

.projects-map-container {
    position: relative;
    margin: 0 auto;
    display: flex;
    justify-content: end;
    overflow: visible; /* Allow tooltips to extend outside if needed */
}

.projects-map-container .map-wrapper {
    position: relative;
    width: fit-content;
    height: 460px;
    display: flex;
    justify-content: end;
}

.main-map-svg {
    height: 100%;
}

.projects-map-container .map-wrapper .main-map-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.projects-map-container .map-wrapper .main-map-svg path {
    fill: #cccccc; /* Default fill, overridden by Elementor */
    fill-opacity: 1;
    stroke: #ffffff; /* Default stroke, overridden by Elementor */
    stroke-width: 87px;
    stroke-opacity: 1;
    stroke-linejoin: round;
}

.projects-map-container .hotspots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.projects-map-container .hotspot {
    position: absolute;
    transform: translate(-50%, -100%); /* Align pin base */
    pointer-events: auto;
    z-index: 10;
    opacity: 0; /* Hidden initially for animation */
    transition: opacity 0.5s ease;
}

.projects-map-container .hotspot.visible {
    opacity: 1; /* Visible when animated */
}

.projects-map-container .hotspot-pointer {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.projects-map-container .hotspot-pointer svg {
    width: 100%;
    height: 100%;
}
.hotspot.visible.active{
    z-index: 20;
}
.projects-map-container .hotspot.active .hotspot-pointer svg {
    fill: #0000ff !important; /* Active color */
}

/* Base tooltip styles */
.projects-map-container .hotspot-tooltip {
    position: absolute;
    background: #ffffff;
    padding: 10px;
    border: 1px solid #000000;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    min-width: 150px;
    width: max-content;
    max-width: 320px;
    text-align: left;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Default positioning (top) */
.projects-map-container .hotspot-tooltip,
.projects-map-container .hotspot-tooltip.tooltip-top {
    bottom: 32px; /* Above pin */
    left: 50%;
    transform: translateX(-50%);
}

/* Bottom positioning */
.projects-map-container .hotspot-tooltip.tooltip-bottom {
    top: 25px; /* Below pin */
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
}

/* Left positioning */
.projects-map-container .hotspot-tooltip.tooltip-left {
    top: 50%;
    right: 25px; /* To the left of pin */
    bottom: auto;
    left: auto;
    transform: translateY(-50%);
}

/* Right positioning */
.projects-map-container .hotspot-tooltip.tooltip-right {
    top: 50%;
    left: 25px; /* To the right of pin */
    bottom: auto;
    right: auto;
    transform: translateY(-50%);
}

/* Show tooltip only on active (click), NOT on hover */
.projects-map-container .hotspot.active .hotspot-tooltip {
    opacity: 1;
    visibility: visible;
}

.projects-map-container .hotspot-tooltip h3 {
    margin: 0 0 5px;
    font-size: 16px;
    color: #000000;
}

.projects-map-container .hotspot-tooltip p {
    margin: 0;
    font-size: 14px;
    color: #333333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .projects-map-container .hotspot-tooltip {
        min-width: 120px;
        max-width: 200px;
        font-size: 12px;
    }
    
    .projects-map-container .hotspot-tooltip h3 {
        font-size: 14px;
    }
    
    .projects-map-container .hotspot-tooltip p {
        font-size: 12px;
    }
}