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

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    white-space: normal;
    width: 320px;
    max-width: calc(100vw - 32px);
    font-size: 14px;
    line-height: 1.5;
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: white;
    display: block;
}

.tooltip-content {
    color: #e2e8f0;
    display: block;
}

/* Hover/Focus logic */
.tooltip-container:hover .tooltip,
.tooltip-trigger:focus ~ .tooltip,
.tooltip-container.is-active .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Mobile specific positioning (anchors to a relative parent, usually the list item) */
@media (max-width: 640px) {
    /* The JS module will look for data-tooltip-mobile-root to set relative positioning */
    .tooltip-mobile-root {
        position: relative !important;
    }

    .tooltip-container {
        position: static !important;
    }

    .tooltip {
        width: auto !important;
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
        max-width: none !important;
    }

    .tooltip::after {
        display: none;
    }
}

