/* Shared tutorial layout — slyzz.fr site look (home / product pages).
   Load order: this file first, then each tutorial's local style.css. */

:root {
    --bg: #111114;
    --bg-2: #111114;
    --surface: #18181d;
    --input: #151519;
    --border: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --text: #f5f5f7;
    --muted: rgba(255, 255, 255, 0.65);
    --subtle: rgba(255, 255, 255, 0.5);
    --accent: #7e22ce;
    --accent-2: #a855f7;
    --accent-3: #c084fc;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --purple-glow: rgba(147, 51, 234, 0.15);
    --sidebar-w: 280px;

    /* Legacy aliases — used in inline styles across tutorial PHP files */
    --bg-elevated: var(--surface);
    --bg-sunken: #151519;
    --primary: #a855f7;
    --glow: rgba(147, 51, 234, 0.45);
    --glow-soft: rgba(147, 51, 234, 0.1);
    --text-dim: var(--muted);
    --text-faint: var(--subtle);
    --accent-light: var(--accent-3);
    --accent-bg: rgba(168, 85, 247, 0.12);
    --accent-border: rgba(168, 85, 247, 0.35);
    --border-strong: rgba(255, 255, 255, 0.14);
}

* { box-sizing: border-box; }

html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 'Poppins', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color-scheme: dark;
}
body::before {
    content: '';
    position: fixed;
    inset: 0 0 auto 0;
    height: 520px;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(50% 60% at 30% 0%, rgba(126, 34, 206, 0.16), transparent 70%);
}

.doc-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }

a { color: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.03); }

/* ---------- Sidebar ---------- */
.doc-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: #151519;
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    padding: 0 0 24px;
}

.doc-brand {
    display: flex; align-items: center; gap: 8px;
    padding: 0 22px; height: 64px; flex-shrink: 0;
    font-size: 18px; font-weight: 600; letter-spacing: -0.02em;
    color: #ffffff !important; text-decoration: none !important;
    border-bottom: 1px solid var(--border-subtle);
}
.doc-brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }

.doc-sidebar .doc-back-link {
    display: flex; align-items: center; gap: 8px;
    color: var(--subtle) !important; text-decoration: none !important; font-size: 13px; font-weight: 500;
    padding: 0 22px; height: 48px; flex-shrink: 0;
    transition: color 0.15s;
}
.doc-sidebar .doc-back-link:hover { color: var(--text) !important; }
.doc-sidebar .doc-back-link i { font-size: 11px; }

/* ---------- Product switcher ---------- */
.doc-product-switcher { position: relative; padding: 0 14px; }

.doc-product {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px; margin: 0; background: #18181d; cursor: pointer; text-align: left;
    border: 0; border-radius: 18px;
    box-shadow: inset 0 0 0 1px var(--border);
    font-family: inherit; color: var(--text);
    transition: box-shadow 0.15s;
}
.doc-product:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.doc-product .icon {
    width: 56px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: #151519; box-shadow: inset 0 0 0 1px var(--border);
    display: flex; align-items: center; justify-content: center; color: var(--accent-2); font-size: 15px;
    overflow: hidden;
}
.doc-product .icon img, .product-menu-thumb img {
    width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
}
.product-menu-thumb {
    width: 40px; height: 30px; border-radius: 7px; flex-shrink: 0; overflow: hidden;
    background: #151519; box-shadow: inset 0 0 0 1px var(--border);
    display: flex; align-items: center; justify-content: center; color: var(--accent-2); font-size: 11px;
}
.doc-product-text { flex: 1; min-width: 0; }
.doc-product .name { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-product .sub { font-size: 12px; color: var(--subtle); }
.switch-chevron { font-size: 10px; color: var(--subtle); flex-shrink: 0; transition: transform 0.2s ease; }
.doc-product-switcher.open .switch-chevron { transform: rotate(180deg); }

.product-menu {
    position: absolute; left: 14px; right: 14px; top: calc(100% + 8px); z-index: 40;
    background: rgba(17, 17, 21, 0.92); border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 8px; opacity: 0; transform: translateY(-6px);
    pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
}
.doc-product-switcher.open .product-menu {
    opacity: 1; transform: translateY(0); pointer-events: auto;
}
.product-menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px; border-radius: 10px; text-decoration: none;
    color: rgba(255, 255, 255, 0.85); font-size: 14px; font-weight: 400; transition: 0.15s;
}
.product-menu-item span { flex: 1; }
.product-menu-item .check { color: var(--accent-2); font-size: 11px; }
.product-menu-item:hover { background: rgba(255, 255, 255, 0.06); color: #ffffff; }
.product-menu-item.current { color: #ffffff; font-weight: 600; }

/* ---------- Navigation ---------- */
.nav-section { padding: 0 14px; margin-top: 22px; }
.nav-section .label {
    display: block; color: rgba(255, 255, 255, 0.4);
    font-size: 11px; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.08em; padding: 0 14px 8px;
}
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; margin: 2px 0; border-radius: 14px;
    text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 400;
    transition: background 0.15s, color 0.15s;
}
.nav-link i { width: 16px; text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, 0.4); transition: color 0.15s; }
.nav-link:hover { color: #ffffff; background: rgba(255, 255, 255, 0.04); }
.nav-link:hover i { color: var(--muted); }
.nav-link.active {
    color: #ffffff; font-weight: 500;
    background: rgba(168, 85, 247, 0.16);
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.35);
}
.nav-link.active i { color: var(--accent-2); }

