/* =========================
   Onboarding Checklist Widget
   ========================= */
.onboarding-widget {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1050;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Drawer panel */
.onboarding-panel {
    width: 340px;
    background: #fff;
    border-radius: 14px 0 0 14px;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    animation: onboarding-drawer-in 0.3s ease-out;
}

@keyframes onboarding-drawer-in {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

.onboarding-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 16px 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
}

.onboarding-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.onboarding-counter {
    font-size: 13px;
    opacity: 0.85;
}

.onboarding-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.onboarding-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.onboarding-progress-track {
    height: 4px;
    background: #e2e8f0;
}

.onboarding-progress-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 0 2px 2px 0;
    transition: width 0.4s ease;
    min-width: 0;
}

.onboarding-steps {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    max-height: 320px;
    overflow-y: auto;
}

.onboarding-step {
    border-bottom: 1px solid #f1f5f9;
}

.onboarding-step:last-child {
    border-bottom: none;
}

.onboarding-step-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    text-decoration: none;
    color: #1e293b;
    font-size: 14px;
    transition: background 0.12s;
}

.onboarding-step-link:hover {
    background: #f8fafc;
    color: #1e293b;
    text-decoration: none;
}

.onboarding-check {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.onboarding-step .onboarding-check {
    color: #cbd5e1;
}

.onboarding-step.completed .onboarding-check {
    color: #22c55e;
}

.onboarding-step.completed .onboarding-step-label {
    text-decoration: line-through;
    color: #94a3b8;
}

.onboarding-step-label {
    flex: 1;
}

.onboarding-step-trailing {
    flex-shrink: 0;
    width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-step-arrow {
    font-size: 11px;
    color: #94a3b8;
}

.onboarding-step.completed .onboarding-step-arrow {
    visibility: hidden;
}

.onboarding-step-spinner {
    font-size: 14px;
    color: #3b82f6;
}

/* Collapsed vertical tab pinned to screen edge */
.onboarding-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    writing-mode: vertical-lr;
    padding: 14px 10px;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 10px 0 0 10px;
    box-shadow: -4px 0 16px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: padding 0.15s, box-shadow 0.15s;
    animation: onboarding-tab-in 0.3s ease-out;
}

@keyframes onboarding-tab-in {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

.onboarding-tab:hover {
    padding-right: 14px;
    box-shadow: -6px 0 24px rgba(37, 99, 235, 0.45);
}

.onboarding-tab .fa-list-check {
    font-size: 16px;
    margin-bottom: 2px;
}

.onboarding-tab-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 12px;
}

@media (max-width: 576px) {
    .onboarding-widget {
        top: auto;
        bottom: 80px;
        right: 0;
        left: auto;
        transform: none;
    }

    .onboarding-panel {
        width: calc(100vw - 16px);
        border-radius: 14px 0 0 14px;
    }
}

/* =========================
   Onboarding Spotlight / Pointer
   ========================= */
.onboarding-spotlight-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10000;
    animation: onboarding-fade-in 0.2s ease-out;
}

@keyframes onboarding-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.onboarding-spotlight-target {
    position: relative;
    z-index: 10001;
    background: #fff !important;
    border-radius: 8px;
    pointer-events: none;
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.95),
        0 0 0 8px rgba(59, 130, 246, 0.4),
        0 12px 32px rgba(0, 0, 0, 0.3);
}

.onboarding-spotlight-popover {
    position: fixed;
    z-index: 10002;
    width: min(360px, calc(100vw - 32px));
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 16px;
    color: #0f172a;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    animation: onboarding-fade-in 0.2s ease-out;
}

.onboarding-spotlight-popover::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
    top: -7px;
    left: var(--arrow-left, 24px);
}

.onboarding-spotlight-body {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
    color: #334155;
}

.onboarding-spotlight-actions {
    display: flex;
    justify-content: flex-end;
}

.onboarding-spotlight-dismiss {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.onboarding-spotlight-dismiss:hover {
    opacity: 0.9;
}
