/* ==========================================================================
   HYWE ONBOARDING TUTORIAL SYSTEM
   ========================================================================== */

/* Tutorial Banner */
.tutorial-banner {
    width: calc(100% - 24px);
    max-width: 960px;
    padding: 10px 14px;
    margin: 4px auto 8px auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    animation: slideDownFadeIn 0.3s ease;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Top row: dots + step counter */
.tutorial-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tutorial-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: #e2e8f0;
    transition: background 0.25s, transform 0.25s;
    flex-shrink: 0;
    touch-action: manipulation;
}

.tutorial-dot:hover {
    transform: scale(1.3);
    background: #cbd5e1;
}

.tutorial-dot.active {
    background: var(--color-primary, #363636);
    transform: scale(1.35);
}

.tutorial-step-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-step-label {
    font-size: 9px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--color-text-light, #94a3b8);
    font-weight: 600;
}

/* Content */
.tutorial-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tutorial-title {
    margin: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-text-main, #1e293b);
    line-height: 1.3;
}

.tutorial-body {
    margin: 0;
    font-size: 11px;
    color: var(--color-text-muted, #64748b);
    line-height: 1.5;
}

/* Annotation chip */
.tutorial-annotation {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.tutorial-badge-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid;
    flex-shrink: 0;
}

.tutorial-annotation-text {
    font-size: 10.5px;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.1px;
}

/* Auto-play progress bar */
.tutorial-progress-bar {
    height: 2px;
    width: 100%;
    background: #f1f5f9;
    border-radius: 1px;
    overflow: hidden;
    margin-top: 1px;
}

.tutorial-progress-fill {
    height: 100%;
    background: #6366f1;
    width: 0%;
    animation: tutorialAutoProgress 3.5s linear forwards;
}

@keyframes tutorialAutoProgress {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* Navigation row */
.tutorial-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.tutorial-left-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tutorial-nav svg {
    pointer-events: none;
}

/* Tree wrapper — scopes all badge highlights */
.tutorial-tree-wrapper {
    width: 100%;
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    transition: border-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 6px;
}

/* Unified tutorial badge pulse animation */
@keyframes thlPulse {
    0% {
        box-shadow: 0 0 0 0 var(--thl-pulse-color, rgba(99, 102, 241, 0.9)), 0 0 8px 2px var(--thl-pulse-glow, rgba(99, 102, 241, 0.6));
    }

    70% {
        box-shadow: 0 0 0 8px rgba(0, 0, 0, 0), 0 0 8px 2px rgba(0, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0), 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

@keyframes thlPulseUnderline {
    0% {
        border-bottom-color: rgba(6, 182, 212, 1);
        box-shadow: 0 2px 6px 0 rgba(6, 182, 212, 0.4);
    }

    50% {
        border-bottom-color: rgba(6, 182, 212, 0.3);
        box-shadow: 0 1px 2px 0 rgba(6, 182, 212, 0.1);
    }

    100% {
        border-bottom-color: rgba(6, 182, 212, 1);
        box-shadow: 0 2px 6px 0 rgba(6, 182, 212, 0.4);
    }
}

/* Smoothly animate node movements and tree SVG line transitions during tutorial */
.tutorial-tree-wrapper div[style*="position:absolute"] {
    transition: left 0.75s cubic-bezier(0.34, 1.25, 0.64, 1), top 0.75s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.tutorial-tree-wrapper svg line {
    transition: x1 0.75s cubic-bezier(0.34, 1.25, 0.64, 1), y1 0.75s cubic-bezier(0.34, 1.25, 0.64, 1),
        x2 0.75s cubic-bezier(0.34, 1.25, 0.64, 1), y2 0.75s cubic-bezier(0.34, 1.25, 0.64, 1);
}

/* Tutorial Highlight Badges & Controls */
.tutorial-hl-badge-move .badge-move,
.tutorial-hl-badge-add .badge-add,
.tutorial-hl-badge-delete .badge-delete,
.tutorial-hl-badge-elevate .badge-elevate,
.tutorial-hl-badge-nest .badge-nest {
    animation: thlPulse 1.6s ease-out infinite;
    border-radius: 50%;
    outline: 2px solid var(--thl-pulse-glow);
    outline-offset: 2px;
    z-index: 10;
}

.tutorial-hl-badge-delete .prop-btn-delete,
.tutorial-hl-badge-elevate .prop-btn-elevate,
.tutorial-hl-badge-nest .prop-btn-nest {
    animation: thlPulse 1.6s ease-out infinite;
    border-radius: 6px;
    outline: 2px solid var(--thl-pulse-glow);
    outline-offset: 2px;
}

/* level-nav (highlight the level tabs strip & breadcrumbs) */
.tutorial-hl-level-nav .level-controls-container {
    animation: thlPulse 1.6s ease-out infinite;
    --thl-pulse-color: rgba(167, 139, 250, 0.9);
    --thl-pulse-glow: rgba(167, 139, 250, 0.9);
    border-radius: 20px;
    outline: 2.5px solid rgba(167, 139, 250, 0.9);
    outline-offset: 2px;
}

.tutorial-hl-level-nav .level-tab.active {
    animation: thlPulse 1.6s ease-out infinite;
    --thl-pulse-color: rgba(167, 139, 250, 0.9);
    --thl-pulse-glow: rgba(167, 139, 250, 0.6);
    border-radius: 4px;
    background: rgba(167, 139, 250, 0.25) !important;
    color: #8b5cf6 !important;
}

/* hyWEAVE button highlight (Generation Moment cue) */
.tutorial-hl-hyweave-btn,
.tutorial-hl-hyweave #hywe-hyweave,
.hyweave-container.tutorial-hl-hyweave #hywe-hyweave {
    animation: thlHyweavePulse 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) infinite !important;
    outline: 2.5px solid rgba(139, 92, 246, 0.9) !important;
    outline-offset: 3px !important;
    position: relative;
    z-index: 10;
}

@keyframes thlHyweavePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.8), 0 0 16px 4px rgba(139, 92, 246, 0.4);
    }

    50% {
        transform: scale(1.04);
        box-shadow: 0 0 0 10px rgba(139, 92, 246, 0), 0 0 22px 6px rgba(139, 92, 246, 0.25);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0), 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

/* props bar */
.tutorial-hl-props-bar .node-properties-bar,
.tutorial-hl-props-bar .prop-input {
    animation: thlPulse 1.6s ease-out infinite;
    --thl-pulse-color: rgba(251, 191, 36, 0.9);
    --thl-pulse-glow: rgba(251, 191, 36, 0.6);
    outline: 2px solid rgba(251, 191, 36, 0.6);
    outline-offset: 2px;
}

.tutorial-hl-props-bar .node-properties-bar {
    border-radius: 8px;
}

.tutorial-hl-props-bar .prop-input {
    border-radius: 4px;
    background: rgba(251, 191, 36, 0.2) !important;
}

/* edit-name & edit-weight (sleek underline highlight for both inline label and weight inputs) */
.tutorial-hl-edit-name .node-outer.is-selected .nodename,
.tutorial-hl-edit-name .node-outer.is-selected .nodeweight,
.tutorial-hl-edit-weight .node-outer.is-selected .nodename,
.tutorial-hl-edit-weight .node-outer.is-selected .nodeweight {
    border: none !important;
    border-bottom: 2.5px solid #06b6d4 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #0891b2 !important;
    font-weight: 700 !important;
    outline: none !important;
    animation: thlPulseUnderline 1.6s ease-in-out infinite;
}

/* Cascading Card Reveal Animation */
.batch-card-cascade,
.layout-card-item {
    animation: cardReveal 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardReveal {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tutorial-level-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    padding: 3px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 2px;
    overflow-x: auto;
}

/* Target Highlights for Tabs & Slider */
.tutorial-hl-tab,
.hywe-tab-btn.tutorial-hl-tab,
#hywe-sequence-selector.tutorial-hl-slider,
.tutorial-hl-slider #hywe-sequence-selector {
    outline: 2px solid #8b5cf6 !important;
    outline-offset: -1px !important;
    box-shadow: inset 0 0 8px rgba(139, 92, 246, 0.5), 0 0 8px rgba(139, 92, 246, 0.5) !important;
    animation: glowPulse 1.25s infinite ease-in-out !important;
    box-sizing: border-box !important;
}

.tutorial-hl-tab {
    color: #8b5cf6 !important;
    font-weight: 700 !important;
}

#hywe-sequence-selector.tutorial-hl-slider,
.tutorial-hl-slider #hywe-sequence-selector {
    outline-offset: 4px !important;
    border-radius: 8px !important;
    box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.4), 0 0 16px rgba(139, 92, 246, 0.6) !important;
}

@keyframes glowPulse {
    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.22);
    }
}
