/* Tooltip Component Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip {
    position: absolute;
    z-index: 1000;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    animation: tooltip-fade-in 0.2s ease-out forwards;
    max-width: 400px;
    min-width: 300px;
    word-wrap: break-word;
    white-space: normal;
}

/* Tooltip positioning */
.tooltip-top {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
}

.tooltip-top::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.tooltip-bottom {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
}

.tooltip-bottom::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
}

.tooltip-left {
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 8px;
}

.tooltip-left::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.9);
}

.tooltip-right {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
}

.tooltip-right::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: rgba(0, 0, 0, 0.9);
}

/* Animation */
@keyframes tooltip-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Special positioning for bottom tooltip animation */
.tooltip-bottom {
    animation: tooltip-fade-in-bottom 0.2s ease-out forwards;
}

@keyframes tooltip-fade-in-bottom {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Special positioning for left tooltip animation */
.tooltip-left {
    animation: tooltip-fade-in-left 0.2s ease-out forwards;
}

@keyframes tooltip-fade-in-left {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(4px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Special positioning for right tooltip animation */
.tooltip-right {
    animation: tooltip-fade-in-right 0.2s ease-out forwards;
}

@keyframes tooltip-fade-in-right {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tooltip {
        font-size: 12px;
        padding: 6px 10px;
        max-width: 250px;
        min-width: 200px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .tooltip {
        background-color: rgba(255, 255, 255, 0.95);
        color: #333;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }
    
    .tooltip-top::after {
        border-top-color: rgba(255, 255, 255, 0.95);
    }
    
    .tooltip-bottom::after {
        border-bottom-color: rgba(255, 255, 255, 0.95);
    }
    
    .tooltip-left::after {
        border-left-color: rgba(255, 255, 255, 0.95);
    }
    
    .tooltip-right::after {
        border-right-color: rgba(255, 255, 255, 0.95);
    }
}
