/* ============================================================
   Documentation — /support/*
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────────── */
.doc-wrapper {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 64px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    gap: 3rem;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.doc-sidebar {
    flex-shrink: 0;
    width: 220px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 2rem 0;
    scrollbar-width: thin;
}

.doc-nav-helpdesk { margin-bottom: 1.25rem; }

.doc-nav-helpdesk-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    border-radius: 6px;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.doc-nav-helpdesk-btn:hover {
    background: var(--primary);
    color: #fff;
}

.doc-nav-section { margin-bottom: 1.5rem; }

.doc-nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
    padding: 0 0.75rem;
}

.doc-nav ul { list-style: none; }

.doc-nav ul li a {
    display: block;
    padding: 0.3rem 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: background var(--transition), color var(--transition);
    line-height: 1.4;
}

.doc-nav ul li a:hover { background: var(--surface); color: var(--text); }
.doc-nav ul li a.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.doc-nav-subsection { margin-top: 0.75rem; }
.doc-nav-sublabel {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0 0.75rem 0 1.25rem;
    margin-bottom: 0.25rem;
}
.doc-nav-subsection ul li a { padding-left: 1.25rem; }

.doc-nav-download {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.5rem 0.75rem 0;
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.doc-nav-download:hover { text-decoration: underline; }

/* ── Main content ────────────────────────────────────────────── */
.doc-main {
    flex: 1;
    min-width: 0;
    padding: 2.5rem 0 4rem;
}

.doc-article h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin-bottom: 0.5rem;
    color: var(--text);
}

.doc-lead {
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.doc-article h2 {
    font-size: 1.35rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.doc-article h3 {
    font-size: 1.05rem;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.doc-article p { margin-bottom: 1rem; line-height: 1.7; }
.doc-article a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }
.doc-article a:hover { color: var(--primary); }

/* ── Code ────────────────────────────────────────────────────── */
.doc-article code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1em 0.4em;
    color: var(--text);
}

.doc-article pre {
    background: #0f172a;
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
}

.doc-article pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    color: #e2e8f0;
    line-height: 1.7;
}

/* ── Tables ──────────────────────────────────────────────────── */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.9rem;
}

.doc-table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
}

.doc-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: top;
}

.doc-table tr:last-child td { border-bottom: none; }

/* ── Endpoint display ────────────────────────────────────────── */
.doc-endpoint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    font-family: monospace;
    font-size: 0.95rem;
}

.doc-method {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    color: #fff;
}
.doc-method--get    { background: #16a34a; }
.doc-method--post   { background: #2563eb; }
.doc-method--put    { background: #d97706; }
.doc-method--delete { background: #dc2626; }

/* ── Callouts ────────────────────────────────────────────────── */
.doc-note, .doc-warning {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1.25rem 0;
    font-size: 0.9rem;
}

.doc-note { background: var(--accent-light); border-left: 3px solid var(--accent); }
.doc-note svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.doc-note p { color: #0c4a6e; margin: 0; }
.doc-note-download { flex-direction: column; gap: 0.6rem; }
.doc-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    padding: 0.4rem 0.9rem;
    background: var(--primary);
    color: #fff !important;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    width: fit-content;
}
.doc-download-btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

.doc-warning { background: #fff7ed; border-left: 3px solid #f97316; }
.doc-warning svg { color: #f97316; flex-shrink: 0; margin-top: 2px; }
.doc-warning p { color: #7c2d12; margin: 0; }

/* ── Steps ───────────────────────────────────────────────────── */
.doc-steps {
    list-style: none;
    counter-reset: doc-step;
    margin: 1.25rem 0 1.5rem;
}

.doc-steps > li {
    counter-increment: doc-step;
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 1.5rem;
}

.doc-steps > li::before {
    content: counter(doc-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.doc-steps.doc-steps-titled > li::before { top: 2px; }

.doc-step-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.6rem;
}

/* Simple ordered list */
ol.doc-steps:not(.doc-steps-titled) { list-style: decimal; padding-left: 1.5rem; }
ol.doc-steps:not(.doc-steps-titled) > li { padding-left: 0.5rem; color: var(--text-secondary); }
ol.doc-steps:not(.doc-steps-titled) > li::before { display: none; }

/* ── Unordered list ──────────────────────────────────────────── */
.doc-list {
    padding-left: 1.5rem;
    margin: 0.5rem 0 1rem;
}
.doc-list li { color: var(--text-secondary); margin-bottom: 0.4rem; line-height: 1.6; }

/* ── Glossary ────────────────────────────────────────────────── */
.doc-glossary { margin: 1rem 0 1.5rem; }
.doc-glossary > div { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.doc-glossary > div:last-child { border-bottom: none; }
.doc-glossary dt { font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.doc-glossary dd { color: var(--text-secondary); margin: 0; line-height: 1.6; }

/* ── Cards ───────────────────────────────────────────────────── */
.doc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 1.5rem;
}

.doc-card {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    text-decoration: none !important;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.doc-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.doc-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
}

.doc-card-title { font-weight: 600; color: var(--text); font-size: 0.95rem; margin-bottom: 0.2rem; }
.doc-card-desc  { font-size: 0.83rem; color: var(--muted); line-height: 1.4; }

/* ── Pagination ──────────────────────────────────────────────── */
.doc-pagination {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.doc-pagination-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.875rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    max-width: 48%;
}

.doc-pagination-link:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.doc-pagination-next { text-align: right; margin-left: auto; }

.doc-pagination-dir { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.doc-pagination-title { font-size: 0.92rem; font-weight: 600; color: var(--text); }

/* ── Mobile sidebar toggle ───────────────────────────────────── */
.doc-sidebar-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    margin: 1rem 0 0;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .doc-wrapper { flex-direction: column; gap: 0; padding: 0 1rem; }

    .doc-sidebar-toggle { display: flex; }

    .doc-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 260px;
        height: 100vh;
        max-height: none;
        background: var(--white);
        border-right: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        z-index: 200;
        padding: 1.5rem 1rem;
        transition: left 0.25s ease;
        overflow-y: auto;
    }

    .doc-sidebar.open { left: 0; }

    .doc-main { padding-top: 1.5rem; width: 100%; }

    .doc-cards { grid-template-columns: 1fr; }

    .doc-article pre { font-size: 0.8rem; padding: 1rem; }
}
