/* === Docs / Tutorial Page Styles === */

/* Offset browser-native anchor scrolling for sticky header (64px) + sticky tab bar (~48px) */
html:has(.docs-tabs-wrap) {
    scroll-padding-top: 128px;
}

/* ---- Docs Hero ---- */
.docs-hero {
    background: var(--gradient-hero);
    padding: 68px 0 76px;
    position: relative;
    overflow: hidden;
    color: #fff;
    text-align: center;
}
.docs-hero::before {
    content: '';
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 68%);
    pointer-events: none;
}
.docs-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 50px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}
.docs-hero-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80, 0 0 12px rgba(74,222,128,0.5);
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px #4ade80, 0 0 12px rgba(74,222,128,0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 3px #4ade80; }
}
.docs-hero h1 {
    font-size: 46px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.2px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}
.docs-hero-hl {
    background: linear-gradient(90deg, #f9a8d4 0%, #e879f9 40%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.docs-hero p {
    font-size: 17px;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 36px;
    line-height: 1.75;
    position: relative;
    z-index: 1;
}
.docs-hero-jumps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.docs-jump-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-main);
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(6px);
    cursor: pointer;
    text-decoration: none;
}
.docs-jump-btn svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.docs-jump-btn:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); color: #fff; }

/* ---- Platform Tabs (Sticky) ---- */
.docs-tabs-wrap {
    position: sticky;
    top: 64px; /* JS in docs.js overwrites this with the measured header height */
    z-index: 90;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.docs-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.docs-tabs::-webkit-scrollbar { display: none; }
.docs-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 14px 22px;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    color: #6b7280;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.docs-tab svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.docs-tab:hover { color: var(--color-primary); }
.docs-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* ---- Tutorial Sections ---- */
.tutorial-section {
    padding: 64px 0 72px;
    border-bottom: 1px solid var(--color-border);
    scroll-margin-top: 128px;
}
.tutorial-section:nth-child(even) { background: #f8fafc; }
.tutorial-section:last-child { border-bottom: none; }

.tutorial-header {
    margin-bottom: 48px;
}
.tutorial-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 10px;
}
.tutorial-eyebrow svg { width: 16px; height: 16px; fill: currentColor; }
.tutorial-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--color-text);
    margin-bottom: 10px;
}
.tutorial-subtitle {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
}

/* ---- Client Banner (links to download) ---- */
.client-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}
.client-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.client-banner-icon svg { width: 22px; height: 22px; fill: #fff; }
.client-banner-info { flex: 1; min-width: 0; }
.client-banner-name { font-size: 15px; font-weight: 700; color: var(--color-text); }
.client-banner-desc { font-size: 13px; color: #6b7280; margin-top: 2px; }
.client-banner-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.client-banner-chip {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(0, 102, 255, 0.08);
    border: 1px solid rgba(0,102,255,0.18);
    padding: 2px 10px;
    border-radius: 50px;
}
.client-banner-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: 50px;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.client-banner-action svg { width: 14px; height: 14px; fill: currentColor; }
.client-banner-action:hover { opacity: 0.88; transform: translateY(-1px); color: #fff; }

/* ---- Step Cards ---- */
.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.step-card {
    display: flex;
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}
.step-card:last-child { border-bottom: none; }
.step-card::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 64px;
    bottom: -1px;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-primary) 0%, transparent 100%);
    opacity: 0.15;
}
.step-card:last-child::before { display: none; }
.step-num {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gradient-hero);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 16px rgba(0,102,255,0.25);
}
.step-body { flex: 1; min-width: 0; }
.step-body h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}
.step-body p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 12px;
}
.step-body p:last-child { margin-bottom: 0; }

