/* ══════════════════════════════════════════════════════════
   ONBOARDING TOUR — shared floating card design
   Used by FactorySurvey.razor & Survey.razor
   ══════════════════════════════════════════════════════════ */

/* ── Button wrapper ───────────────────────────────────── */
.sv-btn-wrap {
    position: relative;
    display: inline-flex;
}

/* ── Metrics wrapper (for tour glow target) ───────────── */
.sv-metrics-wrap {
    display: flex;
    align-items: center;
    border-radius: 10px;
}

/* ── Subtle overlay ───────────────────────────────────── */
.sv-tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .6);
    backdrop-filter: blur(4px);
    z-index: 900;
    animation: sv-tour-fade-in .3s ease both;
}

@keyframes sv-tour-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Glow ring on target element ──────────────────────── */
.sv-tour-glow {
    position: relative;
    z-index: 910;
    border-radius: 10px;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 1), 0 0 0 6px rgba(239, 68, 68, .25), 0 0 28px rgba(239, 68, 68, .5);
    animation: sv-glow-pulse 1.6s ease-in-out infinite;
}

/* Lift parent containers above the overlay so glowing children are visible */
.sv-tour-lift {
    z-index: 910 !important;
    position: relative;
    background: #fff; /* Ensure it stays opaque when lifted */
}

@keyframes sv-glow-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 1), 0 0 0 6px rgba(239, 68, 68, .25), 0 0 28px rgba(239, 68, 68, .5); }
    50%      { box-shadow: 0 0 0 4px rgba(239, 68, 68, 1), 0 0 0 10px rgba(239, 68, 68, .15), 0 0 40px rgba(239, 68, 68, .35); }
}

/* ── Floating tour card ───────────────────────────────── */
.sv-tour-card {
    position: fixed;
    z-index: 950;
    transition: top .55s cubic-bezier(.34,1.56,.64,1),
                left .55s cubic-bezier(.34,1.56,.64,1),
                right .55s cubic-bezier(.34,1.56,.64,1),
                bottom .55s cubic-bezier(.34,1.56,.64,1);
}

/* Step positions: use % + clamp so they work on all screen sizes */
/* Step 1: Top-left — near PO header area */
.sv-tour-step-1 { top: clamp(90px, 12vh, 160px); left: clamp(1rem, 3vw, 3rem); right: auto; bottom: auto; transform: none; }
/* Step 2: Middle-left — near fiber table */
.sv-tour-step-2 { top: clamp(160px, 32vh, 320px); left: clamp(160px, 15vw, 220px); right: auto; bottom: auto; transform: none; }
/* Step 3: Bottom-center — near packaging section */
.sv-tour-step-3 { top: auto; bottom: clamp(80px, 12vh, 140px); left: 50%; right: auto; transform: translateX(-50%); }
/* Step 4: Top-right area — near Save button */
.sv-tour-step-4 { top: clamp(90px, 12vh, 160px); right: clamp(12rem, 20vw, 22rem); left: auto; bottom: auto; transform: none; }
/* Step 5: Top-right — near Submit button */
.sv-tour-step-5 { top: clamp(90px, 12vh, 160px); right: clamp(1rem, 2vw, 2rem); left: auto; bottom: auto; transform: none; }
/* Step 6: Top-right-center — near Metrics */
.sv-tour-step-6 { top: clamp(90px, 12vh, 160px); right: clamp(18rem, 30vw, 28rem); left: auto; bottom: auto; transform: none; }

.sv-tour-card-inner {
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06);
    width: clamp(300px, 90vw, 440px);
}

/* ── Progress dots ────────────────────────────────────── */
.sv-tour-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: .6rem;
}

.sv-tour-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #e2e8f0;
    cursor: pointer;
    transition: all .25s ease;
}

.sv-tour-dot.active {
    width: 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.sv-tour-dot.done {
    background: #a5b4fc;
}

.sv-tour-dot:hover:not(.active) {
    background: #94a3b8;
    transform: scale(1.2);
}

/* ── Step number ──────────────────────────────────────── */
.sv-tour-step-num {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: .6rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: .04em;
}

/* ── Step content ─────────────────────────────────────── */
.sv-tour-content {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .75rem;
    animation: sv-tour-content-in .3s ease both;
}

@keyframes sv-tour-content-in {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Icon circle ──────────────────────────────────────── */
.sv-tour-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.sv-tour-c1 { background: #fef3c7; color: #d97706; }
.sv-tour-c2 { background: #ccfbf1; color: #0d9488; }
.sv-tour-c3 { background: #dbeafe; color: #2563eb; }
.sv-tour-c4 { background: #f3e8ff; color: #7c3aed; }
.sv-tour-c5 { background: #dcfce7; color: #16a34a; }
.sv-tour-c6 { background: #fce7f3; color: #db2777; }

/* ── Text ─────────────────────────────────────────────── */
.sv-tour-text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.sv-tour-text strong {
    font-size: .82rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.sv-tour-text span {
    font-size: .72rem;
    color: #64748b;
    line-height: 1.4;
}

/* ── Navigation bar ───────────────────────────────────── */
.sv-tour-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: .6rem;
}

.sv-tour-nav-right {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.sv-tour-btn-skip {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: .68rem;
    font-weight: 600;
    cursor: pointer;
    padding: .3rem .5rem;
    border-radius: 8px;
    transition: all .15s;
}
.sv-tour-btn-skip:hover { color: #475569; background: #f1f5f9; }

.sv-tour-btn-prev {
    background: #f1f5f9;
    border: none;
    color: #475569;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    padding: .3rem .5rem;
    border-radius: 8px;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
}
.sv-tour-btn-prev:hover { background: #e2e8f0; }

.sv-tour-btn-next {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border: none;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    padding: .35rem .7rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: all .15s;
    box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.sv-tour-btn-next:hover { background: linear-gradient(135deg, #4f46e5, #6366f1); transform: translateY(-1px); }

.sv-tour-btn-done {
    background: linear-gradient(135deg, #10b981, #34d399);
    border: none;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    padding: .35rem .7rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    transition: all .15s;
    box-shadow: 0 2px 8px rgba(16,185,129,.3);
}
.sv-tour-btn-done:hover { background: linear-gradient(135deg, #059669, #10b981); transform: translateY(-1px); }

/* ── Mobile responsive ────────────────────────────────── */
@media (max-width: 480px) {
    .sv-tour-card-inner { min-width: 0; max-width: calc(100vw - 32px); padding: .75rem 1rem; }
    .sv-tour-icon-circle { width: 34px; height: 34px; font-size: .9rem; }
    .sv-tour-text strong { font-size: .75rem; }
    .sv-tour-text span { font-size: .65rem; }
}
