/* ==========================================================================
   INFO BUTTONS & TOOLTIPS
   ========================================================================== */

.info-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.info-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: help;
    padding: 0;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.info-btn:hover {
    color: var(--text-secondary);
}

.info-tooltip,
.offset-tooltip,
.bottleneck-tooltip,
.setting-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.625rem;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    max-width: 220px;
    white-space: normal;
    z-index: 100;
    box-shadow: var(--shadow-md);
    line-height: 1.4;
}

/* Upscaling & Ray Tracing Info Tooltips (extended width) */
.upscaling-info-tooltip,
.ray-tracing-info-tooltip {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 0.875rem 1rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    max-width: 300px !important;
    color: var(--text-primary) !important;
}

.upscaling-info-tooltip ul,
.ray-tracing-info-tooltip ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1rem;
}

.upscaling-info-tooltip li,
.ray-tracing-info-tooltip li {
    margin-bottom: 0.25rem;
    color: var(--text-primary) !important;
}

.upscaling-info-tooltip p,
.ray-tracing-info-tooltip p {
    margin: 0 0 0.375rem 0;
    color: var(--text-primary) !important;
}

.upscaling-info-tooltip p:last-child,
.ray-tracing-info-tooltip p:last-child {
    margin-bottom: 0;
}

/* Ray Tracing warning styling */
.ray-tracing-info-tooltip .rt-warning {
    color: var(--warning);
}

/* Upscaling Option Tooltips */
.upscaling-option-tooltip {
    position: absolute;
    top: 50%;
    left: calc(100% + 8px);
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    max-width: 180px;
    white-space: normal;
    z-index: 1001;
    box-shadow: var(--shadow-md);
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-out, visibility 0.2s ease-out;
    pointer-events: none;
}

/* Arrow indicator pointing left towards the option */
.upscaling-option-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 6px 4px 0;
    border-color: transparent var(--bg-secondary) transparent transparent;
}

/* Arrow border indicator */
.upscaling-option-tooltip::after {
    content: '';
    position: absolute;
    right: calc(100% + 1px);
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 6px 4px 0;
    border-color: transparent var(--border) transparent transparent;
}

/* Show tooltip on hover/focus */
.upscaling-option:hover .upscaling-option-tooltip,
.upscaling-option:focus-within .upscaling-option-tooltip,
.upscaling-option-tooltip.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent tooltip from going off-screen on the right */
@media (max-width: 640px) {
    .upscaling-option-tooltip {
        left: auto;
        right: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%);
    }

    .upscaling-option-tooltip::before {
        right: auto;
        left: 100%;
        border-width: 4px 0 4px 6px;
        border-color: transparent transparent transparent var(--bg-secondary);
    }

    .upscaling-option-tooltip::after {
        right: auto;
        left: calc(100% + 1px);
        border-width: 4px 0 4px 6px;
        border-color: transparent transparent transparent var(--border);
    }
}

