/**
 * Webtron Docs — AI Explainer
 *
 * Styles for target mode, highlight overlay, and active indicator.
 * Loaded globally on docs pages when the TOC action bar is present.
 *
 * @package WebtronDocs
 * @since   3.0.0
 */

/* Body class when target mode is active */
body.webtron-explainer-active {
    cursor: crosshair;
}

/* Target elements — subtle indicator on hover */
.webtron-explainer-target {
    cursor: pointer !important;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}

.webtron-explainer-target:hover {
    background-color: rgba(59, 130, 246, 0.08) !important;
}

/* Highlight overlay — positioned absolutely over hovered element */
.webtron-explainer-highlight {
    position: absolute;
    pointer-events: none;
    border: 2px solid var(--docs-primary, #3b82f6);
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.05);
    z-index: 99990;
    transition: all 0.1s ease;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.webtron-explainer-highlight-label {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--docs-primary, #3b82f6);
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.webtron-explainer-highlight-label i {
    font-size: 10px;
}

/* Active mode indicator — fixed bar at top of viewport */
.webtron-explainer-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--docs-primary, #3b82f6);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    z-index: 99999;
    animation: webtron-explainer-pulse 2s ease-in-out infinite;
}

.webtron-explainer-indicator i {
    font-size: 14px;
}

.webtron-explainer-hint {
    font-size: 11px;
    opacity: 0.8;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes webtron-explainer-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4); }
    50%      { box-shadow: 0 4px 30px rgba(59, 130, 246, 0.6); }
}

/* Dark mode adjustments */
body.dark-mode .webtron-explainer-target:hover {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

body.dark-mode .webtron-explainer-highlight {
    background: rgba(59, 130, 246, 0.1);
}
