/* ─── Onboarding Tour System ─── */

/* Overlay that dims everything except the spotlight target */
.ob-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    display: none;
}

.ob-overlay.is-active {
    display: block;
    pointer-events: auto;
}

/* SVG mask overlay — creates the spotlight hole */
.ob-overlay-svg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.ob-overlay.is-active .ob-overlay-svg {
    pointer-events: auto;
}

/* The spotlight target gets elevated above the overlay */
.ob-spotlight {
    position: relative;
    z-index: 10001 !important;
    pointer-events: auto !important;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.4), 0 0 24px rgba(99, 102, 241, 0.15);
    transition: box-shadow 0.3s ease;
}

/* Tooltip container */
.ob-tooltip {
    position: fixed;
    z-index: 10002;
    background: var(--surface, #fff);
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 12px;
    padding: 20px;
    width: 340px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-family: 'Inter Tight', sans-serif;
}

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

/* Arrow */
.ob-tooltip::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--surface, #fff);
    border: 1px solid var(--line, #e5e7eb);
    transform: rotate(45deg);
    z-index: -1;
}

.ob-tooltip[data-position="bottom"]::before {
    top: -7px;
    left: 24px;
    border-right: none;
    border-bottom: none;
}

.ob-tooltip[data-position="top"]::before {
    bottom: -7px;
    left: 24px;
    border-left: none;
    border-top: none;
}

.ob-tooltip[data-position="left"]::before {
    right: -7px;
    top: 20px;
    border-left: none;
    border-bottom: none;
}

.ob-tooltip[data-position="right"]::before {
    left: -7px;
    top: 20px;
    border-right: none;
    border-top: none;
}

/* Tooltip content */
.ob-tooltip-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ink, #14160F);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.ob-tooltip-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink, #14160F);
    margin: 0 0 6px;
    line-height: 1.3;
}

.ob-tooltip-desc {
    font-size: 13px;
    color: var(--muted, #6b7280);
    line-height: 1.55;
    margin: 0 0 16px;
}

/* Footer with navigation */
.ob-tooltip-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ob-tooltip-progress {
    font-size: 12px;
    color: var(--muted, #6b7280);
    font-variant-numeric: tabular-nums;
    margin-right: auto;
}

.ob-tooltip-btn {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease, opacity 0.15s ease;
    font-family: inherit;
}

.ob-tooltip-btn.ob-btn-skip {
    background: transparent;
    color: var(--muted, #6b7280);
}

.ob-tooltip-btn.ob-btn-skip:hover {
    background: var(--surface-2, #f3f4f6);
}

.ob-tooltip-btn.ob-btn-prev {
    background: var(--surface-2, #f3f4f6);
    color: var(--ink, #14160F);
}

.ob-tooltip-btn.ob-btn-prev:hover {
    background: var(--line, #e5e7eb);
}

.ob-tooltip-btn.ob-btn-next {
    background: var(--ink, #14160F);
    color: #fff;
}

.ob-tooltip-btn.ob-btn-next:hover {
    opacity: 0.85;
}

/* Progress dots */
.ob-dots {
    display: flex;
    gap: 5px;
    margin-right: auto;
}

.ob-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--line, #e5e7eb);
    transition: background 0.2s ease, transform 0.2s ease;
}

.ob-dot.is-active {
    background: var(--ink, #14160F);
    transform: scale(1.2);
}

.ob-dot.is-done {
    background: var(--ok, #22c55e);
}

/* Welcome modal (shown once on first login) */
.ob-welcome-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10003;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ob-welcome-backdrop.is-visible {
    opacity: 1;
}

.ob-welcome {
    background: var(--surface, #fff);
    border-radius: 16px;
    padding: 32px;
    width: 440px;
    max-width: calc(100vw - 32px);
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.ob-welcome-backdrop.is-visible .ob-welcome {
    transform: scale(1);
}

.ob-welcome-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--ink, #14160F);
    border-radius: 14px;
    display: grid;
    place-items: center;
}

.ob-welcome-icon img {
    width: 36px;
    height: 36px;
}

.ob-welcome h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--ink, #14160F);
}

.ob-welcome p {
    font-size: 14px;
    color: var(--muted, #6b7280);
    line-height: 1.6;
    margin: 0 0 24px;
}

.ob-welcome-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ob-welcome-actions .ob-tooltip-btn {
    padding: 10px 20px;
    font-size: 14px;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .ob-tooltip {
        width: calc(100vw - 24px);
        left: 12px !important;
        right: 12px !important;
    }

    .ob-tooltip::before {
        display: none;
    }

    .ob-welcome {
        padding: 24px 20px;
    }
}
