/**
 * TD Map Location Component Styles (Plugin: td-uxbuilder-blocks)
 * Matches Figma Node 208:3349, 208:3504, 208:3103, 208:3192
 */

.td-map-location-wrap {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    box-sizing: border-box;
    user-select: none;
    font-family: inherit;
}

.td-map-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 635 / 515;
    box-sizing: border-box;
}

.td-map-canvas-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.td-map-base-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* ============================================================================
   LOCATION DOT ITEMS (PINS, RIPPLE RINGS, LABELS)
   ============================================================================ */
.td-map-dot-item {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    z-index: 5;
    cursor: pointer;
    outline: none;
}

/* Quy Nhơn coordinate: 52.76% X, 33.59% Y */
.td-map-dot-quynhon {
    left: 52.76%;
    top: 33.59%;
}

/* TP.HCM coordinate: 26.14% X, 73.59% Y */
.td-map-dot-hcm {
    left: 26.14%;
    top: 73.59%;
}

/* Concentric Ripple Rings */
.td-map-ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.td-map-ripple-outer {
    width: 246px;
    height: 246px;
}

.td-map-ripple-inner {
    width: 128px;
    height: 128px;
}

/* Default state: subtle gray rings for inactive, orange for active */
.td-map-dot-item .td-map-ripple-outer {
    background-color: rgba(26, 26, 26, 0.04);
}

.td-map-dot-item .td-map-ripple-inner {
    background-color: rgba(26, 26, 26, 0.08);
}

/* Pin Button */
.td-map-pin-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2.5px solid #FFFFFF;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1A1A1A;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.td-map-pin-btn svg {
    stroke: #FFFFFF;
    transition: transform 0.25s ease;
}

.td-map-pin-btn .td-icon-active {
    display: none;
}

.td-map-pin-btn .td-icon-inactive {
    display: block;
}

.td-map-dot-item:hover .td-map-pin-btn {
    transform: translate(-50%, -50%) scale(1.08);
}

/* Location Label Badge */
.td-map-label-badge {
    position: absolute;
    top: calc(50% + 28px);
    left: 50%;
    transform: translateX(-50%);
    height: 32px;
    padding: 4px 16px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    background-color: #1A1A1A;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    pointer-events: auto;
}

/* ============================================================================
   ACTIVE STATES (QUY NHON VS TP.HCM)
   ============================================================================ */

/* 1. When Quy Nhon is Active */
.td-map-location-wrap.is-active-quynhon .td-map-dot-quynhon .td-map-ripple-outer {
    background-color: rgba(249, 115, 22, 0.07);
    animation: tdMapPulse 2.8s infinite ease-out;
}

.td-map-location-wrap.is-active-quynhon .td-map-dot-quynhon .td-map-ripple-inner {
    background-color: rgba(249, 115, 22, 0.16);
}

.td-map-location-wrap.is-active-quynhon .td-map-dot-quynhon .td-map-pin-btn {
    background-color: #F97316;
}

.td-map-location-wrap.is-active-quynhon .td-map-dot-quynhon .td-map-pin-btn .td-icon-active {
    display: block;
}

.td-map-location-wrap.is-active-quynhon .td-map-dot-quynhon .td-map-pin-btn .td-icon-inactive {
    display: none;
}

.td-map-location-wrap.is-active-quynhon .td-map-dot-quynhon .td-map-label-badge {
    background-color: #F97316;
}

/* 2. When TP.HCM is Active */
.td-map-location-wrap.is-active-hcm .td-map-dot-hcm .td-map-ripple-outer {
    background-color: rgba(249, 115, 22, 0.07);
    animation: tdMapPulse 2.8s infinite ease-out;
}

.td-map-location-wrap.is-active-hcm .td-map-dot-hcm .td-map-ripple-inner {
    background-color: rgba(249, 115, 22, 0.16);
}

.td-map-location-wrap.is-active-hcm .td-map-dot-hcm .td-map-pin-btn {
    background-color: #F97316;
}

.td-map-location-wrap.is-active-hcm .td-map-dot-hcm .td-map-pin-btn .td-icon-active {
    display: block;
}

.td-map-location-wrap.is-active-hcm .td-map-dot-hcm .td-map-pin-btn .td-icon-inactive {
    display: none;
}

.td-map-location-wrap.is-active-hcm .td-map-dot-hcm .td-map-label-badge {
    background-color: #F97316;
}

/* Pulse Keyframes */
@keyframes tdMapPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.96);
        opacity: 0.8;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.96);
        opacity: 0.8;
    }
}

/* ============================================================================
   INFORMATION CARDS
   ============================================================================ */
