/* =============================================
   RunParticle — Docs Page Styles
   ============================================= */

/* --- Docs Layout --- */

.docs-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

/* --- Sidebar --- */

.docs-sidebar {
    position: sticky;
    top: 64px;
    width: 240px;
    height: calc(100vh - 64px);
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

.sidebar-inner {
    padding: 32px 24px;
}

.sidebar-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1.4;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--accent-subtle);
}

.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-subtle);
}

/* --- Sidebar group headings and sub-links --- */

.sidebar-link.active-group {
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 12px;
}

.sidebar-sub {
    padding-left: 24px;
    font-size: 0.74rem;
}

/* --- Main Content --- */

.docs-main {
    flex: 1;
    min-width: 0;
    padding: 48px 56px 120px;
    max-width: 820px;
}

.docs-content {
    max-width: 680px;
}

/* --- Header --- */

.docs-header {
    margin-bottom: 56px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

.docs-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.docs-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* --- Sections --- */

.docs-section {
    position: relative;
    margin-bottom: 56px;
    padding-bottom: 56px;
    border-bottom: 1px solid var(--border);
}

.docs-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-subtle);
    border: 1px solid rgba(0, 255, 136, 0.2);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 16px;
}

.docs-section h2 {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.docs-section p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    font-weight: 300;
}

.docs-section p code {
    font-size: 0.85em;
}

/* --- Code Blocks --- */

.code-block {
    border-radius: 10px;
    overflow: hidden;
    background: #0b0b16;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.015);
    border-bottom: 1px solid var(--border);
}

.code-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: lowercase;
}

.code-block .copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.code-block .copy-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--border);
}

.code-block .copy-btn .check-icon {
    display: none;
}

.code-block .copy-btn.copied .copy-icon {
    display: none;
}

.code-block .copy-btn.copied .check-icon {
    display: block;
    color: var(--accent);
}

.code-body {
    padding: 18px 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.85;
    color: var(--text-secondary);
    overflow-x: auto;
    margin: 0;
    background: none;
}

.code-body .term-prompt {
    color: var(--accent);
    user-select: none;
}

.code-body .term-prompt.remote {
    color: #6c9bff;
}

.code-body .term-cmd {
    color: var(--text-primary);
}

.code-body .term-output {
    color: var(--text-secondary);
}

.code-body .term-output.success {
    color: var(--accent);
}

/* --- URL Highlight --- */

.url-highlight {
    padding: 14px 20px;
    background: var(--accent-subtle);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.url-highlight code {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    background: none;
    padding: 0;
}

/* --- Idle Policy Cards --- */

.idle-policies {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.policy-card {
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.policy-name {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

.policy-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 300;
}

.policy-desc em {
    color: var(--text-muted);
}

/* --- What's Next section --- */

.docs-next h2 {
    margin-bottom: 12px;
}

/* --- Mobile sidebar toggle --- */

.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

/* --- Responsive --- */

@media (max-width: 900px) {
    .docs-sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        z-index: 150;
        width: 260px;
        background: var(--bg-deep);
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        border-right: 1px solid var(--border);
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .docs-main {
        padding: 40px 24px 100px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        top: 64px;
        background: rgba(0, 0, 0, 0.5);
        z-index: 140;
    }

    .sidebar-overlay.open {
        display: block;
    }
}

@media (max-width: 480px) {
    .docs-main {
        padding: 28px 16px 80px;
    }

    .docs-title {
        font-size: 1.8rem;
    }

    .idle-policies {
        grid-template-columns: 1fr;
    }

    .code-body {
        font-size: 0.72rem;
        padding: 14px 14px;
    }
}
