/* Global Tooltip System */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

/* Ensure tooltips work on disabled elements */
[data-tooltip]:disabled {
    pointer-events: auto !important;
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid rgba(0, 0, 0, 0.9);
}

.tooltip.tooltip-top::before {
    top: auto;
    bottom: -4px;
    border-bottom: none;
    border-top: 4px solid rgba(0, 0, 0, 0.9);
}

.tooltip.tooltip-left::before {
    top: 50%;
    left: auto;
    right: -4px;
    transform: translateY(-50%);
    border-bottom: none;
    border-left: 4px solid rgba(0, 0, 0, 0.9);
}

.tooltip.tooltip-right::before {
    top: 50%;
    left: -4px;
    transform: translateY(-50%);
    border-bottom: none;
    border-right: 4px solid rgba(0, 0, 0, 0.9);
}

/* Tooltip positioning for action buttons */
.property-actions .tooltip {
    top: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
}

.property-actions .tooltip.show {
    transform: translateX(-50%) translateY(0);
}

.property-actions .tooltip::before {
    top: auto;
    bottom: -4px;
    border-bottom: none;
    border-top: 4px solid rgba(0, 0, 0, 0.9);
}

/* Tooltip positioning for timeline actions */
.timeline-actions-expanded .tooltip {
    top: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
}

.timeline-actions-expanded .tooltip.show {
    transform: translateX(-50%) translateY(0);
}

.timeline-actions-expanded .tooltip::before {
    top: auto;
    bottom: -4px;
    border-bottom: none;
    border-top: 4px solid rgba(0, 0, 0, 0.9);
}

/* Mobile responsive tooltips */
@media (max-width: 768px) {
    .tooltip {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 200px;
        white-space: normal;
        text-align: center;
    }
    
    .tooltip::before {
        border-width: 3px;
    }
    
    .tooltip.tooltip-top::before {
        border-top-width: 3px;
    }
    
    .tooltip.tooltip-left::before,
    .tooltip.tooltip-right::before {
        border-left-width: 3px;
        border-right-width: 3px;
    }
}