.td-map-card {
    position: absolute;
    width: 380px;
    max-width: 58%;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
    z-index: 6;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

/* Quy Nhon Card: bottom right (Node 208:3103) */
.td-map-card-quynhon {
    right: 0;
    bottom: -3%;
}

/* TP.HCM Card: top right (Node 208:3192) */
.td-map-card-hcm {
    right: 10%;
    top: 5%;
}

/* Card Visibility Based on Active State */
.td-map-location-wrap.is-active-quynhon .td-map-card-quynhon {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.td-map-location-wrap.is-active-hcm .td-map-card-hcm {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Card Content Typography */
.td-map-card-img {
    width: 100%;
    height: 135px;
    overflow: hidden;
    background-color: #F3F4F6;
}

.td-map-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.td-map-card-body {
    padding: 16px 20px 18px;
    box-sizing: border-box;
}

.td-map-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #101828;
    margin: 0 0 4px 0;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.td-map-card-tag {
    font-size: 14px;
    font-weight: 500;
    color: #F97316;
    margin: 0 0 10px 0;
}

.td-map-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.td-map-card-list li {
    position: relative;
    padding-left: 14px;
    font-size: 11px;
    margin: 0;
    color: #374151;
    line-height: 1.45;
    margin: 0;
}

.td-map-card-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    top: 0;
    color: #1A1A1A;
    font-size: 15px;
    line-height: 1.2;
}

/* ============================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ============================================================================ */
@media (max-width: 767px) {
    .td-map-location-wrap {
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
    }

    .td-map-canvas {
        position: relative;
        width: 100%;
        aspect-ratio: 635 / 515;
        display: block;
    }

    .td-map-canvas-inner {
        position: relative;
        width: 100%;
        height: 100%;
    }

    /* Scaled down ripple rings and pins */
    .td-map-ripple-outer {
        width: clamp(110px, 30vw, 150px);
        height: clamp(110px, 30vw, 150px);
    }

    .td-map-ripple-inner {
        width: clamp(58px, 16vw, 80px);
        height: clamp(58px, 16vw, 80px);
    }

    .td-map-dot-item {
        width: clamp(30px, 8vw, 36px);
        height: clamp(30px, 8vw, 36px);
    }

    .td-map-pin-btn {
        width: clamp(30px, 8vw, 36px);
        height: clamp(30px, 8vw, 36px);
        border-width: 2px;
    }

    .td-map-pin-btn svg {
        width: clamp(12px, 3.2vw, 15px);
        height: clamp(12px, 3.2vw, 15px);
    }

    .td-map-label-badge {
        height: clamp(22px, 5.8vw, 26px);
        padding: 2px clamp(8px, 2.2vw, 12px);
        font-size: clamp(11px, 2.8vw, 13px);
        top: calc(50% + clamp(18px, 4.8vw, 22px));
    }

    /* On mobile, cards remain absolute like desktop but scaled down (Nodes 209:3673 & 209:3764) */
    .td-map-card {
        position: absolute;
        width: clamp(185px, 52%, 245px);
        max-width: 54%;
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        z-index: 6;
        margin: 0;
        box-sizing: border-box;
    }

    /* Quy Nhon Card: bottom right */
    .td-map-card-quynhon {
        right: 10%;
        bottom: -20%;
    }

    /* TP.HCM Card: top right */
    .td-map-card-hcm {
        right: 22%;
        top: -6%;
    }


    .td-map-card-img {
        height: clamp(56px, 15vw, 76px);
    }

    .td-map-card-body {
        padding: 6px 10px 8px;
    }

    .td-map-card-title {
        font-size: clamp(10.5px, 2.8vw, 12.5px);
        font-weight: 700;
        margin: 0 0 2px 0;
        line-height: 1.25;
        letter-spacing: -0.01em;
    }

    .td-map-card-tag {
        font-size: clamp(8.5px, 2.2vw, 10px);
        font-weight: 600;
        margin: 0 0 4px 0;
        line-height: 1.2;
    }

    .td-map-card-list {
        gap: 2px;
    }

    .td-map-card-list li {
        font-size: clamp(8px, 2.1vw, 9.5px);
        line-height: 1.35;
        padding-left: 9px;
    }

    .td-map-card-list li::before {
        font-size: 10px;
        top: -1px;
    }
}

/* Extra small mobile devices (<= 360px) */
@media (max-width: 360px) {
    .td-map-card {
        width: clamp(170px, 52%, 185px);
        max-width: 54%;
    }

    .td-map-card-img {
        height: 50px;
    }

    .td-map-card-body {
        padding: 5px 8px 6px;
    }

    .td-map-card-title {
        font-size: 10px;
    }

    .td-map-card-tag {
        font-size: 8px;
        margin-bottom: 3px;
    }

    .td-map-card-list li {
        font-size: 7.5px;
        line-height: 1.3;
        padding-left: 7px;
    }
}