/* Global elegant tooltip — plain hand-written CSS, intentionally kept OUT of the
   Tailwind pipeline (Styles/app.css -> wwwroot/css/app.css) so `npm run css:build`
   never overwrites it. Paired with wwwroot/js/tooltip.js. */

#qa-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9999;
    max-width: 260px;
    padding: 6px 10px;
    border-radius: 7px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    color: #f4f6f8;
    background: rgba(17, 24, 39, 0.96);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.14);
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px) scale(0.96);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

#qa-tooltip.qa-tooltip-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#qa-tooltip::after {
    content: '';
    position: absolute;
    left: var(--qa-tip-arrow-x, 50%);
    width: 8px;
    height: 8px;
    background: inherit;
    transform: translateX(-50%);
}

#qa-tooltip[data-placement="top"]::after {
    bottom: -3px;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

#qa-tooltip[data-placement="bottom"]::after {
    top: -3px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

html.dark #qa-tooltip {
    background: rgba(30, 35, 45, 0.97);
    color: #e5e7eb;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    #qa-tooltip {
        transition: opacity 0.01ms linear;
        transform: none;
    }
}

@media print {
    #qa-tooltip {
        display: none !important;
    }
}
