/**
 * Ukraine Map Section Styles (jVectorMap Integration)
 */

.map-section {
    padding: 100px 0;
    background-color: #ffffff;
    overflow: hidden;
}

.map-section .section-title {
    text-align: center;
    margin-bottom: 60px;
    font-size: 42px;
    font-weight: 800;
    color: #173750;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.map-wrapper {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

#ukraine-map {
    background: transparent !important;
    position: relative;
}

/* Fix jVectorMap SVG sizing */
#ukraine-map .jvectormap-container {
    width: 100% !important;
    height: 100% !important;
    position: relative;
    z-index: 1;
}

#ukraine-map svg {
    width: 100% !important;
    height: 100% !important;
    max-height: 600px;
    filter: drop-shadow(1px 0 0 #002E5D) drop-shadow(-1px 0 0 #002E5D) drop-shadow(0 1px 0 #002E5D) drop-shadow(0 -1px 0 #002E5D) drop-shadow(0 10px 20px rgba(0, 46, 93, 0.15));
}

/* Map markers */
.map-marker-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.map-marker {
    position: absolute;
    width: 52px;
    height: 66px;
    transform: translate(-50%, -100%);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    pointer-events: auto;
    z-index: 6;
}

.pin {
    position: absolute;
    left: 50%;
    top: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50% 50% 50% 0;
    background: #173750;
    transform: translateX(-50%) rotate(-45deg);
    box-shadow: 0 10px 18px rgba(23, 55, 80, 0.2);
    animation-name: map-bounce;
    animation-fill-mode: both;
    animation-duration: 1s;
}

.pin::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 50%;
}

.map-marker__thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #ffffff;
}

.map-marker__thumb--empty {
    background: #ffffff;
}

.pulse {
    background: rgba(23, 55, 80, 0.2);
    border-radius: 50%;
    height: 14px;
    width: 14px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: 11px 0 0 -12px;
    transform: rotateX(55deg);
    z-index: -1;
}

.pulse::after {
    content: "";
    border-radius: 50%;
    height: 40px;
    width: 40px;
    position: absolute;
    margin: -13px 0 0 -13px;
    animation: map-pulsate 2.6s ease-out infinite;
    opacity: 0;
    box-shadow: 0 0 1px 1px rgba(23, 55, 80, 0.35);
    animation-delay: 0.8s;
}

.map-marker__info {
    position: absolute;
    left: 50%;
    top: 58px;
    transform: translateX(-50%);
    background: #ffffff;
    border: 1px solid rgba(23, 55, 80, 0.12);
    border-radius: 10px;
    padding: 8px 10px;
    min-width: 160px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(23, 55, 80, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translate(-50%, 6px);
}

.map-marker__info::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -6px;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 1px solid rgba(23, 55, 80, 0.12);
    border-top: 1px solid rgba(23, 55, 80, 0.12);
    transform: translateX(-50%) rotate(45deg);
}

.map-marker__city {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(23, 55, 80, 0.7);
    font-weight: 700;
    margin-bottom: 4px;
}

.map-marker__name {
    font-weight: 700;
    font-size: 14px;
    color: #173750;
    margin-bottom: 4px;
}

.map-marker__services {
    font-size: 12px;
    color: rgba(23, 55, 80, 0.72);
}

.map-marker:hover .pin,
.map-marker:focus-visible .pin {
    background: #0f2b44;
    box-shadow: 0 12px 24px rgba(23, 55, 80, 0.3);
}

.map-marker:hover .map-marker__info,
.map-marker:focus-visible .map-marker__info {
    opacity: 1;
    transform: translate(-50%, 0);
}

.map-marker:focus-visible {
    outline: 2px solid rgba(23, 55, 80, 0.35);
    outline-offset: 4px;
    border-radius: 16px;
}

.map-marker-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.map-marker-modal.is-open {
    display: flex;
}

.map-marker-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 24, 38, 0.55);
}

