/* Image Hotspot Block */
.wp-block-fca-course-blocks-image-hotspot {
    margin-bottom: var(--fcom-block-spacing, 20px);
}

/* Alignment */
.wp-block-fca-course-blocks-image-hotspot.align-left {
    display: flex;
    justify-content: flex-start;
}

.wp-block-fca-course-blocks-image-hotspot.align-center {
    display: flex;
    justify-content: center;
}

.wp-block-fca-course-blocks-image-hotspot.align-right {
    display: flex;
    justify-content: flex-end;
}

.hotspot-image-wrapper {
    position: relative;
    display: inline-block;
}

.hotspot-image-wrapper.is-adding {
    outline: 2px dashed var(--fcom-primary-button, #1877F2);
    outline-offset: 2px;
}

.hotspot-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Hotspot Marker */
.hotspot-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 10;
}

.hotspot-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fcom-primary-button, #1877F2);
    border: 3px solid var(--fcom-primary-bg, #fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hotspot-dot::after {
    content: '+';
    color: var(--fcom-primary-button-text, #fff);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.hotspot-marker:hover .hotspot-dot,
.hotspot-marker.is-selected .hotspot-dot,
.hotspot-marker.is-active .hotspot-dot {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
    }

.hotspot-marker.is-selected .hotspot-dot,
.hotspot-marker.is-active .hotspot-dot {
    background: var(--fcom-success-color, #10b981);
}

/* Popup styles */
.hotspot-popup,
.hotspot-popup-preview {
    position: absolute;
    background: var(--fcom-card-bg, var(--fcom-primary-bg, #fff));
    border: 1px solid var(--fcom-primary-border, #e5e7eb);
    border-radius: 8px;
    padding: 16px;
    min-width: 200px;
    max-width: 280px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: none;
}

/* Editor preview popup */
.hotspot-popup-preview {
    display: block;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
}

/* Frontend popup - hidden by default */
.hotspot-marker.is-active .hotspot-popup {
    display: block;
}

/* Popup positioning */
.hotspot-popup.position-top,
.hotspot-popup:not([class*="position-"]) {
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    }

.hotspot-popup.position-bottom {
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
}

.hotspot-popup.position-left {
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
}

.hotspot-popup.position-right {
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
}

/* Popup arrow */
.hotspot-popup::before,
.hotspot-popup-preview::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.hotspot-popup.position-top::before,
.hotspot-popup:not([class*="position-"])::before,
.hotspot-popup-preview::before {
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: var(--fcom-card-bg, var(--fcom-primary-bg, #fff));
}

.hotspot-popup.position-bottom::before {
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: var(--fcom-card-bg, var(--fcom-primary-bg, #fff));
}

.hotspot-popup.position-left::before {
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: var(--fcom-card-bg, var(--fcom-primary-bg, #fff));
}

.hotspot-popup.position-right::before {
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: var(--fcom-card-bg, var(--fcom-primary-bg, #fff));
}

/* Popup content */
.hotspot-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
    margin-bottom: 8px;
    line-height: 1.3;
}

.hotspot-content {
    font-size: 14px;
    color: var(--fcom-secondary-text, #6b7280);
    line-height: 1.5;
}

.hotspot-empty {
    font-size: 12px;
    color: var(--fcom-secondary-text, #6b7280);
    font-style: italic;
}

/* Animation */
@keyframes hotspotPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
    50% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 8px rgba(24, 119, 242, 0.2); }
}

.hotspot-marker:not(.is-active):not(.is-selected) .hotspot-dot {
    animation: hotspotPulse 2s ease-in-out infinite;
}

/* Block alignment support */
.wp-block-fca-course-blocks-image-hotspot.alignwide {
    max-width: var(--wp--style--global--wide-size, 1000px);
    margin-left: auto;
    margin-right: auto;
}

.wp-block-fca-course-blocks-image-hotspot.alignfull {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hotspot-popup,
    .hotspot-popup-preview {
        min-width: 160px;
        max-width: 220px;
        padding: 12px;
    }
    
    .hotspot-dot {
        width: 24px;
        height: 24px;
    }
    
    .hotspot-dot::after {
        font-size: 14px;
    }
}
