/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

 /**
 * Tooltip Styles
 */

[shuaoor-tooltip] {
    position: relative;
}

/* Applies to all tooltips */
[shuaoor-tooltip]::before,
[shuaoor-tooltip]::after {
    text-transform: none;
    font-size: 14px;
    line-height: 1.2;
    user-select: none;
    pointer-events: none;
    position: absolute;
    display: none;
    opacity: 0;
}

[shuaoor-tooltip]::before {
    content: '';
    border: 5px solid transparent;
    z-index: 1001;
}

[shuaoor-tooltip]::after {
    content: attr(shuaoor-tooltip);
    font-weight: 500;
    text-align: center;

    /* 
    Let the content set the size of the tooltips 
    but this will also keep them from being obnoxious
      */
    min-width: 3em;
    max-width: 21em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 1em 2em -.5em rgba(0, 0, 0, 0.35);
    background: #333;
    color: #fff;
    z-index: 1000;
}

/* Make the tooltips respond to hover */
[shuaoor-tooltip]:hover::before,
[shuaoor-tooltip]:hover::after {
    display: block;
}

/* don't show empty tooltips */
[tooltip='']::before,
[tooltip='']::after {
    display: none !important;
}

/* FLOW: UP */
[shuaoor-tooltip]:not([flow])::before,
[shuaoor-tooltip][flow^="up"]::before {
    bottom: 95%;
    border-bottom-width: 0;
    border-top-color: #333;
}

[shuaoor-tooltip]:not([flow])::after,
[shuaoor-tooltip][flow^="up"]::after {
    bottom: calc(95% + 5px);
}

[shuaoor-tooltip]:not([flow])::before,
[shuaoor-tooltip]:not([flow])::after,
[shuaoor-tooltip][flow^="up"]::before,
[shuaoor-tooltip][flow^="up"]::after {
    left: 50%;
    transform: translate(-50%, -.5em);
}


/* KEYFRAMES */
@keyframes tooltips-vert {
    to {
        opacity: .9;
        transform: translate(-50%, 0);
    }
}

@keyframes tooltips-horz {
    to {
        opacity: .9;
        transform: translate(0, -50%);
    }
}

/* FX All The Things */
[shuaoor-tooltip]:not([flow]):hover::before,
[shuaoor-tooltip]:not([flow]):hover::after,
[shuaoor-tooltip][flow^="up"]:hover::before,
[shuaoor-tooltip][flow^="up"]:hover::after {
    animation: tooltips-vert 300ms ease-out forwards;
}