/* ---- Tip / Warning Boxes ---- */
.tip-box {
    display: flex;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 14px 0;
    font-size: 14px;
    color: #166534;
    line-height: 1.65;
}
.tip-box svg { width: 18px; height: 18px; fill: #22c55e; flex-shrink: 0; margin-top: 1px; }
.warn-box {
    display: flex;
    gap: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 14px 0;
    font-size: 14px;
    color: #92400e;
    line-height: 1.65;
}
.warn-box svg { width: 18px; height: 18px; fill: #f59e0b; flex-shrink: 0; margin-top: 1px; }
.info-box {
    display: flex;
    gap: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 14px 0;
    font-size: 14px;
    color: #1e40af;
    line-height: 1.65;
}
.info-box svg { width: 18px; height: 18px; fill: #3b82f6; flex-shrink: 0; margin-top: 1px; }

/* ---- Inline Code ---- */
.step-body code,
.tip-box code,
.warn-box code,
.info-box code {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 12.5px;
    background: rgba(0,0,0,0.06);
    padding: 1px 6px;
    border-radius: 4px;
    color: inherit;
}

/* ---- Code Block (Terminal) ---- */
.docs-terminal {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    margin: 16px 0;
    font-size: 13.5px;
}
.docs-terminal-hd {
    background: #1e2330;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dt-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dt-dot-r { background: #ff5f56; }
.dt-dot-y { background: #ffbd2e; }
.dt-dot-g { background: #27c93f; }
.dt-filename { color: rgba(255,255,255,0.5); font-size: 12px; margin-left: 4px; }
.docs-terminal-body {
    background: #0f1117;
    padding: 18px 20px;
    color: #e2e8f0;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    line-height: 2;
    overflow-x: auto;
}
.docs-terminal-body .lt-cmt { color: #6b7280; }
.docs-terminal-body .lt-ps { color: #4ade80; font-weight: bold; }
.docs-terminal-body .lt-cmd { color: #60a5fa; }
.docs-terminal-body .lt-str { color: #f9a8d4; }
.docs-terminal-body .lt-ok { color: #4ade80; }

/* ---- YAML Code block ---- */
.docs-yaml {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    margin: 16px 0;
    font-size: 13px;
}
.docs-yaml-hd {
    background: #1e2330;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.docs-yaml-body {
    background: #0f1117;
    padding: 20px 22px;
    color: #e2e8f0;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    line-height: 1.9;
    overflow-x: auto;
}

/* ---- iOS Paid Note ---- */
.ios-paid-note {
    background: linear-gradient(135deg, #fdf4ff 0%, #f5f3ff 100%);
    border: 1px solid #e9d5ff;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 36px;
    font-size: 14px;
    color: #4c1d95;
    line-height: 1.7;
}
.ios-paid-note strong { font-weight: 700; }

/* ---- Advanced Topics ---- */
.advanced-section {
    padding: 72px 0;
    background: #0e0020;
    color: #fff;
}
.advanced-section .tutorial-eyebrow { color: #60a5fa; }
.advanced-section .tutorial-title { color: #fff; }
.advanced-section .tutorial-subtitle { color: rgba(255,255,255,0.65); }
.advanced-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}
.adv-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 28px 24px;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.adv-card:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.18);
    transform: translateY(-3px);
}
.adv-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--gradient-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.adv-icon svg { width: 22px; height: 22px; fill: #fff; }
.adv-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}
.adv-card p {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    line-height: 1.7;
    margin-bottom: 16px;
}
.adv-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: none;
    transition: gap 0.2s;
}
.adv-link svg { width: 14px; height: 14px; fill: currentColor; }
.adv-link:hover { gap: 10px; color: #93c5fd; }

/* ---- FAQ ---- */
.docs-faq {
    padding: 72px 0;
    background: #f8fafc;
}
.docs-faq-hd {
    text-align: center;
    margin-bottom: 48px;
}
.docs-faq-hd h2 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--color-text);
    margin: 12px 0 10px;
}
.docs-faq-hd p { font-size: 16px; color: #6b7280; }

.faq-docs-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-docs-details {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.faq-docs-details[open] {
    box-shadow: 0 4px 20px rgba(0,102,255,0.1);
    border-color: #bfdbfe;
}
.faq-docs-summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    cursor: pointer;
    user-select: none;
}
.faq-docs-summary::-webkit-details-marker { display: none; }
.faq-docs-summary .fq-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
    background: rgba(0,102,255,0.08);
    border-radius: 6px;
    padding: 2px 8px;
    flex-shrink: 0;
    font-family: var(--font-main);
}
.faq-docs-summary .fq-text {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.5;
}
.faq-docs-summary .fq-chevron {
    flex-shrink: 0;
    fill: #9ca3af;
    transition: transform 0.25s ease;
}
.faq-docs-details[open] .fq-chevron { transform: rotate(180deg); }
.faq-docs-ans {
    padding: 0 22px 20px 22px;
    font-size: 15px;
    color: #4b5563;
    line-height: 1.75;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
}

/* ---- CTA Banner ---- */
.docs-cta-banner {
    background: var(--gradient-hero);
    padding: 64px 0;
    text-align: center;
    color: #fff;
}
.docs-cta-banner h2 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}
.docs-cta-banner p {
    font-size: 16px;
    opacity: 0.85;
    max-width: 520px;
    margin: 0 auto 32px;
    line-height: 1.7;
}
.docs-cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.docs-cta-gh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 13px 24px;
    border-radius: 50px;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}
.docs-cta-gh svg { fill: currentColor; }
.docs-cta-gh:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* ---- Sub-section / collapsible platforms ---- */
.alt-clients-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    padding: 8px 0;
    margin-top: 8px;
    transition: opacity 0.2s;
}
.alt-clients-toggle svg { width: 16px; height: 16px; fill: currentColor; transition: transform 0.25s; }
.alt-clients-toggle.open svg { transform: rotate(180deg); }
.alt-clients-panel {
    display: none;
    margin-top: 12px;
    border-top: 1px dashed var(--color-border);
    padding-top: 20px;
}
.alt-clients-panel.open { display: block; }

/* ---- Alt Client List ---- */
.alt-client-list { display: flex; flex-direction: column; gap: 12px; }
.alt-client-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px 18px;
}
.alt-client-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    flex-shrink: 0;
    margin-top: 6px;
}
.alt-client-info h5 { font-size: 15px; font-weight: 700; color: var(--color-text); margin-bottom: 4px; }
.alt-client-info p { font-size: 13px; color: #6b7280; line-height: 1.6; }
.alt-client-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 50px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}
.alt-badge-newbie { background: #dcfce7; color: #166534; }
.alt-badge-archived { background: #fee2e2; color: #991b1b; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .docs-hero h1 { font-size: 34px; }
    .tutorial-title { font-size: 26px; }
    .advanced-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .docs-hero { padding: 48px 0 56px; }
    .docs-hero h1 { font-size: 28px; }
    .docs-hero p { font-size: 15px; }
    .docs-tab { padding: 12px 14px; font-size: 12.5px; }
    .tutorial-section { padding: 44px 0 52px; }
    .tutorial-title { font-size: 22px; }
    .step-card { gap: 14px; }
    .step-num { width: 38px; height: 38px; font-size: 15px; }
    .step-body h4 { font-size: 16px; }
    .advanced-grid { grid-template-columns: 1fr; }
    .client-banner { flex-direction: column; align-items: flex-start; }
    .docs-cta-banner h2 { font-size: 24px; }
    .docs-cta-actions { flex-direction: column; }
}
