/* ================================================================
   Pollux — Onboarding Tour
   Spotlight-guided step-by-step tour with glassmorphism design.
   ================================================================ */

/*
 * Overlay: two layers — blur layer (no background) + dark layer with cutout.
 * The blur covers everything. The spotlight's box-shadow provides darkness
 * everywhere EXCEPT the target element.
 * The target element appears blurred like everything else — to fix this,
 * we raise the target element's z-index above the overlay temporarily.
 */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 300ms ease;
}
.onboarding-overlay.active {
    opacity: 1;
}

/* Spotlight: dark surround with clear cutout. The target element is raised above. */
.onboarding-spotlight {
    position: fixed;
    z-index: 20003;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    transition: all 350ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    background: transparent;
}

/* The highlighted element itself is raised above the blur overlay */
.onboarding-highlighted {
    position: relative !important;
    z-index: 20002 !important;
}
/* Pulse ring around spotlight */
.onboarding-spotlight::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 16px;
    border: 2px solid var(--accent, #6366f1);
    opacity: 0.5;
    animation: onboardingPulse 2s ease-in-out infinite;
}

/* Tooltip card */
.onboarding-tooltip {
    position: fixed;
    z-index: 20004;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: var(--surface, #1e1e2e);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 24px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 250ms ease, transform 250ms ease;
}
.onboarding-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

/* Arrow pointing to spotlight */
.onboarding-tooltip-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--surface, #1e1e2e);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    transform: rotate(45deg);
}
.onboarding-tooltip-arrow.top {
    top: -7px;
    left: 28px;
    border-right: none;
    border-bottom: none;
}
.onboarding-tooltip-arrow.bottom {
    bottom: -7px;
    left: 28px;
    border-left: none;
    border-top: none;
}

/* Step indicator (number) */
.onboarding-step-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent, #6366f1);
    color: #fff;
    font: 700 11px/1 var(--sans, sans-serif);
    flex-shrink: 0;
}

/* Header */
.onboarding-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.onboarding-title {
    font: 600 16px/1.3 var(--sans, sans-serif);
    color: var(--text, #fff);
    margin: 0;
    flex: 1;
}

/* Body */
.onboarding-body {
    font: 400 13px/1.6 var(--sans, sans-serif);
    color: var(--text-muted, #aaa);
    margin-bottom: 18px;
}

/* Footer: dots + buttons */
.onboarding-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.onboarding-dots {
    display: flex;
    gap: 6px;
}
.onboarding-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border, rgba(255,255,255,0.15));
    transition: all 200ms;
}
.onboarding-dot.active {
    background: var(--accent, #6366f1);
    width: 20px;
    border-radius: 4px;
}
.onboarding-dot.done {
    background: var(--accent, #6366f1);
    opacity: 0.4;
}

/* Buttons */
.onboarding-actions {
    display: flex;
    gap: 8px;
}
.onboarding-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font: 500 12px/1 var(--sans, sans-serif);
    cursor: pointer;
    transition: all 150ms;
}
.onboarding-btn-skip {
    background: transparent;
    color: var(--text-muted, #888);
}
.onboarding-btn-skip:hover {
    color: var(--text, #fff);
}
.onboarding-btn-next {
    background: var(--accent, #6366f1);
    color: #fff;
}
.onboarding-btn-next:hover {
    filter: brightness(1.1);
}
.onboarding-btn-next:active {
    transform: scale(0.97);
}

/* Welcome modal (first step with no target) */
.onboarding-welcome {
    position: fixed;
    z-index: 20004;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 440px;
    max-width: calc(100vw - 32px);
    background: var(--surface, #1e1e2e);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    padding: 32px;
    text-align: center;
    opacity: 0;
    transition: all 300ms cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
.onboarding-welcome.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.onboarding-welcome-icon {
    margin-bottom: 16px;
}
.onboarding-welcome-title {
    font: 700 22px/1.3 var(--sans, sans-serif);
    color: var(--text, #fff);
    margin: 0 0 8px;
}
.onboarding-welcome-desc {
    font: 400 14px/1.6 var(--sans, sans-serif);
    color: var(--text-muted, #aaa);
    margin: 0 0 24px;
}
.onboarding-welcome-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Re-launch button — inline in header flow, never absolute */
.onboarding-relaunch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted, #888);
    cursor: pointer;
    transition: all 150ms;
    flex-shrink: 0;
    margin-left: 4px;
    vertical-align: middle;
}
.onboarding-relaunch:hover {
    color: var(--accent, #6366f1);
    border-color: var(--border, rgba(255,255,255,0.08));
    background: var(--accent-glow, rgba(99,102,241,0.06));
}

@keyframes onboardingPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.15; transform: scale(1.04); }
}

@media (max-width: 767px) {
    .onboarding-tooltip {
        width: calc(100vw - 24px);
        max-width: 100%;
        bottom: 12px !important;
        top: auto !important;
        left: 12px !important;
        right: 12px !important;
        position: fixed;
    }
    .onboarding-tooltip-arrow { display: none; }
    .onboarding-welcome {
        width: calc(100vw - 24px);
        padding: 24px;
    }
    .onboarding-welcome-title { font-size: 18px; }
}
