/* Tooltip System - Portal Based (clones to body, escapes everything) */

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

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 50%;
    font-size: 9px;
    color: #00e5ff;
    cursor: help;
    transition: all 0.2s ease;
}

.tooltip-icon:hover {
    background: rgba(0, 229, 255, 0.2);
    border-color: #00e5ff;
    transform: scale(1.1);
}

/* Original tooltip-content inside wrapper: always hidden (JS clones to portal) */
.tooltip-wrapper .tooltip-content {
    display: none !important;
}

/* Portal clone styling */
#tooltip-portal .tooltip-content {
    position: fixed;
    display: block;
    min-width: 200px;
    max-width: 260px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(10, 20, 40, 0.98), rgba(0, 30, 50, 0.98));
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.15);
    pointer-events: none;
    white-space: normal;
}

#tooltip-portal .tooltip-content::after {
    content: '';
    position: absolute;
    top: -6px;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 229, 255, 0.4);
}

/* Arrow flipped when tooltip opens upward */
#tooltip-portal .tooltip-content.tooltip-above::after {
    top: auto;
    bottom: -6px;
    border-bottom-color: transparent;
    border-top-color: rgba(0, 229, 255, 0.4);
}

.tooltip-title {
    font-size: 12px;
    font-weight: bold;
    color: #00e5ff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip-text {
    font-size: 11px;
    color: #ccc;
    line-height: 1.5;
}

.tooltip-text ul {
    margin: 6px 0 0 0;
    padding-left: 16px;
}

.tooltip-text li {
    margin: 3px 0;
    color: #aaa;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #tooltip-portal .tooltip-content {
        max-width: 260px;
        font-size: 10px;
    }
    
    .tooltip-icon {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
}