/* ---------- Topbar (mobile) ---------- */
.doc-topbar {
    display: none;
    position: sticky; top: 0; z-index: 20;
    height: 60px; align-items: center; gap: 12px;
    background: rgba(17,17,20, 0.9);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 18px;
}
.doc-topbar button {
    background: #18181d; border: 0; box-shadow: inset 0 0 0 1px var(--border); color: var(--text);
    width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.doc-topbar .crumb { font-size: 13px; color: var(--subtle); }

/* ---------- Main content ---------- */
.doc-main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; }
.doc-content { max-width: 820px; margin: 0 auto; padding: 56px 48px 96px; }

.breadcrumb { font-size: 13px; color: var(--subtle); margin-bottom: 28px; }
.breadcrumb a { text-decoration: none; color: var(--subtle); }
.breadcrumb a:hover { color: var(--accent-3); }
.breadcrumb .sep { margin: 0 8px; }

h1 {
    font-size: 44px; font-weight: 400; margin: 0 0 12px; letter-spacing: -0.045em; line-height: 1.08;
    color: #ffffff;
}
.doc-content .lede { color: var(--muted); font-size: 17px; line-height: 1.6; margin: 0 0 36px; }

h2 {
    font-size: 22px; font-weight: 500; margin: 44px 0 10px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: #ffffff; letter-spacing: -0.02em;
}
h3 { font-size: 16px; font-weight: 600; color: var(--accent-3); margin: 26px 0 10px; }

p { color: var(--muted); font-size: 15px; line-height: 1.7; }
p b, li b { color: #ffffff; }

/* ---------- Callouts ---------- */
.callout {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; margin: 18px 0;
    font-size: 14px; line-height: 1.55;
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--border-subtle);
}
.callout i {
    width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.callout div { color: var(--muted); }
.callout div b { color: #ffffff; }
.callout.info i { background: rgba(168, 85, 247, 0.14); box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.35); color: var(--accent-2); }
.callout.warning i { background: rgba(245, 158, 11, 0.12); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.3); color: var(--warning); }
.callout.danger i { background: rgba(248, 113, 113, 0.12); box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.3); color: var(--danger); }
.callout:has(ol), .callout:has(p + p) { align-items: flex-start; }
.callout:has(ol) i, .callout:has(p + p) i { margin-top: 2px; }

