/**
 * OS TigerLab — Onboarding Tour
 *
 * Tour interactivo con backdrop, spotlight sobre el target y tooltip
 * posicionado automáticamente. Sin dependencias externas (no popper).
 *
 * Estructura:
 *   .ostl-tour-overlay     → backdrop full-screen con hueco SVG.
 *   .ostl-tour-spotlight   → outline neón sobre el target.
 *   .ostl-tour-tooltip     → caja de texto + acciones.
 */

.ostl-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-spotlight, 5700);
    pointer-events: auto;
    opacity: 0;
    transition: opacity var(--d-base, 240ms) ease-out;
}
.ostl-tour-overlay[data-active="true"] {
    opacity: 1;
}

/* SVG mask con hueco recortado en el target */
.ostl-tour-overlay__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Spotlight ring (decorativo encima del target) */
.ostl-tour-spotlight {
    position: fixed;
    z-index: calc(var(--z-spotlight, 5700) + 1);
    pointer-events: none;
    border-radius: var(--radius-md, 12px);
    box-shadow:
        0 0 0 4px var(--color-accent, #00FF9C),
        0 0 0 12px color-mix(in oklab, var(--color-accent, #00FF9C) 30%, transparent),
        0 0 40px color-mix(in oklab, var(--color-accent, #00FF9C) 50%, transparent);
    animation: ostl-tour-pulse 2.4s ease-in-out infinite;
    transition:
        top   var(--d-slow, 360ms) var(--ease-out-cubic, cubic-bezier(0.33, 1, 0.68, 1)),
        left  var(--d-slow, 360ms) var(--ease-out-cubic, cubic-bezier(0.33, 1, 0.68, 1)),
        width var(--d-slow, 360ms) var(--ease-out-cubic, cubic-bezier(0.33, 1, 0.68, 1)),
        height var(--d-slow, 360ms) var(--ease-out-cubic, cubic-bezier(0.33, 1, 0.68, 1));
}

@keyframes ostl-tour-pulse {
    0%, 100% { box-shadow:
        0 0 0 4px var(--color-accent, #00FF9C),
        0 0 0 12px color-mix(in oklab, var(--color-accent, #00FF9C) 30%, transparent),
        0 0 40px color-mix(in oklab, var(--color-accent, #00FF9C) 30%, transparent); }
    50%      { box-shadow:
        0 0 0 4px var(--color-accent, #00FF9C),
        0 0 0 16px color-mix(in oklab, var(--color-accent, #00FF9C) 18%, transparent),
        0 0 60px color-mix(in oklab, var(--color-accent, #00FF9C) 60%, transparent); }
}

/* Tooltip */
.ostl-tour-tooltip {
    position: fixed;
    z-index: calc(var(--z-spotlight, 5700) + 2);
    width: min(360px, calc(100% - var(--sp-6, 24px)));
    background: var(--color-bg-elevated, #1E1E1E);
    color: var(--color-text-primary, #F5F5F5);
    border: 1px solid var(--color-border-default, #2A2A2A);
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-3, 0 12px 32px rgba(0,0,0,0.5));
    padding: var(--sp-4, 16px);
    transform: scale(0.94) translateY(8px);
    opacity: 0;
    transition:
        opacity var(--d-base, 240ms) ease-out,
        transform var(--d-base, 240ms) var(--ease-out-cubic, cubic-bezier(0.33, 1, 0.68, 1)),
        top var(--d-slow, 360ms) var(--ease-out-cubic, cubic-bezier(0.33, 1, 0.68, 1)),
        left var(--d-slow, 360ms) var(--ease-out-cubic, cubic-bezier(0.33, 1, 0.68, 1));
}
.ostl-tour-tooltip[data-visible="true"] {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.ostl-tour-tooltip__step {
    color: var(--color-text-secondary, #B3B3B3);
    font-size: var(--fs-xs, 0.8125rem);
    margin: 0 0 var(--sp-1, 4px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}
.ostl-tour-tooltip__title {
    font-family: var(--font-display, 'Poppins', sans-serif);
    font-weight: 700;
    font-size: var(--fs-lg, 1.125rem);
    margin: 0 0 var(--sp-2, 8px);
    line-height: 1.25;
}
.ostl-tour-tooltip__body {
    color: var(--color-text-secondary, #B3B3B3);
    font-size: var(--fs-sm, 0.9375rem);
    line-height: 1.55;
    margin: 0 0 var(--sp-4, 16px);
}

.ostl-tour-tooltip__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2, 8px);
}
.ostl-tour-tooltip__progress {
    display: flex;
    gap: 4px;
}
.ostl-tour-tooltip__dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-border-default, #2A2A2A);
    transition: background var(--d-fast, 160ms);
}
.ostl-tour-tooltip__dot[data-current="true"] {
    background: var(--color-accent, #00FF9C);
    width: 18px;
    border-radius: 999px;
}

.ostl-tour-tooltip__buttons {
    display: flex;
    gap: var(--sp-2);
}

/* Tooltip "arrow" hacia el target */
.ostl-tour-tooltip__arrow {
    position: absolute;
    width: 12px; height: 12px;
    background: var(--color-bg-elevated, #1E1E1E);
    border: 1px solid var(--color-border-default, #2A2A2A);
    transform: rotate(45deg);
}
.ostl-tour-tooltip[data-arrow="top"] .ostl-tour-tooltip__arrow {
    top: -7px; left: 50%; margin-left: -6px;
    border-right: 0; border-bottom: 0;
}
.ostl-tour-tooltip[data-arrow="bottom"] .ostl-tour-tooltip__arrow {
    bottom: -7px; left: 50%; margin-left: -6px;
    border-left: 0; border-top: 0;
}
.ostl-tour-tooltip[data-arrow="left"] .ostl-tour-tooltip__arrow {
    left: -7px; top: 50%; margin-top: -6px;
    border-right: 0; border-top: 0;
}
.ostl-tour-tooltip[data-arrow="right"] .ostl-tour-tooltip__arrow {
    right: -7px; top: 50%; margin-top: -6px;
    border-left: 0; border-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
    .ostl-tour-spotlight,
    .ostl-tour-tooltip,
    .ostl-tour-overlay {
        animation: none !important;
        transition-duration: 1ms !important;
    }
}

[data-theme="light"] .ostl-tour-tooltip {
    background: #FFFFFF; color: #0A0A0A;
}
[data-theme="light"] .ostl-tour-tooltip__arrow {
    background: #FFFFFF;
}
