/**
 * TGP Item Database — Tooltip Styles (sitewide)
 */

/* Tagged items — orange highlight box, pointer cursor, no ? */
.tgp-item-tag,
a[data-item-id]:not(.tgpdb-item-card):not(.tgpdb-related-card):not(.tgpb-item-card) {
    display: inline;
    color: var(--tgp-accent, #ff8a00);
    background: rgba(255, 138, 0, 0.12);
    border: 1px solid rgba(255, 138, 0, 0.3);
    border-radius: 3px;
    padding: 1px 5px 1px 3px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tgp-item-tag:hover,
a[data-item-id]:not(.tgpdb-item-card):not(.tgpdb-related-card):not(.tgpb-item-card):hover {
    background: rgba(255, 138, 0, 0.22);
    border-color: rgba(255, 138, 0, 0.55);
    color: var(--tgp-accent-hover, #ff9f2e);
    text-decoration: none;
}

/* Inline icon (16px) inside the tag */
.tgp-item-tag-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 3px;
    border-radius: 2px;
    object-fit: contain;
    pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Tooltip Card                                                         */
/* ------------------------------------------------------------------ */
.tgpdb-tooltip-card {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 999999;
    width: 300px;
    background: #1e1e30;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: all;  /* Critical: allows mouse to move onto card */
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
    font-family: inherit;
}

.tgpdb-tooltip-card.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0s;
}

.tgpdb-tooltip-inner {
    padding: 14px;
}

/* Header row: icon + meta */
.tgpdb-tt-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.tgpdb-tt-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tgpdb-tt-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tgpdb-tt-rarity {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.tgpdb-tt-name {
    font-size: 15px;
    font-weight: 700;
    color: #f0f0f5;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tgpdb-tt-type {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Description */
.tgpdb-tt-desc {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tgpdb-tt-stats {
    margin: 0 0 10px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.tgpdb-tt-stats-title {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.tgpdb-tt-stat-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    padding: 2px 0;
}

.tgpdb-tt-stat-label {
    color: rgba(255, 255, 255, 0.58);
}

.tgpdb-tt-stat-value {
    color: #f0f0f5;
    font-weight: 600;
    text-align: right;
}

/* View Item link */
.tgpdb-tt-link {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #ff8a00;
    text-decoration: none;
    padding: 6px 10px;
    background: rgba(255, 138, 0, 0.1);
    border: 1px solid rgba(255, 138, 0, 0.25);
    border-radius: 6px;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.tgpdb-tt-link:hover {
    background: rgba(255, 138, 0, 0.2);
    color: #ff9f2e;
    text-decoration: none;
}

/* Loading state */
.tgpdb-tt-loading {
    display: block;
    text-align: center;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-style: italic;
}