/* ---------- Alert boxes ---------- */
.alert-box {
    background: var(--surface);
    border-radius: 20px; padding: 24px 28px; margin-bottom: 24px;
    position: relative; overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--border-subtle);
}
.alert-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.alert-box h2 {
    font-size: 19px; margin: 0 0 10px; border: none; padding: 0; color: #ffffff;
}
.alert-box p { margin: 0; line-height: 1.6; color: var(--muted); font-size: 14px; }
.alert-box p + p { margin-top: 8px; }
.alert-box mark { background: transparent; font-weight: 600; text-decoration: underline; }
.alert-box.danger::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.alert-box.danger mark { color: #f87171; }
.alert-box.warning::before { background: linear-gradient(90deg, #eab308, #facc15); }
.alert-box.info::before { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.pill-tag {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
    border-radius: 100px; font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 14px; border: 1px solid;
}
.alert-box.danger .pill-tag { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
.alert-box.warning .pill-tag { background: rgba(234, 179, 8, 0.1); border-color: rgba(234, 179, 8, 0.3); color: #facc15; }
.alert-box.info .pill-tag { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.35); color: var(--accent-3); }

/* ---------- Step list (numbered) ---------- */
.step-list { list-style: none; padding: 0; margin: 16px 0; counter-reset: step; }
.step-list li {
    counter-increment: step; display: flex; align-items: center; gap: 14px; padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.step-list li:last-child { border-bottom: none; }
.step-list li::before {
    content: counter(step); flex-shrink: 0;
    width: 26px; height: 26px; border-radius: 999px;
    background: rgba(168, 85, 247, 0.16); box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.35);
    color: var(--accent-3); font-size: 12px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace;
}
.step-list li div { padding-top: 1px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.step-list li div b { color: #ffffff; }
.step-list li div p { margin: 4px 0 0; }
.step-list li:has(div p) { align-items: flex-start; }
.step-list li:has(div p)::before { margin-top: 2px; }

/* ---------- Spec list ---------- */
.spec-list { list-style: none; padding: 0; margin: 0; }
.spec-list li {
    background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-subtle);
    border-radius: 14px; padding: 13px 16px; margin-bottom: 8px; font-size: 14px; color: var(--muted);
}
.spec-list li b { color: #ffffff; }
.spec-list .note { display: block; font-size: 12px; color: var(--subtle); margin-top: 4px; }

/* ---------- Code ---------- */
code {
    background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--border); color: var(--accent-3);
    padding: 2px 7px; border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 0.88em;
}
pre { color: var(--accent-3); }

.cmdblock {
    margin: 10px 0 20px; border-radius: 16px;
    background: var(--surface); overflow: hidden;
    box-shadow: inset 0 0 0 1px var(--border-subtle);
}
.cmdblock-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; background: rgba(255, 255, 255, 0.02); border-bottom: 1px solid var(--border-subtle);
}
.cmdblock-dots { display: flex; gap: 6px; flex-shrink: 0; }
.cmdblock-dots span { width: 10px; height: 10px; border-radius: 50%; }
.cmdblock-dots span:nth-child(1) { background: #ef4444; opacity: 0.6; }
.cmdblock-dots span:nth-child(2) { background: #eab308; opacity: 0.6; }
.cmdblock-dots span:nth-child(3) { background: #4ade80; opacity: 0.6; }
.cmdblock-label {
    flex: 1; min-width: 0; font-size: 12px; font-weight: 500; color: var(--subtle);
    font-family: 'JetBrains Mono', monospace; display: flex; align-items: center; gap: 7px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cmdblock pre {
    background: none; border: none; border-radius: 0;
    padding: 14px 16px; margin: 0; overflow-x: auto;
}
.cmdblock pre code {
    background: none; box-shadow: none; padding: 0; color: var(--accent-3); font-size: 0.88em;
    white-space: pre-wrap; word-break: break-all;
}
.cmd-copy {
    flex-shrink: 0; display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; background: #222229; border: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); border-radius: 8px;
    color: rgba(255, 255, 255, 0.85); font-size: 12px; font-weight: 500; font-family: 'Poppins', sans-serif;
    cursor: pointer; transition: 0.15s;
}
.cmd-copy:hover { background: #2a2a32; color: #ffffff; }
.cmd-copy.copied { background: rgba(52, 211, 153, 0.12); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.35); color: var(--success); }

/* ---------- Download card ---------- */
.dl-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; margin: 10px 0 20px;
    border-radius: 18px; background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--border-subtle);
    text-decoration: none; color: var(--text);
    transition: box-shadow 0.25s, transform 0.25s;
}
.dl-card:hover {
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.45);
    transform: translateY(-2px);
}
.dl-card .dl-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 0 1px #581c87;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px;
}
.dl-card .dl-text { flex: 1; min-width: 0; }
.dl-card .dl-title { font-size: 14px; font-weight: 600; color: #ffffff; }
.dl-card .dl-sub { font-size: 12px; color: var(--subtle); margin-top: 2px; }
.dl-card .dl-arrow { color: var(--subtle); font-size: 12px; flex-shrink: 0; transition: 0.25s; }
.dl-card:hover .dl-arrow { color: var(--accent-2); transform: translateX(3px); }

/* ---------- Video ---------- */
.video-embed {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
    border-radius: 18px; box-shadow: inset 0 0 0 1px var(--border); margin: 20px 0; background: #000;
}
.video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.vplayer {
    position: relative; background: #000; border-radius: 18px;
    box-shadow: inset 0 0 0 1px var(--border);
    overflow: hidden; margin: 20px 0; max-width: 100%;
}
.vplayer video { width: 100%; display: block; cursor: pointer; }
.vp-bigplay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 60px; height: 60px; border-radius: 50%; border: 0;
    background: rgba(17, 17, 20, 0.65); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    color: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.2s; backdrop-filter: blur(6px);
}
.vp-bigplay:hover { background: var(--accent); transform: translate(-50%, -50%) scale(1.06); }
.vplayer.playing .vp-bigplay { opacity: 0; pointer-events: none; }
.vp-bar {
    position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    opacity: 0; transition: opacity 0.25s ease;
}
.vplayer:hover .vp-bar, .vplayer.playing .vp-bar { opacity: 1; }
.vp-bar button {
    background: none; border: none; color: #fff; font-size: 13px; cursor: pointer;
    width: 28px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; opacity: 0.85;
}
.vp-bar button:hover { opacity: 1; color: var(--accent-2); }
.vp-time { font-size: 11px; font-family: 'JetBrains Mono', monospace; color: rgba(255, 255, 255, 0.7); flex-shrink: 0; min-width: 82px; }
.vp-seek {
    flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px;
    background: rgba(255, 255, 255, 0.2); cursor: pointer; outline: none;
}
.vp-seek::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent-2); box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.25); cursor: pointer;
}
.vp-seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-2); border: none; cursor: pointer; }

