/**
 * Bootstrap 5 Tooltip Compatibility Styling
 * Makes Bootstrap 5 tooltips look like Bootstrap 3:
 * - White background
 * - Black text
 * - Fixed 300px width with text wrapping
 * - No rounded corners (square box)
 * - Classic dark arrow/pointer
 */

/* Main tooltip container - white fill */
.tooltip {
    --bs-tooltip-bg: #ffffff;
    --bs-tooltip-color: #000000;
    font-size: 12px;
    max-width: 300px !important;
    width: 300px !important;
    border: 1px solid #cccccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    background-color: #ffffff !important;
}

/* Tooltip inner text - white background, text wrapping enabled */
.tooltip-inner {
    background-color: #ffffff !important;
    color: #000000 !important;
    padding: 6px 8px !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    text-align: left !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    display: block !important;
    height: auto !important;
    min-height: auto !important;
    min-width: auto !important;
    overflow: visible !important;
}

/* Arrow/pointer styling */
.tooltip .tooltip-arrow {
    --bs-tooltip-arrow-bg: #ffffff;
    width: 6px;
    height: 6px;
    margin: 0 !important;
    padding: 0 !important;
}

.tooltip .tooltip-arrow::before {
    background-color: #ffffff;
    border: 1px solid #cccccc;
}

/* Position-specific arrow adjustments */
.tooltip.top .tooltip-arrow::before {
    border-top-color: #cccccc;
    border-right-color: #cccccc;
    border-bottom-color: transparent;
    border-left-color: transparent;
}

.tooltip.end .tooltip-arrow::before {
    border-top-color: #cccccc;
    border-right-color: #cccccc;
    border-bottom-color: transparent;
    border-left-color: transparent;
}

.tooltip.bottom .tooltip-arrow::before {
    border-top-color: transparent;
    border-right-color: #cccccc;
    border-bottom-color: #cccccc;
    border-left-color: transparent;
}

.tooltip.start .tooltip-arrow::before {
    border-top-color: transparent;
    border-right-color: transparent;
    border-bottom-color: #cccccc;
    border-left-color: #cccccc;
}

/* Remove any default spacing that Bootstrap 5 might apply */
.bs-tooltip-top .tooltip-arrow,
.bs-tooltip-end .tooltip-arrow,
.bs-tooltip-bottom .tooltip-arrow,
.bs-tooltip-start .tooltip-arrow {
    margin: 0 !important;
}

/* Target the tooltip wrapper more aggressively */
.bs-tooltip-top,
.bs-tooltip-end,
.bs-tooltip-bottom,
.bs-tooltip-start {
    padding: 0 !important;
    margin: 0 !important;
    background-color: #ffffff !important;
}
