/* ============ TUTORIAL OVERLAY ============ */

.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.tutorial-overlay.show {
    opacity: 1;
}

/* ---- HEADER ---- */
.tutorial-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: calc(var(--safe-top, 0px) + 8px) 16px 0;
    flex-shrink: 0;
}

.tutorial-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tutorial-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.tutorial-btn-close {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.tutorial-btn-close:active {
    transform: scale(0.96);
}

/* Section tabs */
.tutorial-section-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
}
.tutorial-section-tabs::-webkit-scrollbar { display: none; }

.tutorial-section-tab {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.tutorial-section-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.tutorial-section-tab:active {
    transform: scale(0.96);
}

/* Subsection tabs */
.tutorial-subsection-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 10px;
    margin-top: 2px;
}
.tutorial-subsection-tabs::-webkit-scrollbar { display: none; }

.tutorial-subsection-tab {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.tutorial-subsection-tab.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

/* ---- CONTENT ---- */
.tutorial-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 100px;
    -webkit-overflow-scrolling: touch;
}

.tutorial-step {
    max-width: 560px;
    margin: 0 auto;
    animation: tutorialFadeIn 0.3s ease;
}

@keyframes tutorialFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.tutorial-step-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}
.tutorial-step-icon svg {
    width: 32px;
    height: 32px;
}

.tutorial-step-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin: 0 0 12px;
    line-height: 1.3;
}

.tutorial-step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0 0 20px;
    text-align: center;
}

/* Tip boxes */
.tutorial-tip {
    background: rgba(79, 70, 229, 0.06);
    border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
}
.tutorial-tip-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Example boxes */
.tutorial-example {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin: 14px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
}
.tutorial-example-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tutorial-example-steps {
    padding-left: 4px;
}
.tutorial-example-steps li {
    margin-bottom: 6px;
    padding-left: 4px;
}

/* Feature list in overview */
.tutorial-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}
.tutorial-feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}
.tutorial-feature-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}
.tutorial-feature-card-icon svg {
    width: 20px;
    height: 20px;
}
.tutorial-feature-card-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}

/* ---- FOOTER ---- */
.tutorial-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 12px 20px calc(12px + var(--safe-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.tutorial-progress {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.tutorial-btn-prev,
.tutorial-btn-next {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}
.tutorial-btn-prev {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.tutorial-btn-prev:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.tutorial-btn-next {
    background: var(--primary);
    color: white;
}
.tutorial-btn-next:active,
.tutorial-btn-prev:active {
    transform: scale(0.96);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .tutorial-header {
        padding: calc(var(--safe-top, 0px) + 6px) 12px 0;
    }
    .tutorial-content {
        padding: 20px 16px 100px;
    }
    .tutorial-step-title {
        font-size: 18px;
    }
    .tutorial-features {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .tutorial-footer {
        padding: 10px 16px calc(10px + var(--safe-bottom, 0px));
    }
}
