.tooltip-container {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    opacity: 1;
    animation: tooltipFadeIn var(--transition-base) ease-out forwards;
}

.tooltip-content {
    background: var(--color-gray-800);
    color: var(--color-text-white);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.5;
    max-width: 280px;
    word-wrap: break-word;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
}

.tooltip-left .tooltip-arrow {
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    border-left: 8px solid var(--color-gray-800);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: none;
}

.tooltip-right .tooltip-arrow {
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    border-right: 8px solid var(--color-gray-800);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: none;
}

.tooltip-top .tooltip-arrow {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-top: 8px solid var(--color-gray-800);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: none;
}

.tooltip-bottom .tooltip-arrow {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom: 8px solid var(--color-gray-800);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: none;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tooltip-right {
    animation: tooltipFadeInRight var(--transition-base) ease-out forwards;
}

.tooltip-top {
    animation: tooltipFadeInTop var(--transition-base) ease-out forwards;
}

.tooltip-bottom {
    animation: tooltipFadeInBottom var(--transition-base) ease-out forwards;
}

.tooltip-left {
    animation: tooltipFadeInLeft var(--transition-base) ease-out forwards;
}

@keyframes tooltipFadeInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes tooltipFadeInLeft {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes tooltipFadeInTop {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tooltipFadeInBottom {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.has-tooltip {
    cursor: help;
}

@media (prefers-reduced-motion: reduce) {
    .tooltip-container {
        animation: none;
        opacity: 1;
    }

    .tooltip-right,
    .tooltip-left,
    .tooltip-top,
    .tooltip-bottom {
        animation: none;
    }
}

@media (max-width: 768px) {
    .tooltip-content {
        max-width: 220px;
        font-size: 13px;
        padding: 10px 12px;
    }

    .tooltip-left .tooltip-arrow {
        right: -6px;
        border-left-width: 6px;
        border-top-width: 6px;
        border-bottom-width: 6px;
    }

    .tooltip-right .tooltip-arrow {
        left: -6px;
        border-right-width: 6px;
        border-top-width: 6px;
        border-bottom-width: 6px;
    }

    .tooltip-top .tooltip-arrow {
        bottom: -6px;
        border-top-width: 6px;
        border-left-width: 6px;
        border-right-width: 6px;
    }

    .tooltip-bottom .tooltip-arrow {
        top: -6px;
        border-bottom-width: 6px;
        border-left-width: 6px;
        border-right-width: 6px;
    }
}

@media (prefers-contrast: high) {
    .tooltip-theme-default .tooltip-content,
    .tooltip-theme-dark .tooltip-content {
        border: 2px solid white;
    }

    .tooltip-theme-light .tooltip-content {
        border: 2px solid black;
    }
}

@media print {
    .tooltip-container {
        display: none !important;
    }
}