/* =========================================================
   Pin Harita – Interactive Image Map Widget
   Version: 1.0.2
   ========================================================= */

/* ---------- Wrapper ---------- */
.ph-map-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    line-height: 0; /* collapse whitespace under img */
    overflow: visible; /* popups can overflow */
    user-select: none;
}

/* ---------- Görsel ---------- */
.ph-map-image {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

/* ---------- Pin ---------- */
.ph-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    cursor: pointer;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Ensure label is 0-height */
    line-height: 0;
}

.ph-pin-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px; /* default; overridden by Elementor */
    line-height: 1;
    color: inherit;
    min-width: 1em;
    min-height: 1em;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
    transition: transform 0.2s ease, filter 0.2s ease;
    will-change: transform, filter; /* GPU hint */
}

/* Elementor inline SVG icon desteği */
.ph-pin-icon svg {
    fill: currentColor;
    width: 1em;
    height: 1em;
    display: block;
}

.ph-pin-icon i {
    color: inherit !important;
    font-size: inherit;
}

.ph-pin:hover .ph-pin-icon,
.ph-pin:focus .ph-pin-icon {
    transform: scale(1.25) translateY(-3px);
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.45));
    outline: none;
}

/* ---------- Pulse Animasyonu ---------- */
@keyframes ph-pulse-ring {
    0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(2.2);   opacity: 0; }
}

.ph-pin.ph-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0;
    animation: ph-pulse-ring 2s ease-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* ---------- Popup ---------- */
.ph-popup {
    position: absolute;
    background: #ffffff;
    border-radius: 10px;
    padding: 14px 16px;
    width: 220px;       /* default; overridden by Elementor */
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 9999;
    text-align: left;
    line-height: 1.5;
    will-change: opacity, transform; /* GPU compositing hint */
}

/* Show on hover / focus / active */
.ph-pin:hover,
.ph-pin:focus,
.ph-pin.ph-active {
    z-index: 9999 !important;
}

.ph-pin:hover .ph-popup,
.ph-pin:focus .ph-popup,
.ph-pin.ph-active .ph-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* ---------- Popup Yöne Göre Konum ---------- */

/* YUKARI (default) */
.ph-popup-top {
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(6px) scale(0.97);
}
.ph-pin:hover .ph-popup-top,
.ph-pin:focus .ph-popup-top,
.ph-pin.ph-active .ph-popup-top {
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Ok - yukarı popup */
.ph-popup-top::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--ph-arrow-color, #ffffff);
}

/* AŞAĞI */
.ph-popup-bottom {
    top: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px) scale(0.97);
}
.ph-pin:hover .ph-popup-bottom,
.ph-pin:focus .ph-popup-bottom,
.ph-pin.ph-active .ph-popup-bottom {
    transform: translateX(-50%) translateY(0) scale(1);
}
.ph-popup-bottom::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: var(--ph-arrow-color, #ffffff);
}

/* SOL */
.ph-popup-left {
    top: 50%;
    right: calc(100% + 14px);
    transform: translateY(-50%) translateX(6px) scale(0.97);
}
.ph-pin:hover .ph-popup-left,
.ph-pin:focus .ph-popup-left,
.ph-pin.ph-active .ph-popup-left {
    transform: translateY(-50%) translateX(0) scale(1);
}
.ph-popup-left::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left-color: var(--ph-arrow-color, #ffffff);
}

/* SAĞ */
.ph-popup-right {
    top: 50%;
    left: calc(100% + 14px);
    transform: translateY(-50%) translateX(-6px) scale(0.97);
}
.ph-pin:hover .ph-popup-right,
.ph-pin:focus .ph-popup-right,
.ph-pin.ph-active .ph-popup-right {
    transform: translateY(-50%) translateX(0) scale(1);
}
.ph-popup-right::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-right-color: var(--ph-arrow-color, #ffffff);
}

/* ---------- Popup İçerik Tipografisi ---------- */
.ph-popup h4 {
    margin: 0 0 6px 0;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.ph-popup p {
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #444444;
    line-height: 1.55;
}

.ph-popup-link {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background-color: #2563eb;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.ph-popup-link:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
}

/* ---------- Erişilebilirlik - Focus ring ---------- */
.ph-pin:focus {
    outline: none;
}
.ph-pin:focus-visible .ph-pin-icon {
    outline: 3px solid #4a90e2;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Mobil – Küçük ekranda popup taşmasin ---------- */
@media (max-width: 600px) {
    .ph-popup {
        width: 160px !important;
        font-size: 12px;
        padding: 10px 12px;
    }
    .ph-popup h4 {
        font-size: 12px;
    }
    .ph-popup p {
        font-size: 11px;
    }
}
