@use "style.scss";

ueb-link {
    position: absolute;
    --ueb-link-color: rgb(var(--ueb-link-color-rgb));
    /* when from-y > to-y */
    display: block;
    margin-left: calc(var(--ueb-link-start) * -1px);
    min-width: calc(var(--ueb-link-min-width) * 1px);
    /*
     * This makes the element transparent to the hover events so that multiple path elements can stand nearby and have
     * their hover behavior correctly firing.
     */
    visibility: hidden;
}

ueb-link>svg {
    position: absolute;
    width: 100% !important;
    height: 100% !important;
    min-height: 1px !important;
    transform: scaleX(var(--ueb-link-scale-x)) scaleY(var(--ueb-link-scale-y));
    z-index: 1;
}

ueb-link .ueb-link-path {
    visibility: visible;
    stroke: var(--ueb-link-color);
    stroke-width: calc(1.5px / var(--ueb-scale));
    transition: stroke-width 0.8s;
}

ueb-link .ueb-link-area {
    visibility: visible;
    stroke-width: 20px;
}

ueb-link[data-dragging="true"] .ueb-link-path,
.ueb-link-area:hover~.ueb-link-path {
    stroke-width: calc(6px / var(--ueb-scale));
}

ueb-link[data-dragging="true"] .ueb-link-message {
    display: block;
    visibility: visible;
}

.ueb-link-message {
    --ueb-link-message-top: calc(50% * (var(--ueb-link-scale-y) + 1) + 22px);
    --ueb-link-message-left: calc(100% - var(--ueb-start-percentage) + 15px);
    display: none;
    position: absolute;
    top: var(--ueb-link-message-top);
    left: var(--ueb-link-message-left);
    border: 1px solid #000;
    border-radius: 2px;
    background: linear-gradient(to bottom, #2a2a2a 0, #151515 50%, #2a2a2a 100%);
    color: var(--ueb-pin-dim-color);
    white-space: nowrap;
    z-index: 1000000;
}

ueb-link[data-from-input="true"] .ueb-link-message {
    --ueb-link-message-top: calc(-50% * (var(--ueb-link-scale-y) - 1) + 22px);
    --ueb-link-message-left: calc(var(--ueb-start-percentage) + 15px);
}

.ueb-link-message-icon {
    display: inline-block;
    padding: 4px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.ueb-link-message-text {
    padding: 4px;
    padding-left: 0;
    vertical-align: middle;
}

.ueb-link-message-icon svg {
    width: 100%;
    height: 100%;
}
