/* Basic tooltip icon styling */
.tooltip_box {
    display: inline-block;
    margin-left: 5px;
    cursor: help !important;
}

.tooltip_box .fa-question-circle {
    color: #6c757d;
    font-size: 16px;
    transition: color 0.2s ease;
    cursor: help !important;
}

.tooltip_box:hover .fa-question-circle {
    color: #495057;
}

/* Bootstrap tooltip container */
.tooltip {
    position: absolute;
    z-index: 10000 !important;
    display: block;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    text-decoration: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-break: normal;
    word-spacing: normal;
    white-space: normal;
    line-break: auto;
    font-size: 0.875rem;
    max-width: 300px !important;
    word-wrap: break-word;
    opacity: 0;
    pointer-events: none;
}

/* Increase specificity to override Bootstrap's tooltip max-width without !important */
.tooltip_box .tooltip {
    max-width: 300px;
}

.tooltip.show {
    opacity: 0.98 !important;
}

/* Tooltip inner content */
.tooltip-inner {
    max-width: 300px !important;
    padding: 12px 15px;
    color: #fff;
    text-align: left;
    background-color: #2c3e50;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.tooltip-content {
    color: #fff;
}

.tooltip-content p {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.4;
}

.tooltip-content p:last-child {
    margin-bottom: 0;
}

.tooltip-content ul {
    margin: 0 0 8px;
    padding-left: 20px;
}

.tooltip-content ul:last-child {
    margin-bottom: 0;
}

.tooltip-content li {
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.tooltip-content li:last-child {
    margin-bottom: 0;
}

.tooltip-content a {
    color: #9bd5ff;
    text-decoration: none;
}

.tooltip-content a:hover {
    text-decoration: underline;
    color: #fff;
}

/* Arrow styling */
.tooltip .arrow {
    position: absolute;
    display: block !important;
    width: 0.8rem;
    height: 0.4rem;
    display: block !important;
    width: 0.8rem;
}

.tooltip .arrow::before {
    position: absolute;
    content: "";
    border-color: transparent;
    border-style: solid;
}

/* Top placement */
.bs-tooltip-top .arrow, 
.bs-tooltip-auto[x-placement^="top"] .arrow {
    bottom: 0;
}

.bs-tooltip-top .arrow::before, 
.bs-tooltip-auto[x-placement^="top"] .arrow::before {
    top: 0;
    border-width: 0.4rem 0.4rem 0;
    border-top-color: #2c3e50;
}

/* Right placement */
.bs-tooltip-right .arrow,
.bs-tooltip-auto[x-placement^="right"] .arrow {
    left: 0;
    width: 0.4rem;
    height: 0.8rem;
}

.bs-tooltip-right .arrow::before,
.bs-tooltip-auto[x-placement^="right"] .arrow::before {
    right: 0;
    border-width: 0.4rem 0.4rem 0.4rem 0;
    border-right-color: #2c3e50;
}

/* Bottom placement */
.bs-tooltip-bottom .arrow, 
.bs-tooltip-auto[x-placement^="bottom"] .arrow {
    top: 0;
}

.bs-tooltip-bottom .arrow::before, 
.bs-tooltip-auto[x-placement^="bottom"] .arrow::before {
    bottom: 0;
    border-width: 0 0.4rem 0.4rem;
    border-bottom-color: #2c3e50;
}

/* Left placement */
.bs-tooltip-left .arrow, 
.bs-tooltip-auto[x-placement^="left"] .arrow {
    right: 0;
    width: 0.4rem;
    height: 0.8rem;
}

.bs-tooltip-left .arrow::before, 
.bs-tooltip-auto[x-placement^="left"] .arrow::before {
    left: 0;
    border-width: 0.4rem 0 0.4rem 0.4rem;
    border-left-color: #2c3e50;
}

/* Fix for tooltip visibility issues */
.tooltip.fade.show {
    opacity: 0.98 !important;
}

/* Make sure tooltip text doesn't show as plain text on the page */
[title] {
    position: relative;
}

/* Fix alignment in form labels */
.control-label .tooltip_box {
    vertical-align: middle;
}

/* Fix for cursor consistency - ensure all tooltips show the help cursor */
.tooltip_box, 
.tooltip_box i,
.tooltip_box .fa-question-circle,
[data-toggle="tooltip"],
[data-toggle="tooltip"] i,
[data-toggle="tooltip"] .fa-question-circle {
    cursor: help !important;
}

/* Fix tooltip placement issues */
.tooltip[x-placement^="top"] {
    margin-bottom: 0.4rem;
}

.tooltip[x-placement^="right"] {
    margin-left: 0.4rem;
}

.tooltip[x-placement^="bottom"] {
    margin-top: 0.4rem;
}

.tooltip[x-placement^="left"] {
    margin-right: 0.4rem;
}

/* Ensure tooltip animations work properly */
.tooltip.fade {
    transition: opacity 0.15s linear;
}

/* Fix for tooltip placement */
.tooltip[x-placement^="top"] {
    margin-bottom: 0.4rem;
}

.tooltip[x-placement^="right"] {
    margin-left: 0.4rem;
}

.tooltip[x-placement^="bottom"] {
    margin-top: 0.4rem;
}

.tooltip[x-placement^="left"] {
    margin-right: 0.4rem;
}
/* Fix for tooltip visibility issues */
.tooltip.fade.show {
    opacity: 0.98 !important;

/* Make sure tooltip text doesn't show as plain text on the page */
[title] {
    position: relative;
}

/* Fix alignment in form labels */
.control-label .tooltip_box {
    vertical-align: middle;
