/**
 * Global tooltip styling for the webapp.
 * All tooltips use a single fixed .app-tooltip element (created by tooltips.js).
 * Rules: always on top of other elements; black background; white text;
 * default above trigger, else right/left if insufficient space.
 */

/* Single shared tooltip element - always on top */
.app-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 2147483647;
    margin: 0;
    padding: 0.4rem 0.75rem;
    background: #000;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.app-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* Arrow: default above (arrow below tooltip) */
.app-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
}

.app-tooltip.above::after {
    top: 100%;
    border-top-color: #000;
}

.app-tooltip.below::after {
    top: auto;
    bottom: 100%;
    border-bottom-color: #000;
    border-top-color: transparent;
}

.app-tooltip.right::after {
    left: 0;
    top: 50%;
    margin-left: -5px;
    margin-top: -5px;
    border-right-color: #000;
    border-top-color: transparent;
}

.app-tooltip.left::after {
    left: auto;
    right: 0;
    margin-left: 0;
    margin-right: -5px;
    top: 50%;
    margin-top: -5px;
    border-left-color: #000;
    border-right-color: transparent;
    border-top-color: transparent;
}

/* Inline tooltip text is only used as data source; do not show the old element */
.app-tooltips-active .custom-tooltip {
    display: none !important;
}

.app-tooltips-active [data-tooltip]:hover::after {
    display: none !important;
}
