/* AI Theme - Tooltip Styles */
/* Created to fix tooltip visibility in light/dark modes */

/* Force tooltip visibility fix for WHMCS elements */
[title]:not([title=""]) {
    position: relative;
}

/* Custom AI Tooltips */
.ai-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 9999;
    pointer-events: none;
    animation: tooltip-appear 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

/* Light mode tooltip */
[data-theme="light"] .ai-tooltip {
    background: rgba(30, 41, 59, 0.95);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Tooltip arrow */
.ai-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(15, 23, 42, 0.95);
}

[data-theme="light"] .ai-tooltip::after {
    border-top-color: rgba(30, 41, 59, 0.95);
}

/* Bootstrap Tooltip Overrides */
.tooltip {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tooltip-inner {
    background: rgba(15, 23, 42, 0.95) !important;
    color: #e2e8f0 !important;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(10px);
    max-width: 300px;
}

[data-theme="light"] .tooltip-inner {
    background: rgba(30, 41, 59, 0.95) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Bootstrap Tooltip Arrows */
.bs-tooltip-top .arrow::before,
.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: rgba(15, 23, 42, 0.95) !important;
}

[data-theme="light"] .bs-tooltip-top .arrow::before,
[data-theme="light"] .tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: rgba(30, 41, 59, 0.95) !important;
}

.bs-tooltip-bottom .arrow::before,
.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: rgba(15, 23, 42, 0.95) !important;
}

[data-theme="light"] .bs-tooltip-bottom .arrow::before,
[data-theme="light"] .tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: rgba(30, 41, 59, 0.95) !important;
}

.bs-tooltip-left .arrow::before,
.tooltip.bs-tooltip-left .tooltip-arrow::before {
    border-left-color: rgba(15, 23, 42, 0.95) !important;
}

[data-theme="light"] .bs-tooltip-left .arrow::before,
[data-theme="light"] .tooltip.bs-tooltip-left .tooltip-arrow::before {
    border-left-color: rgba(30, 41, 59, 0.95) !important;
}

.bs-tooltip-right .arrow::before,
.tooltip.bs-tooltip-right .tooltip-arrow::before {
    border-right-color: rgba(15, 23, 42, 0.95) !important;
}

[data-theme="light"] .bs-tooltip-right .arrow::before,
[data-theme="light"] .tooltip.bs-tooltip-right .tooltip-arrow::before {
    border-right-color: rgba(30, 41, 59, 0.95) !important;
}

/* Popover Overrides */
.popover {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .popover {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.popover-header {
    background: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2) !important;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 11px 11px 0 0;
}

[data-theme="light"] .popover-header {
    background: rgba(248, 250, 252, 0.95) !important;
    color: #1e293b !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2) !important;
}

.popover-body {
    color: #e2e8f0 !important;
    padding: 16px;
}

[data-theme="light"] .popover-body {
    color: #1e293b !important;
}

/* Popover Arrows */
.bs-popover-top > .arrow::after,
.popover.bs-popover-top > .popover-arrow::after {
    border-top-color: rgba(15, 23, 42, 0.95) !important;
}

[data-theme="light"] .bs-popover-top > .arrow::after,
[data-theme="light"] .popover.bs-popover-top > .popover-arrow::after {
    border-top-color: rgba(255, 255, 255, 0.95) !important;
}

.bs-popover-bottom > .arrow::after,
.popover.bs-popover-bottom > .popover-arrow::after {
    border-bottom-color: rgba(30, 41, 59, 0.8) !important;
}

[data-theme="light"] .bs-popover-bottom > .arrow::after,
[data-theme="light"] .popover.bs-popover-bottom > .popover-arrow::after {
    border-bottom-color: rgba(248, 250, 252, 0.95) !important;
}

.bs-popover-left > .arrow::after,
.popover.bs-popover-left > .popover-arrow::after {
    border-left-color: rgba(15, 23, 42, 0.95) !important;
}

[data-theme="light"] .bs-popover-left > .arrow::after,
[data-theme="light"] .popover.bs-popover-left > .popover-arrow::after {
    border-left-color: rgba(255, 255, 255, 0.95) !important;
}

.bs-popover-right > .arrow::after,
.popover.bs-popover-right > .popover-arrow::after {
    border-right-color: rgba(15, 23, 42, 0.95) !important;
}

[data-theme="light"] .bs-popover-right > .arrow::after,
[data-theme="light"] .popover.bs-popover-right > .popover-arrow::after {
    border-right-color: rgba(255, 255, 255, 0.95) !important;
}

/* Tooltip Animation */
@keyframes tooltip-appear {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure tooltips are visible on hover elements */
[data-tooltip]:hover .ai-tooltip,
[data-bs-toggle="tooltip"]:hover + .tooltip,
[data-toggle="tooltip"]:hover + .tooltip {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix for elements with tooltips in buttons and links */
.btn[data-tooltip],
.btn[data-bs-toggle="tooltip"],
.btn[data-toggle="tooltip"],
a[data-tooltip],
a[data-bs-toggle="tooltip"],
a[data-toggle="tooltip"] {
    position: relative;
}

/* Responsive tooltip positioning */
@media (max-width: 768px) {
    .ai-tooltip,
    .tooltip-inner {
        max-width: 200px;
        font-size: 0.8125rem;
    }
}