/* ─── Onboarding Tour Styles ─────────────────────────────────────────── */
/* Uses design system tokens from tokens.css — auto-adapts via [data-mode] */

/* Overlay — covers entire viewport during guided tour + welcome */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(9, 17, 59, 0.6);
}

/* Welcome Modal */
.tour-welcome-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: #fff;
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,0.15));
    padding: 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
}

.tour-welcome-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9E33, #ED6586);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.tour-welcome-avatar svg {
    width: 24px;
    height: 24px;
}

.tour-welcome-title {
    font-family: var(--font-display, 'Clash Grotesk', sans-serif);
    font-weight: 600;
    font-size: 20px;
    line-height: 1.3;
    color: var(--grey-900, #09113B);
    margin-bottom: 8px;
}

.tour-welcome-description {
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 14px;
    line-height: 1.5;
    color: var(--n-500, #71717a);
    margin-bottom: 20px;
}

.tour-welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent-50, #E6E0FD);
    color: var(--accent-600, #5B30F1);
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 24px;
}

.tour-welcome-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.tour-btn-primary {
    padding: 10px 24px;
    border-radius: var(--radius-md, 8px);
    border: none;
    cursor: pointer;
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--grey-900, #09113B);
    transition: opacity 0.2s;
}

.tour-btn-primary:hover {
    opacity: 0.9;
}

.tour-btn-secondary {
    padding: 10px 24px;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--n-200, #e4e4e7);
    cursor: pointer;
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 14px;
    font-weight: 600;
    color: var(--n-500, #71717a);
    background: transparent;
    transition: background 0.2s;
}

.tour-btn-secondary:hover {
    background: var(--n-100, #f4f4f5);
}

/* Elevated nav items during tour — white/bold text for readability against dark overlay.
   Only applies to nav items (tour-elevated--nav), NOT dashboard widgets which keep their normal styling. */
.tour-elevated--nav,
.tour-elevated--nav *,
.tour-elevated--nav .sidebar-nav-label,
.tour-elevated--nav .sidebar-nav-item,
.tour-elevated--nav.sidebar-nav-item {
    color: #fff !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}
.tour-elevated--nav .sidebar-nav-icon,
.tour-elevated--nav i,
.tour-elevated--nav .sidebar-nav-icon-img {
    color: #fff !important;
    opacity: 1 !important;
}
.tour-elevated--nav img {
    filter: brightness(2);
    opacity: 1 !important;
}

/* When an element inside a sidebar is elevated, lift the sidebar above the overlay
   and remove overflow:hidden so the elevated child can render above the dark scrim */
.unified-sidebar:has(.tour-elevated) {
    overflow: visible !important;
    z-index: 10000 !important;
}

/* ─── Highlight Ring ─────────────────────────────────────────────────── */
.tour-highlight-ring {
    position: fixed;
    z-index: 10000;
    border: 2px solid var(--accent, #9C82F8);
    border-radius: var(--radius-md, 8px);
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--accent, #9C82F8) 15%, transparent),
        0 0 20px color-mix(in srgb, var(--accent, #9C82F8) 20%, transparent),
        0 0 60px color-mix(in srgb, var(--accent, #9C82F8) 8%, transparent);
    pointer-events: none;
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* ─── Tooltip Card ───────────────────────────────────────────────────── */
.tour-tooltip-card {
    position: fixed;
    z-index: 10001;
    background: #fff;
    border-radius: var(--radius-lg, 12px);
    box-shadow:
        var(--shadow-lg, 0 8px 30px rgba(0,0,0,0.15)),
        0 0 20px color-mix(in srgb, var(--accent, #9C82F8) 20%, transparent);
    width: 320px;
    overflow: hidden;
    transition: top 0.3s ease, left 0.3s ease;
}

.tour-tooltip-accent-border {
    height: 3px;
    background: linear-gradient(90deg, var(--accent, #9C82F8), var(--accent-50, #E6E0FD));
}

.tour-tooltip-content {
    padding: 16px;
}

.tour-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tour-tooltip-step-label {
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent, #9C82F8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tour-tooltip-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent-50, #E6E0FD);
    color: var(--accent-600, #5B30F1);
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 10px;
    font-weight: 600;
}

.tour-tooltip-location-badge i {
    font-size: 11px;
}

.tour-tooltip-skip-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--n-400, #a1a1aa);
    font-size: 16px;
    padding: 2px;
    line-height: 1;
    transition: color 0.2s;
}

.tour-tooltip-skip-btn:hover {
    color: var(--n-600, #52525b);
}

.tour-tooltip-title {
    font-family: var(--font-display, 'Clash Grotesk', sans-serif);
    font-weight: 600;
    font-size: 15px;
    color: var(--grey-900, #09113B);
    margin-bottom: 6px;
    line-height: 1.35;
}

.tour-tooltip-description {
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 12px;
    line-height: 1.55;
    color: var(--n-500, #71717a);
    margin-bottom: 12px;
}

/* AI Copilot Hint */
.tour-tooltip-ai-hint {
    background: var(--grey-900, #09113B);
    border-radius: var(--radius-sm, 6px);
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
}

.tour-tooltip-ai-avatar {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9E33, #ED6586);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tour-tooltip-ai-avatar svg {
    width: 12px;
    height: 12px;
}

.tour-tooltip-ai-text {
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 11px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

/* Footer */
.tour-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Progress Dots */
.tour-tooltip-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.tour-tooltip-dot {
    height: 5px;
    border-radius: 999px;
    background: var(--n-200, #e4e4e7);
    transition: width 0.25s ease, background 0.25s ease;
    width: 5px;
}

.tour-tooltip-dot--active {
    width: 18px;
    background: var(--accent, #9C82F8);
}

.tour-tooltip-dot--completed {
    background: var(--accent, #9C82F8);
}

/* Footer Buttons */
.tour-tooltip-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tour-tooltip-back-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--n-200, #e4e4e7);
    background: transparent;
    cursor: pointer;
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 12px;
    font-weight: 600;
    color: var(--n-500, #71717a);
    transition: background 0.2s;
}

.tour-tooltip-back-btn:hover {
    background: var(--n-100, #f4f4f5);
}

.tour-tooltip-next-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm, 6px);
    border: none;
    cursor: pointer;
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--grey-900, #09113B);
    transition: opacity 0.2s;
}

.tour-tooltip-next-btn:hover {
    opacity: 0.9;
}

.tour-tooltip-next-btn--accent {
    background: var(--accent, #9C82F8);
    box-shadow: 0 0 20px color-mix(in srgb, var(--accent, #9C82F8) 20%, transparent);
}

/* Arrow */
.tour-tooltip-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0,0,0,0.04);
}

.tour-tooltip-arrow--left {
    left: -6px;
    top: 24px;
}

.tour-tooltip-arrow--right {
    right: -6px;
    top: 24px;
}

.tour-tooltip-arrow--top {
    top: -6px;
    left: 24px;
    box-shadow: -2px -2px 4px rgba(0,0,0,0.04);
}

.tour-tooltip-arrow--bottom {
    bottom: -6px;
    left: 24px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.04);
}

/* ─── Pulse Dot (Hotspots) ───────────────────────────────────────────── */
.tour-pulse-dot {
    position: fixed;
    z-index: 9998;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.tour-pulse-dot__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--accent, #9C82F8);
    animation: tour-pulse 2s ease-in-out infinite;
}

.tour-pulse-dot__center {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--accent, #9C82F8);
    z-index: 1;
}

.tour-pulse-dot--discovered .tour-pulse-dot__ring {
    animation: none;
    background: var(--accent-50, #E6E0FD);
    inset: 0;
}

.tour-pulse-dot--discovered .tour-pulse-dot__center {
    background: var(--accent-50, #E6E0FD);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent, #9C82F8);
    font-size: 10px;
}

@keyframes tour-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* ─── Progress Bar (Hotspot Phase) ───────────────────────────────────── */
.tour-progress-bar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width-expanded, 240px);
    right: 0;
    z-index: 9997;
    height: 36px;
    background: #fff;
    border-bottom: 1px solid var(--n-200, #e4e4e7);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.06));
}

.tour-progress-bar__avatar {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9E33, #ED6586);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tour-progress-bar__avatar svg {
    width: 12px;
    height: 12px;
}

.tour-progress-bar__text {
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 12px;
    color: var(--n-500, #71717a);
    white-space: nowrap;
}

.tour-progress-bar__track {
    flex: 1;
    height: 4px;
    background: var(--n-100, #f4f4f5);
    border-radius: 999px;
    overflow: hidden;
}

.tour-progress-bar__fill {
    height: 100%;
    background: var(--accent, #9C82F8);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.tour-progress-bar__count {
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent, #9C82F8);
    white-space: nowrap;
}

.tour-progress-bar__dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--n-400, #a1a1aa);
    font-size: 14px;
    padding: 2px 4px;
    transition: color 0.2s;
}

.tour-progress-bar__dismiss:hover {
    color: var(--n-600, #52525b);
}

/* ─── Completion Message ─────────────────────────────────────────────── */
.tour-completion {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    background: var(--grey-900, #09113B);
    color: #fff;
    border-radius: var(--radius-lg, 12px);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg, 0 8px 30px rgba(0,0,0,0.15));
}

.tour-completion__text {
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.tour-completion__btn {
    padding: 6px 16px;
    border-radius: var(--radius-sm, 6px);
    border: none;
    cursor: pointer;
    font-family: var(--font-body, 'Manrope', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--accent, #9C82F8);
    white-space: nowrap;
    transition: opacity 0.2s;
}

.tour-completion__btn:hover {
    opacity: 0.9;
}

/* ─── Responsive: collapse sidebar offset ────────────────────────────── */
.unified-sidebar.collapsed ~ .tour-progress-bar,
.sidebar.collapsed ~ .tour-progress-bar {
    left: var(--sidebar-width-collapsed, 64px);
}
