/* Tooltip Component Styles */

/* Help Icon */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    color: #6c757d;
    cursor: help;
    vertical-align: middle;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.help-icon:hover {
    color: #007bff;
}

.help-icon:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 50%;
}

.help-icon svg {
    width: 100%;
    height: 100%;
}

/* Tooltip Container */
.tooltip {
    position: absolute;
    z-index: 10000;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.tooltip.tooltip-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip Arrow */
.tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.tooltip-top::before {
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.tooltip-bottom::before {
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent rgba(0, 0, 0, 0.9) transparent;
}

.tooltip-left::before {
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-color: transparent transparent transparent rgba(0, 0, 0, 0.9);
}

.tooltip-right::before {
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-color: transparent rgba(0, 0, 0, 0.9) transparent transparent;
}

/* Tooltip with HTML content */
.tooltip.tooltip-rich {
    padding: 12px 16px;
}

.tooltip.tooltip-rich p {
    margin: 0 0 8px 0;
}

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

.tooltip.tooltip-rich strong {
    font-weight: 600;
    color: #ffffff;
}

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

.tooltip.tooltip-rich li {
    margin: 4px 0;
}

/* Help Icon in Labels */
label .help-icon,
.form-group label .help-icon {
    margin-left: 4px;
    vertical-align: text-bottom;
}

/* Help Icon in Headers */
h2 .help-icon,
h3 .help-icon,
h4 .help-icon {
    margin-left: 8px;
}

/* Help Text (alternative to tooltips) */
.help-text {
    font-size: 0.875em;
    color: #6c757d;
    margin-top: 4px;
    line-height: 1.4;
}

.help-text.with-icon {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.help-text.with-icon .help-icon {
    margin: 0;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Inline Help Section */
.inline-help {
    background: #f8f9fa;
    border-left: 3px solid #007bff;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 4px;
    font-size: 0.9em;
    line-height: 1.5;
}

.inline-help strong {
    color: #495057;
    display: block;
    margin-bottom: 4px;
}

.inline-help p {
    margin: 0;
    color: #6c757d;
}

.inline-help ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
    color: #6c757d;
}

.inline-help li {
    margin: 4px 0;
}

/* Example Help Box */
.example-help {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 16px 0;
}

.example-help-title {
    font-weight: 600;
    color: #0056b3;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.example-help-content {
    color: #004085;
    font-size: 0.9em;
    line-height: 1.5;
}

.example-help-content code {
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tooltip {
        max-width: 250px;
        font-size: 12px;
        padding: 8px 12px;
    }

    .help-icon {
        width: 16px;
        height: 16px;
        margin-left: 4px;
    }
}