.map-marker-modal__body {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    width: min(520px, 92%);
    box-shadow: 0 30px 60px rgba(10, 20, 30, 0.25);
    z-index: 2;
}

.map-marker-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(23, 55, 80, 0.08);
    color: #173750;
    font-size: 18px;
    cursor: pointer;
}

.map-marker-modal__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.map-marker-modal__media {
    flex: 0 0 auto;
}

.map-marker-modal__thumb {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.map-marker-modal__thumb--circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #f2f5f8;
    border: 2px solid rgba(23, 55, 80, 0.12);
}

.map-marker-modal__city {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(23, 55, 80, 0.6);
    font-weight: 700;
    margin-bottom: 6px;
}

.map-marker-modal__name {
    font-size: 22px;
    font-weight: 700;
    color: #173750;
    margin-bottom: 6px;
}

.map-marker-modal__address {
    font-size: 13px;
    color: rgba(23, 55, 80, 0.75);
    margin-bottom: 6px;
}

.map-marker-modal__services {
    font-size: 13px;
    color: rgba(23, 55, 80, 0.75);
    margin-bottom: 12px;
}

.map-marker-modal__description {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(23, 55, 80, 0.85);
}

/* jVectorMap Tooltip Customization */
.jvectormap-tip {
    background: #173750;
    border: 1px solid #FFBE2E;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    padding: 12px 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    /* Ensure tooltip doesn't show default content when empty */
    min-width: 150px;
}

/* Hide default jvectormap-tip when custom content is used */
.jvectormap-tip:empty {
    display: none !important;
}

/* Custom tooltip content styling */
.map-tooltip {
    /* Ensure the custom tooltip takes full control */
    width: 100%;
}

.map-tooltip .tooltip-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
    color: #FFBE2E;
    /* Prevent any default text from showing through */
    white-space: nowrap;
}

.map-tooltip .tooltip-hint {
    font-size: 12px;
    opacity: 0.8;
    /* Ensure proper text wrapping */
    white-space: normal;
    line-height: 1.4;
}

/* Marker Pulse Animation using CSS */
/* Note: jVectorMap uses SVG for markers, but we can target them if needed */
/* For now, we rely on the markerStyle defined in JS */

/* Responsive */
@media (max-width: 1200px) {
    #ukraine-map {
        height: 450px !important;
    }
}


@media (max-width: 992px) {
    .map-section {
        padding: 80px 0;
    }

    .map-section .section-title {
        font-size: 32px;
        margin-bottom: 40px;
    }

    #ukraine-map {
        height: 400px !important;
    }

    .map-marker {
        width: 48px;
        height: 60px;
    }

    .pin {
        width: 22px;
        height: 22px;
    }

    .map-marker__thumb {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 768px) {
    .map-section {
        padding: 60px 0;
    }

    .map-section .section-title {
        font-size: 26px;
        margin-bottom: 30px;
    }

    #ukraine-map {
        height: 350px !important;
    }

    .map-marker {
        width: 44px;
        height: 56px;
    }

    .pin {
        width: 20px;
        height: 20px;
    }

    .map-marker__thumb {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    #ukraine-map {
        height: 250px !important;
    }

    .map-marker {
        width: 38px;
        height: 50px;
    }

    .pin {
        width: 18px;
        height: 18px;
    }

    .map-marker__thumb {
        width: 9px;
        height: 9px;
    }
}

@keyframes map-pulsate {
    0% {
        transform: scale(0.2, 0.2);
        opacity: 0;
    }
    50% {
        opacity: 0.35;
    }
    100% {
        transform: scale(0.9, 0.9);
        opacity: 0;
    }
}

@keyframes map-bounce {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-2000px) rotate(-45deg);
    }
    60% {
        opacity: 1;
        transform: translateX(-50%) translateY(30px) rotate(-45deg);
    }
    80% {
        transform: translateX(-50%) translateY(-10px) rotate(-45deg);
    }
    100% {
        transform: translateX(-50%) translateY(0) rotate(-45deg);
    }
}
