/* Frontend Styles for Hot Spot Product Plugin */

/* Product Container */
.hsp-product-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.hsp-product-image-wrapper {
    position: relative;
    display: block;
    max-width: 100%;
    width: 100%;
}

.hsp-product-image-wrapper.mobile .hsp-hotspot-lines {
    display: none;
} 

.hsp-product-image {
    display: block;
    width: 100%;
    height: auto;
}

/* Hotspots */
.hsp-hotspots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Hotspot Lines */
.hsp-hotspot-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1001;
}

.hsp-hotspot-line {
    stroke-width: 2;
    fill: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hsp-hotspot-line.active {
    opacity: 1;
}

.hsp-hotspot-line-endpoint {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hsp-hotspot-line-endpoint.active {
    opacity: 1;
}

/* Hotspot Popups Container */
.hsp-hotspot-popups {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hsp-hotspot-marker {
    position: absolute;
    width: 30px;
    height: 30px;
    margin-left: -15px;
    margin-top: -15px;
    pointer-events: all;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
}

.hsp-hotspot-dot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, background 0.3s ease;
}

.hsp-hotspot-dot:before {
    content: '';
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    position: absolute;
    top: -5px;
    left: -5px;
    border-radius: 10px;
    background: rgba(var(--dot-color-rgb, 255, 0, 0), 0.2);
    z-index: -1;
}

.hsp-hotspot-dot:after { 
    content: '';
    width: 5px;
    height: 5px;
    position: absolute;
    border-radius: 25%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 5px 5px 0px rgba(0, 0, 0, 0.3);
}

.hsp-hotspot-marker:hover .hsp-hotspot-dot {
    transform: scale(1.2);
    filter: brightness(0.85);
}

.hsp-hotspot-marker:hover .hsp-hotspot-dot:before {
    transform: scale(1);
}

.hsp-hotspot-marker.active .hsp-hotspot-dot {
    animation: pulse 2s infinite;
}

.hsp-hotspot-marker.active .hsp-hotspot-dot:before {
    /* box-shadow: 0 0 0 3px rgba(var(--dot-color-rgb, 255, 0, 0), 0.4), 0 4px 12px rgba(0, 0, 0, 0.4); */
}

@keyframes pulse {
    0% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(var(--dot-color-rgb, 255, 0, 0), 0.7);
    }
    50% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 10px transparent;
    }
    100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 0 transparent;
    }
}

/* Popup */
.hsp-hotspot-popup {
    position: absolute;
    z-index: 1000;
    /* background: rgba(0,0,0,0.5); */
    color: #fff;
    padding: 0;
    border-radius: 8px;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); */
    min-width: 280px;
    max-width: 350px;
    pointer-events: all;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hsp-hotspot-popup.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Mode - When popups overlap with product boundary */
.hsp-product-container.mobile .hsp-hotspot-popup {
    left: 50% !important;
    top: auto !important;
    bottom: 10px !important;
    transform: translateX(-50%) !important;
    max-width: calc(100%) !important;
    margin: auto;
    width: auto !important;
}

.hsp-product-container.mobile .hsp-hotspot-lines {
    display: none;
}

.hsp-product-container.mobile .hsp-hotspot-popups {
    display: block;
    position: static;
    background: black;
}

.hsp-product-container.mobile .hsp-popup-title {
    padding-left: 0;
    padding-right: 0;
}

.hsp-product-container.mobile .hsp-popup-description {
    padding-left: 0;
    padding-right: 0;
}

.hsp-product-container.mobile .hsp-hotspot-popups .hsp-hotspot-popup {
    position: static;
    transform: none !important;
    height: 0;
}

.hsp-product-container.mobile .hsp-hotspot-popups .hsp-hotspot-popup.active {
    height: auto;;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hsp-popup-content {
    padding: 20px;
    position: relative;
}

.hsp-popup-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: color 0.3s ease;
}

.hsp-popup-close:hover {
    color: #00d4ff;
}

.hsp-popup-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    padding-right: 30px;
    padding-left: 5px;
    padding-right: 5px;
    padding-bottom: 11px;
    color: #fff;
    border-bottom: 2px solid;
}

.hsp-popup-title.is-empty {
    padding: 0;
    margin: 0;
}

.hsp-popup-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    padding-left: 5px;
    padding-right: 5px;
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .hsp-hotspot-marker {
        width: 25px;
        height: 25px;
        margin-left: -12.5px;
        margin-top: -12.5px;
    }
    
    .hsp-hotspot-popup {
        min-width: 250px;
        max-width: 300px;
    }
    
    .hsp-popup-content {
        padding: 15px;
    }
    
    .hsp-popup-title {
        font-size: 16px;
    }
    
    .hsp-popup-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hsp-hotspot-marker {
        width: 20px;
        height: 20px;
        margin-left: -10px;
        margin-top: -10px;
    }
    
    .hsp-hotspot-dot {
        border-width: 2px;
    }
    
    .hsp-hotspot-popup {
        min-width: 200px;
        max-width: 250px;
    }
}
