/**
 * AP Interactive Map - Frontend Styles
 */

/* Map container */
.ap-interactive-map {
    position: relative;
    margin-bottom: 30px;
}

.map-container {
    position: relative;
    width: 100%;
}

.map-background {
    display: block;
    width: 100%;
    height: auto;
}

/* Map points container */
.map-points {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Individual map point */
.map-point {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 1;
}

.map-marker {
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease;
    /* Default state - minimal pulse */
    animation: softPulse 3s infinite;
}

/* Soft pulse animation for inactive state */
@keyframes softPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Strong pulse animation for active state */
@keyframes strongPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.4);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Pulse effect for the outer circle when active */
@keyframes activeCirclePulse {
    0% {
        r: 9;
        opacity: 0.3;
    }
    50% {
        r: 14;
        opacity: 0.7;
    }
    100% {
        r: 9;
        opacity: 0.3;
    }
}

/* Active point styling */
.map-point.active .map-marker {
    animation: strongPulse 1.5s infinite;
    z-index: 10; /* Bring active point to front */
}

.map-point.active .pulse-circle {
    animation: activeCirclePulse 1.5s infinite;
    fill-opacity: 0.3;
}

/* Add a glow effect for active points - color will be inherited from the marker */
.map-point.active {
    filter: drop-shadow(0 0 5px rgba(255, 112, 96, 0.6));
}

/* Default marker color - will be overridden by inline styles for custom colors */
.map-point .marker-bg {
    fill: #FF7063;
}

/* Slightly darker shade for active marker - intensity will be preserved */
.map-point.active .marker-bg {
    filter: brightness(0.9) saturate(1.3);
}

/* Hover behavior */
.map-point:hover .map-marker {
    transform: scale(1.2);
    animation: none; /* Stop pulsing on hover */
}

/* Tooltip styles */
.map-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-bottom: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 2;
    text-align: left;
}

.map-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.map-point:hover .map-tooltip,
.map-point.active .map-tooltip {
    opacity: 1;
    visibility: visible;
}

.map-tooltip h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.map-tooltip .map-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.map-tooltip .map-description p {
    margin: 0 0 10px 0;
}

.map-tooltip .map-description p:last-child {
    margin-bottom: 0;
}

.map-tooltip .map-description a {
    color: #ff7760;
    text-decoration: underline;
}

.map-tooltip .map-description a:hover {
    text-decoration: none;
}

/* Responsive styles */
@media (max-width: 768px) {
    .map-tooltip {
        width: 150px;
        padding: 8px;
        font-size: 12px;
    }
    
    .map-tooltip h4 {
        font-size: 14px;
    }
    
    .map-point {
        width: 16px;
        height: 16px;
    }
}