/* ========================================
   REUSABLE TOOLTIP COMPONENT
   ======================================== */

.re-tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

.re-tooltip {
    position: absolute;
    background: var(--text-primary, #1f2937);
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.4;
    max-width: 260px;
    width: max-content;
    white-space: normal;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1000;
    pointer-events: none;
}

.re-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* --- Position: Top (default) --- */
.re-tooltip-top {
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
}

.re-tooltip-top .re-tooltip-arrow {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-primary, #1f2937);
}

/* --- Position: Bottom --- */
.re-tooltip-bottom {
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
}

.re-tooltip-bottom .re-tooltip-arrow {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: var(--text-primary, #1f2937);
}

/* --- Position: Left --- */
.re-tooltip-left {
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
}

.re-tooltip-left .re-tooltip-arrow {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--text-primary, #1f2937);
}

/* --- Position: Right --- */
.re-tooltip-right {
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
}

.re-tooltip-right .re-tooltip-arrow {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--text-primary, #1f2937);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .re-tooltip {
        transition: none;
    }
}