/* ---------- Media ---------- */
.media {
    background: var(--surface); border-radius: 18px;
    box-shadow: inset 0 0 0 1px var(--border);
    margin: 20px 0; overflow: hidden; max-width: 100%;
    transition: box-shadow 0.2s ease;
}
.media:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
.media.narrow { max-width: 480px; }
.media img, .media video { width: 100%; display: block; }
.media img { cursor: zoom-in; }
video { border-radius: 18px; }

/* ---------- Prev / Next ---------- */
.doc-pager { display: flex; gap: 12px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.pager-card {
    flex: 1; text-decoration: none; padding: 16px 18px;
    border-radius: 18px; background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--border-subtle);
    transition: box-shadow 0.25s, transform 0.25s;
}
.pager-card:hover { box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.45); transform: translateY(-2px); }
.pager-card .dir { font-size: 11px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.pager-card .title { font-size: 14px; font-weight: 600; color: #ffffff; }
.pager-card.next { text-align: right; margin-left: auto; }

/* ---------- Lightbox ---------- */
#lightbox { display: none; position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, 0.92); align-items: center; justify-content: center; padding: 30px; backdrop-filter: blur(4px); }
#lightbox.active { display: flex; }
#lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--border); }
#lightbox .close { position: absolute; top: 24px; right: 30px; color: #fff; font-size: 30px; cursor: pointer; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .doc-topbar { display: flex; }
    .doc-sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; z-index: 30;
        transform: translateX(-100%); transition: transform 0.2s ease;
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.4);
    }
    .doc-sidebar.open { transform: translateX(0); }
    .doc-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 25; }
    .doc-overlay.open { display: block; }
    .doc-main { margin-left: 0; }
    .doc-content { padding: 28px 20px 64px; }
    h1 { font-size: 32px; }
    h2 { font-size: 19px; }
    .doc-pager { flex-direction: column; }
    .pager-card.next { text-align: left; margin-left: 0; }
}
