/* Container */
.smart-media-hotspot-container {
    position: relative;
    width: 100%;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: #000;
    line-height: 0;
    /* Prevents tiny alignment gaps at the bottom of the image */
}

.smart-media-hotspot-bg {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

/* Pin Wrapper */
.smart-media-hotspot-pin-wrapper {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 10;
    line-height: normal;
    /* Restore line height inside tooltips */
}

/* Hotspot Pin Button */
.smart-media-hotspot-pin {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background-color: var(--pin-color, #ff4757);
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.25s ease;
    z-index: 2;
    outline: none;
    text-decoration: none !important;
}

.smart-media-hotspot-pin:hover,
.smart-media-hotspot-pin-wrapper.is-active .smart-media-hotspot-pin {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.smart-media-hotspot-pin .pin-dot {
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
}

/* Tooltip Styles */
.smart-media-hotspot-tooltip {
    position: absolute;
    width: 240px;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.25s;
    pointer-events: none;
}

/* Tooltip Visibility Hooks */
.smart-media-hotspot-container.trigger-is-hover .smart-media-hotspot-pin-wrapper:hover .smart-media-hotspot-tooltip,
.smart-media-hotspot-pin-wrapper.is-active .smart-media-hotspot-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Glassmorphism Inner Container */
.smart-media-hotspot-tooltip .tooltip-inner {
    padding: 16px;
    border-radius: 12px;
    background: rgba(20, 24, 33, 0.78);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
}

/* Tooltip Heading */
.smart-media-hotspot-tooltip .tooltip-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* Tooltip Content */
.smart-media-hotspot-tooltip .tooltip-content {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.82);
}

/* Tooltip Button */
.smart-media-hotspot-tooltip .tooltip-button {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    color: #ffffff;
    background-color: var(--pin-color, #ff4757);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.smart-media-hotspot-tooltip .tooltip-button:hover {
    background-color: #ffffff;
    color: #141821;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* Close Button (for Click trigger & mobile) */
.smart-media-hotspot-tooltip .tooltip-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.smart-media-hotspot-tooltip .tooltip-close:hover {
    color: #ffffff;
}

/* Tooltip Arrow */
.smart-media-hotspot-tooltip .tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    z-index: 101;
}

/* Position-specific styles */

/* TOP */
.smart-media-hotspot-tooltip.position-top {
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translate(-50%, 8px);
}

.smart-media-hotspot-container.trigger-is-hover .smart-media-hotspot-pin-wrapper:hover .smart-media-hotspot-tooltip.position-top,
.smart-media-hotspot-pin-wrapper.is-active .smart-media-hotspot-tooltip.position-top {
    transform: translate(-50%, 0);
}

.smart-media-hotspot-tooltip.position-top .tooltip-arrow {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-color: rgba(20, 24, 33, 0.78) transparent transparent;
}

/* BOTTOM */
.smart-media-hotspot-tooltip.position-bottom {
    top: calc(100% + 12px);
    left: 50%;
    transform: translate(-50%, -8px);
}

.smart-media-hotspot-container.trigger-is-hover .smart-media-hotspot-pin-wrapper:hover .smart-media-hotspot-tooltip.position-bottom,
.smart-media-hotspot-pin-wrapper.is-active .smart-media-hotspot-tooltip.position-bottom {
    transform: translate(-50%, 0);
}

.smart-media-hotspot-tooltip.position-bottom .tooltip-arrow {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px;
    border-color: transparent transparent rgba(20, 24, 33, 0.78);
}

/* LEFT */
.smart-media-hotspot-tooltip.position-left {
    right: calc(100% + 12px);
    top: 50%;
    transform: translate(8px, -50%);
}

.smart-media-hotspot-container.trigger-is-hover .smart-media-hotspot-pin-wrapper:hover .smart-media-hotspot-tooltip.position-left,
.smart-media-hotspot-pin-wrapper.is-active .smart-media-hotspot-tooltip.position-left {
    transform: translate(0, -50%);
}

.smart-media-hotspot-tooltip.position-left .tooltip-arrow {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent rgba(20, 24, 33, 0.78);
}

/* RIGHT */
.smart-media-hotspot-tooltip.position-right {
    left: calc(100% + 12px);
    top: 50%;
    transform: translate(-8px, -50%);
}

.smart-media-hotspot-container.trigger-is-hover .smart-media-hotspot-pin-wrapper:hover .smart-media-hotspot-tooltip.position-right,
.smart-media-hotspot-pin-wrapper.is-active .smart-media-hotspot-tooltip.position-right {
    transform: translate(0, -50%);
}

.smart-media-hotspot-tooltip.position-right .tooltip-arrow {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-color: transparent rgba(20, 24, 33, 0.78) transparent transparent;
}

/* Mobile responsive constraints */
@media (max-width: 480px) {
    .smart-media-hotspot-tooltip {
        width: 190px;
    }

    .smart-media-hotspot-tooltip .tooltip-inner {
        padding: 12px;
    }

    .smart-media-hotspot-tooltip .tooltip-title {
        font-size: 13px;
    }

    .smart-media-hotspot-tooltip .tooltip-content {
        font-size: 11px;
    }

    .smart-media-hotspot-tooltip .tooltip-button {
        padding: 6px 10px;
        font-size: 10px;
    }
}

/* Custom Image Pin Styles */
.smart-media-hotspot-pin.is-image-pin {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 32px;
    height: 32px;
}

.smart-media-hotspot-pin.is-image-pin .custom-pin-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Hover Image Styles */
.smart-media-hotspot-pin.is-image-pin .custom-pin-img.hover-img {
    display: none !important;
}

.smart-media-hotspot-pin.is-image-pin.has-hover-image:hover .custom-pin-img.normal-img {
    display: none !important;
}

.smart-media-hotspot-pin.is-image-pin.has-hover-image:hover .custom-pin-img.hover-img {
    display: block !important;
}

/* Custom Icon Pin Styles */
.smart-media-hotspot-pin.is-icon-pin {
    width: 28px;
    height: 28px;
    color: #ffffff;
    font-size: 14px;
}

.smart-media-hotspot-pin.is-icon-pin .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Text Pin Styles */
.smart-media-hotspot-pin.is-text-pin {
    width: auto !important;
    height: auto !important;
    aspect-ratio: auto !important;
    border-radius: 50px !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--pin-color, #ffffff) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

.smart-media-hotspot-pin.is-text-pin:hover,
.smart-media-hotspot-pin-wrapper.is-active .smart-media-hotspot-pin.is-text-pin {
    transform: scale(1.04) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
}

.smart-media-hotspot-pin.is-text-pin.is-light-bg {
    color: #0f172a !important;
}

.smart-media-hotspot-pin.is-text-pin.is-dark-bg {
    color: #ffffff !important;
}

/* ========================================================
   Global Modal Popup Styles (Glassmorphism & Bouncy Entry)
   ======================================================== */

.smart-media-hotspot-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.45); /* Modern slate overlay */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smart-media-hotspot-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Box */
.smart-media-hotspot-modal-box {
    background: rgba(20, 24, 33, 0.85); /* Matching glassmorphism tooltip inner container style */
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    padding: 32px 24px 24px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    color: #ffffff;
    position: relative;
    transform: scale(0.9) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* bouncy entry animation */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: normal;
}

.smart-media-hotspot-modal-overlay.is-open .smart-media-hotspot-modal-box {
    transform: scale(1) translateY(0);
}

/* Close Button */
.smart-media-hotspot-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.smart-media-hotspot-modal-close:hover {
    color: #ffffff;
    transform: rotate(90deg);
}

/* Modal Body Content */
.smart-media-hotspot-modal-body {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
}

.smart-media-hotspot-modal-body .popup-body-content {
    margin-bottom: 16px;
}

.smart-media-hotspot-modal-body p {
    margin: 0 0 12px 0;
}

.smart-media-hotspot-modal-body p:last-child {
    margin-bottom: 0;
}

/* Action Button in Modal */
.smart-media-hotspot-modal-body .popup-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    color: #ffffff;
    background-color: var(--pin-color, #ff4757);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
    margin-top: 12px;
}

.smart-media-hotspot-modal-body .popup-button:hover {
    background-color: #ffffff;
    color: #141821;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* Disable body scroll when modal is open */
body.smart-media-hotspot-modal-open {
    overflow: hidden;
}

/* Custom Fields Styling in Tooltips and Modal Popups */
.smart-media-hotspot-custom-fields {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smart-media-hotspot-custom-fields .cf-item {
    display: block;
    font-size: 13px;
    line-height: 1.5;
}

.smart-media-hotspot-custom-fields .cf-value {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-align: left;
}

/* Image Type Field */
.smart-media-hotspot-custom-fields .cf-type-image {
    display: block;
}

.smart-media-hotspot-custom-fields .cf-type-image .cf-value {
    width: 100%;
    text-align: left;
}

.smart-media-hotspot-custom-fields .cf-image-value {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 120px;
    object-fit: cover;
    display: block;
    margin-top: 4px;
}

/* File Type Field */
.smart-media-hotspot-custom-fields .cf-file-value {
    color: var(--pin-color, #ff4757);
    text-decoration: none !important;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.smart-media-hotspot-custom-fields .cf-file-value:hover {
    opacity: 0.8;
}

/* Gallery Type Field */
.smart-media-hotspot-custom-fields .cf-type-gallery {
    display: block;
}

.smart-media-hotspot-custom-fields .cf-type-gallery .cf-value {
    width: 100%;
}

.cf-gallery-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    margin-top: 6px;
    width: 100%;
}

.cf-gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.cf-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.cf-gallery-item:hover .cf-gallery-img {
    transform: scale(1.1);
}