/**
 * BW Image Hotspot - Frontend Styles
 */

/* Main container */
.bw-interactive-map {
    position: relative;
    margin-bottom: 30px;
    width: 100%;
}

/* Map container */
.map-container,
.bw-map-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Background image */
.map-background,
.bw-map-background {
    display: block;
    width: 100%;
    height: auto;
}

/* Points container */
.map-points,
.bw-map-points-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

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

/* Point marker */
.map-marker,
.bw-map-point-marker {
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease;
    animation: bwSoftPulse 3s infinite;
}

/* Soft pulse animation for inactive state */
@keyframes bwSoftPulse {
    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 bwStrongPulse {
    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 bwActiveCirclePulse {
    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,
.bw-map-point.active .bw-map-point-marker {
    animation: bwStrongPulse 1.5s infinite;
    z-index: 10;
}

.map-point.active .pulse-circle,
.bw-map-point.active .pulse-circle {
    animation: bwActiveCirclePulse 1.5s infinite;
    fill: #ff7760;
    fill-opacity: 0.3;
}

/* Add a glow effect for active points */
.map-point.active,
.bw-map-point.active {
    filter: drop-shadow(0 0 5px rgba(255, 112, 96, 0.6));
}

.map-point.active .marker-bg,
.bw-map-point.active .marker-bg {
    fill: #ff5a46;
}

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

/* Tooltip */
.map-tooltip,
.bw-map-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    width: 200px;
    transform: translateX(-50%);
    padding: 10px;
    background-color: #FFFFFF;
    color: #333333;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 2;
    text-align: left;
}

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

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

/* Tooltip content */
.map-tooltip h4,
.tooltip-title {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
}

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

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

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

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

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

/* Mobile adjustments */
@media (max-width: 768px) {
    .map-tooltip,
    .bw-map-tooltip {
        width: 150px;
        padding: 8px;
        font-size: 12px;
    }

    .map-tooltip h4,
    .tooltip-title {
        font-size: 14px;
    }

    .map-description,
    .tooltip-description {
        font-size: 12px;
    }

    .map-point,
    .bw-map-point {
        width: 16px;
        height: 16px;
    }
}

/* Fallback/placeholder */
.bw-map-placeholder {
    padding: 30px;
    background-color: #f5f5f5;
    border: 1px dashed #ccc;
    text-align: center;
    font-style: italic;
    color: #777;
}
