/**
 * ACF Imagemap Blokk Frontend Stílusok
 * Fájl: template-parts/blocks/imagemap/style.css
 */

/* ACF Imagemap Blokk Styles */
.acf-imagemap-block {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.acf-imagemap-block.alignwide {
    max-width: 1200px;
}

.acf-imagemap-block.alignfull {
    max-width: 100%;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Placeholder */
.imagemap-placeholder {
    background: #f7f7f7;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content .dashicons {
    font-size: 48px;
    color: #ccc;
    display: block;
    margin-bottom: 15px;
}

.placeholder-content p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Imagemap wrapper */
.imagemap-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

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

/* Hotspots */
.hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Preview mode hotspots */
.hotspot-preview {
    position: relative;
    background: rgba(255,255,255,0.95);
    border: 2px solid #0073aa;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hotspot-preview:hover .hotspot-tooltip {
    display: block;
}

.hotspot-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 5px;
    z-index: 1000;
}

.hotspot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0,0,0,0.9);
}

/* Éles hotspot marker */
.hotspot-marker {
    position: relative;
    width: 40px;
    height: 40px;
}

/* Pin hover cursor és interaktivitás javítása */
.hotspot-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    cursor: pointer; /* EZ ÚJ - biztosítjuk, hogy a pin kattintható legyen */
    z-index: 2; /* EZ ÚJ - pin legyen a pulse felett */
}
.hotspot-pin svg {
    width: 20px;
    height: 28px;
    display: block;
}
/* Pulse eltüntetése hover esetén - add hozzá a meglévő hover szabályokhoz */
.hotspot:hover .hotspot-pulse {
    opacity: 0;
    display: none;
    transform: scale(1);
}
/* Finomhangolás: smooth átmenet a pulse állapotok között */
.hotspot-pulse {
    width: 40px;
    height: 40px;
    background: rgba(255, 68, 68, 0.3);
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    animation: hotspotPulse 2s infinite;
    transition: opacity 0.2s ease, transform 0.2s ease; /* EZ ÚJ */
}

@keyframes hotspotPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Hotspot stílusok */
.hotspot-blue .hotspot-pin svg path {
    fill: #0073aa;
}

.hotspot-blue .hotspot-pulse {
    background: rgba(0, 115, 170, 0.3);
}

.hotspot-green .hotspot-pin svg path {
    fill: #46b450;
}

.hotspot-green .hotspot-pulse {
    background: rgba(70, 180, 80, 0.3);
}

.hotspot-purple .hotspot-pin svg path {
    fill: #826eb4;
}

.hotspot-purple .hotspot-pulse {
    background: rgba(130, 110, 180, 0.3);
}

.hotspot-default .hotspot-pin svg path {
    fill: #ff4444;
}

.hotspot-default .hotspot-pulse {
    background: rgba(255, 68, 68, 0.3);
}

.hotspot:hover .hotspot-pin {
    transform: translate(-50%, -50%) scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.hotspot.active .hotspot-pin {
    transform: translate(-50%, -50%) scale(1.0);
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.5));
}

.hotspot.active .hotspot-pulse {
    animation-play-state: paused;
    opacity: 0.6;
    transform: scale(1.2);
}

/* Popup Styles - Tooltip pozicionálás */
.imagemap-popup {
    display: none;
    position: absolute;
    z-index: 1000;
    background: none;
    border-radius: 0;
    max-width: 275px;
    min-width: 200px;
    width: 100%;
    animation: popupSlideIn 0.3s ease;
    visibility: hidden;
}

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

.popup-content {
    padding: 0;
    position: relative;
    overflow: hidden;
}

.popup-close {
    color: #999;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    position: absolute;
    right: 10px;
    top: 164px;
    cursor: pointer;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(0,0,0,0.1);
}

.popup-close:hover {
    color: #333;
    background: rgba(0,0,0,0.1);
}

.popup-image-container {
    text-align: center;
    
    height:154px;
    clip-path: polygon(0 0, calc(100% - 55px) 0, 100% 55px, 100% 100%, 0 100%);
}

.popup-image {
    max-width: 100%;
    width: 100%;
    height:100%;
    object-fit: cover;       
    display: block;
}

.popup-title {
    color: #333;
    margin: 0 0 2px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    padding-right: 25px;
    word-wrap: break-word;
}
.popup-szolgaltatas {
    font-size: 14px;
    font-style: italic;
    margin: 0 0 10px 0;
}
.popup-description {
    color: #666;
    line-height: 1.5;
    margin: 0 0 15px 0;
    font-size: 14px;
    word-wrap: break-word;
    text-align: left;
}

.popup-actions {
    text-align: left;
}

.popup-link {
    display: inline-block;
    background: #0073aa;
    color: white !important;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.3s ease;
}

.popup-link:hover {
    background: #005a87;
    color: white !important;
}


/* Popup arrow */
.popup-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
    top: -8px;
    left: 20px;
    z-index: 999;
}

.popup-arrow::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid rgba(0,0,0,0.1);
    top: -2px;
    left: -9px;
    z-index: 998;
}

/* Popup pozicionálás irányai */
.imagemap-popup.popup-bottom .popup-arrow {
    top: -8px;
    left: 50%;
    margin-left: -8px;
    border-top: none;
    border-bottom: 8px solid white;
}

.imagemap-popup.popup-bottom .popup-arrow::before {
    border-top: none;
    border-bottom: 9px solid rgba(0,0,0,0.1);
}

.imagemap-popup.popup-top .popup-arrow {
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
    border-bottom: none;
    border-top: 8px solid white;
}

.imagemap-popup.popup-top .popup-arrow::before {
    border-bottom: none;
    border-top: 9px solid rgba(0,0,0,0.1);
    top: -1px;
}

.imagemap-popup.popup-left .popup-arrow {
    right: -8px;
    top: 50%;
    margin-top: -8px;
    border-left: 8px solid white;
    border-right: none;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.imagemap-popup.popup-left .popup-arrow::before {
    border-left: 9px solid rgba(0,0,0,0.1);
    border-right: none;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    top: -9px;
    left: -1px;
}

.imagemap-popup.popup-right .popup-arrow {
    left: -8px;
    top: 50%;
    margin-top: -8px;
    border-right: 8px solid white;
    border-left: none;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.imagemap-popup.popup-right .popup-arrow::before {
    border-right: 9px solid rgba(0,0,0,0.1);
    border-left: none;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    top: -9px;
    left: -2px;
}

/* Responsive */
@media (max-width: 768px) {
    .imagemap-popup {
        max-width: 280px;
        font-size: 14px;
    }
    
    .popup-content {
        padding: 15px;
    }
    
    .popup-title {
        font-size: 16px;
    }
    
    .popup-description {
        font-size: 13px;
    }
    
    .popup-link {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .hotspot-marker {
        width: 30px;
        height: 30px;
    }
    
    .hotspot-pin svg {
        width: 16px;
        height: 22px;
    }
    
    .hotspot-pulse {
        width: 30px;
        height: 30px;
    }
}