<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>شرح: <?= e($tutorial['title']) ?><?php $__template->endSection(); ?>
<?php $__template->section('styles'); ?>
<style>
.tut-page{max-width:860px;margin:0 auto}.tut-breadcrumb{display:flex;align-items:center;gap:8px;margin-bottom:20px;font-size:13px}.tut-breadcrumb a{color:#6B7280;text-decoration:none}.tut-breadcrumb a:hover{color:<?= e($section['color']) ?>}.tut-breadcrumb span{color:#9CA3AF}.tut-header{display:flex;align-items:center;gap:18px;margin-bottom:30px;padding:24px;background:linear-gradient(135deg,<?= e($section['color']) ?>08,<?= e($section['color']) ?>04);border-radius:16px;border:1px solid <?= e($section['color']) ?>20}.tut-header-icon{width:56px;height:56px;background:<?= e($tutorial['color']) ?>;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.tut-header h1{font-size:22px;font-weight:800;color:#1A1A2E;margin:0 0 4px}.tut-header p{font-size:14px;color:#6B7280;margin:0}.tut-step{position:relative;padding:20px 60px 20px 20px;margin-bottom:16px;background:#fff;border:1px solid #E5E7EB;border-radius:12px;transition:border-color .2s}.tut-step:hover{border-color:<?= e($section['color']) ?>60}.tut-step-num{position:absolute;right:18px;top:20px;width:32px;height:32px;background:<?= e($section['color']) ?>15;color:<?= e($section['color']) ?>;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}.tut-step-title{font-size:15px;font-weight:700;color:#1A1A2E;margin:0 0 6px}.tut-step-body{font-size:13.5px;color:#374151;line-height:1.8}.tut-step-body ul{margin:8px 0;padding-right:18px}.tut-step-body li{margin-bottom:4px}.tut-step-body .field{display:inline-block;background:#F3F4F6;color:#1A1A2E;padding:1px 8px;border-radius:4px;font-size:12px;font-weight:600;font-family:monospace;direction:ltr}.tut-step-body .warn{display:block;background:#FEF3C7;border:1px solid #F59E0B30;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#92400E}.tut-step-body .info{display:block;background:#DBEAFE;border:1px solid #3B82F630;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#1E40AF}.tut-step-body .success{display:block;background:#ECFDF5;border:1px solid #05966930;border-radius:8px;padding:10px 14px;margin:8px 0;font-size:12.5px;color:#065F46}.tut-nav{display:flex;justify-content:space-between;align-items:center;margin-top:32px;padding-top:20px;border-top:1px solid #E5E7EB}.tut-nav a{display:inline-flex;align-items:center;gap:6px;padding:10px 16px;background:#F9FAFB;border:1px solid #E5E7EB;border-radius:10px;text-decoration:none;color:#374151;font-size:13px;font-weight:600;transition:all .15s}.tut-nav a:hover{background:<?= e($section['color']) ?>08;border-color:<?= e($section['color']) ?>;color:<?= e($section['color']) ?>}
</style>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="tut-page">
    <div class="tut-breadcrumb">
        <a href="/tutorials"><i data-lucide="graduation-cap" style="width:14px;height:14px;"></i></a>
        <span>/</span>
        <a href="/tutorials/<?= e($sectionKey) ?>"><?= e($section['title']) ?></a>
        <span>/</span>
        <span style="color:#1A1A2E;font-weight:600;"><?= e($tutorial['title']) ?></span>
    </div>
    <div class="tut-header">
        <div class="tut-header-icon"><i data-lucide="<?= e($tutorial['icon']) ?>" style="width:28px;height:28px;color:#fff;"></i></div>
        <div><h1><?= e($tutorial['title']) ?></h1><p><?= e($tutorial['subtitle']) ?></p></div>
    </div>

    <?php $num = 1; foreach ($steps as $step): ?>
    <div class="tut-step">
        <div class="tut-step-num"><?= $num ?></div>
        <h3 class="tut-step-title"><?= e($step['title']) ?></h3>
        <div class="tut-step-body"><?= $step['body'] ?></div>
        <?php if (!empty($step['screenshot'])): ?>
        <div style="margin-top:12px;border:1px solid #E5E7EB;border-radius:10px;overflow:hidden;">
            <img src="/assets/tutorials/screenshots/<?= e($step['screenshot']) ?>" alt="<?= e($step['title']) ?>" style="width:100%;display:block;" loading="lazy">
        </div>
        <?php endif; ?>
    </div>
    <?php $num++; endforeach; ?>

    <div class="tut-nav">
        <?php if ($prevSlug): ?>
        <a href="/tutorials/<?= e($sectionKey) ?>/<?= e($prevSlug) ?>"><i data-lucide="arrow-right" style="width:14px;height:14px;"></i> <?= e($prevTitle) ?></a>
        <?php else: ?><span></span><?php endif; ?>
        <?php if ($nextSlug): ?>
        <a href="/tutorials/<?= e($sectionKey) ?>/<?= e($nextSlug) ?>"><?= e($nextTitle) ?> <i data-lucide="arrow-left" style="width:14px;height:14px;"></i></a>
        <?php else: ?><span></span><?php endif; ?>
    </div>
</div>
<script>document.addEventListener('DOMContentLoaded', function() { if (typeof lucide !== 'undefined') lucide.createIcons(); });</script>
<?php $__template->endSection(); ?>
