/* wraith here, for honesty purposes: i coded the 4 main orientations and base styles and then had gemini ai do the tedious work of adding the extra alignment options. */

/* Base styles shared across all variations */
[class*="tt-"] {
    position: relative; 

    &:after {
        content: attr(data-tooltip);
        display: block;
        opacity: 0;
        pointer-events: none;
        position: absolute;
        background: var(--bg);
        border: 1px solid var(--border-sep);
        padding: 0.2rem 0.3rem;
        border-radius: var(--corners);
        transition: opacity 0.15s ease;
        z-index: 9999;
        font-size: 0.9em;
        white-space: nowrap;
        color: var(--textb);
    }

    &:not(:has(.ql-table-select-container:hover, .ql-picker-options:hover)):hover:after {
        transition-delay: 1s;
        opacity: 1;
    }

    --tt-gap: 0.3rem;
}

/* ==========================================
   TOP ORIENTATIONS (Above the element)
   ========================================== */
.tt-t-l:after {
    bottom: calc(100% + var(--tt-gap));
    left: 0;
}
.tt-t-m:after {
    bottom: calc(100% + var(--tt-gap));
    left: 50%;
    transform: translateX(-50%);
}
.tt-t-r:after {
    bottom: calc(100% + var(--tt-gap));
    right: 0;
}

/* ==========================================
   BOTTOM ORIENTATIONS (Below the element)
   ========================================== */
.tt-b-l:after {
    top: calc(100% + var(--tt-gap));
    left: 0;
}
.tt-b-m:after {
    top: calc(100% + var(--tt-gap));
    left: 50%;
    transform: translateX(-50%);
}
.tt-b-r:after {
    top: calc(100% + var(--tt-gap));
    right: 0;
}

/* ==========================================
   LEFT ORIENTATIONS (To the left of the element)
   ========================================== */
.tt-l-t:after {
    right: calc(100% + var(--tt-gap));
    top: 0;
}
.tt-l-m:after {
    right: calc(100% + var(--tt-gap));
    top: 50%;
    transform: translateY(-50%);
}
.tt-l-b:after {
    right: calc(100% + var(--tt-gap));
    bottom: 0;
}

/* ==========================================
   RIGHT ORIENTATIONS (To the right of the element)
   ========================================== */
.tt-r-t:after {
    left: calc(100% + var(--tt-gap));
    top: 0;
}
.tt-r-m:after {
    left: calc(100% + var(--tt-gap));
    top: 50%;
    transform: translateY(-50%);
}
.tt-r-b:after {
    left: calc(100% + var(--tt-gap));
    bottom: 0;
}