/* Wiki-style Tooltips for Barrio Terms */
.tdb-term {
    border-bottom: 2px dashed #E4007C;
    cursor: help;
    position: relative;
    display: inline; /* Changed to inline to avoid layout shifts and visibility issues */
    font-weight: bold;
    color: inherit;
    transition: background-color 0.2s;
}

.tdb-term:hover, .tdb-term.active {
    background-color: rgba(255, 184, 0, 0.15); /* Soft gold highlight instead of dark/purple */
}

.tdb-tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    background-color: #1A1A1A;
    color: #F9F9F9;
    padding: 1.25rem;
    border-radius: 24px;
    border: 3px solid #FFB800;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    z-index: 9999; /* Higher z-index to stay on top of everything */
    font-size: 0.85rem;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
}

.tdb-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -10px;
    border-width: 10px;
    border-style: solid;
    border-color: #FFB800 transparent transparent transparent;
}

.tdb-term:hover .tdb-tooltip, 
.tdb-term.active .tdb-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
    pointer-events: auto;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .tdb-tooltip {
        width: 200px;
        bottom: auto;
        top: 125%;
    }
    .tdb-tooltip::after {
        top: auto;
        bottom: 100%;
        border-color: transparent transparent #FFB800 transparent;
    }
}
