/* ═══════════════════════════════════════════════════════════════
   Documentation Detail Page
   ═══════════════════════════════════════════════════════════════ */

/* ── Icon helpers ─────────────────────────────────────────────── */
.doc-dt-icon-xs  { width: 12px; height: 12px; flex-shrink: 0; }
.doc-dt-icon-sm  { width: 16px; height: 16px; flex-shrink: 0; }
.doc-dt-icon-md  { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Page wrapper ─────────────────────────────────────────────── */
.doc-dt-page {
    min-height: 100vh;
    background: #f7f9fc;
    color: #0f172a;
}

/* ── Two-column layout: sidebar + main ───────────────────────── */
.doc-dt-wrap {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 56px);
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.doc-dt-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.doc-dt-sidebar::-webkit-scrollbar {
    width: 4px;
}
.doc-dt-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.doc-dt-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.doc-dt-sidebar-inner {
    padding: 24px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Search ────────────────────────────────────────────────────── */
.doc-dt-search {
    position: relative;
    display: flex;
    align-items: center;
}

.doc-dt-search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    pointer-events: none;
}

.doc-dt-search input {
    width: 100%;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 0 12px 0 36px;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s;
}

.doc-dt-search input:focus {
    border-color: #7dd3fc;
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.2);
}

.doc-dt-search input::placeholder {
    color: #94a3b8;
}

/* Back link ─────────────────────────────────────────────────── */
.doc-dt-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 8px;
    margin-left: -8px;
    width: fit-content;
    transition: background 0.15s, color 0.15s;
}

.doc-dt-back-link:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

/* Navigation accordion ───────────────────────────────────────── */
.doc-dt-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.doc-dt-nav-group {
    border-radius: 10px;
    overflow: hidden;
}

.doc-dt-nav-group-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    transition: background 0.15s;
}

.doc-dt-nav-group-btn:hover {
    background: #f1f5f9;
}

.doc-dt-nav-group-btn.is-active {
    background: #f1f5f9;
    color: #1e293b;
}

.doc-dt-nav-icon {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--icon-bg);
    color: var(--icon-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-dt-nav-group-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-dt-nav-chevron {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    transition: transform 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.doc-dt-nav-chevron.is-rotated {
    transform: rotate(90deg);
}

.doc-dt-nav-items {
    margin: 0;
    padding: 4px 0 6px 34px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.doc-dt-nav-item {
    display: block;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    line-height: 1.4;
}

.doc-dt-nav-item:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.doc-dt-nav-item.is-active {
    background: #3b82f6;
    color: #fff;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ══════════════════════════════════════════════════════════════ */
.doc-dt-main {
    flex: 1;
    min-width: 0;
    padding: 40px 48px 80px;
}

.doc-dt-content {
    max-width: 860px;
}

/* Breadcrumb ────────────────────────────────────────────────── */
.doc-dt-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #64748b;
}

.doc-dt-breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.12s;
}

.doc-dt-breadcrumb a:hover {
    color: #0284c7;
}

.doc-dt-breadcrumb svg {
    color: #cbd5e1;
}

.doc-dt-breadcrumb strong {
    color: #1e293b;
    font-weight: 500;
}

/* Category badge ────────────────────────────────────────────── */
.doc-dt-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--badge-color);
    background: var(--badge-bg);
    margin-bottom: 14px;
}

/* Title ─────────────────────────────────────────────────────── */
.doc-dt-title {
    margin: 0 0 14px;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: #0f172a;
}

/* Description ───────────────────────────────────────────────── */
.doc-dt-desc {
    margin: 0 0 16px;
    font-size: 18px;
    line-height: 1.75;
    color: #475569;
}

/* Meta row ──────────────────────────────────────────────────── */
.doc-dt-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 13px;
    color: #64748b;
}

.doc-dt-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.doc-dt-meta-sep {
    color: #cbd5e1;
}

/* Divider ───────────────────────────────────────────────────── */
.doc-dt-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 0 0 32px;
}

/* Table of Contents ─────────────────────────────────────────── */
.doc-dt-toc {
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #f8fafc;
    padding: 20px 24px;
    margin-bottom: 36px;
}

.doc-dt-toc-title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-dt-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-dt-toc a {
    font-size: 14px;
    color: #475569;
    text-decoration: none;
    transition: color 0.12s;
}

.doc-dt-toc a:hover {
    color: #0284c7;
}

/* Intro ─────────────────────────────────────────────────────── */
.doc-dt-intro {
    font-size: 17px;
    line-height: 1.9;
    color: #334155;
    margin-bottom: 36px;
}

/* Content section ───────────────────────────────────────────── */
.doc-dt-section {
    margin-bottom: 44px;
    scroll-margin-top: 80px;
}

.doc-dt-section h2 {
    margin: 0 0 14px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0f172a;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.doc-dt-section > p {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.9;
    color: #334155;
}

/* List ──────────────────────────────────────────────────────── */
.doc-dt-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.doc-dt-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #334155;
    line-height: 1.7;
    padding: 8px 12px;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    background: #fafbfc;
}

.doc-dt-list li::before {
    content: "";
    display: inline-flex;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
    flex-shrink: 0;
    margin-top: 6px;
}

/* Callout ───────────────────────────────────────────────────── */
.doc-dt-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 14px;
    padding: 14px 16px;
    margin: 20px 0;
    border: 1px solid;
}

.doc-dt-callout p {
    margin: 0;
    font-size: 14px;
    line-height: 1.75;
}

.doc-dt-callout--info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.doc-dt-callout--info svg {
    color: #3b82f6;
    margin-top: 1px;
}

.doc-dt-callout--warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.doc-dt-callout--warning svg {
    color: #f59e0b;
    margin-top: 1px;
}

.doc-dt-callout--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.doc-dt-callout--success svg {
    color: #22c55e;
    margin-top: 1px;
}

/* Code block ────────────────────────────────────────────────── */
.doc-dt-code {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #1e293b;
    background: #0f172a;
    margin: 20px 0;
}

.doc-dt-code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
}

.doc-dt-code-lang {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.1em;
}

.doc-dt-code-copy {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.12s;
    padding: 2px 0;
}

.doc-dt-code-copy:hover {
    color: #e2e8f0;
}

.doc-dt-code-copy-inner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.doc-dt-code pre {
    margin: 0;
    overflow-x: auto;
    padding: 20px;
    color: #e2e8f0;
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
    font-size: 13.5px;
    line-height: 1.7;
}

.doc-dt-code code {
    font-family: inherit;
    white-space: pre;
}

/* Feedback ──────────────────────────────────────────────────── */
.doc-dt-feedback {
    margin-top: 56px;
    padding: 20px 24px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.doc-dt-feedback > p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.doc-dt-feedback-thanks {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #15803d;
    font-size: 14px;
    font-weight: 600;
}

.doc-dt-feedback-btns {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.doc-dt-feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.doc-dt-feedback-btn:hover {
    border-color: #7dd3fc;
    background: #f0f9ff;
    color: #0369a1;
}

/* Prev / Next pagination ─────────────────────────────────────── */
.doc-dt-pagination {
    margin-top: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.doc-dt-pager {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 16px;
    text-decoration: none;
    color: #334155;
    background: #fff;
    transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.doc-dt-pager:hover {
    border-color: #7dd3fc;
    background: #f0f9ff;
    color: #0369a1;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.doc-dt-pager > svg {
    flex-shrink: 0;
    color: #94a3b8;
}

.doc-dt-pager--next {
    justify-content: flex-end;
    text-align: right;
}

.doc-dt-pager small {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 3px;
}

.doc-dt-pager span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
    .doc-dt-sidebar {
        display: none;
    }

    .doc-dt-main {
        padding: 28px 20px 60px;
    }

    .doc-dt-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }
}

@media (max-width: 767px) {
    .doc-dt-main {
        padding: 20px 16px 56px;
    }

    .doc-dt-desc {
        font-size: 16px;
    }

    .doc-dt-section h2 {
        font-size: 18px;
    }

    .doc-dt-feedback {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .doc-dt-pager--next {
        justify-content: flex-start;
        text-align: left;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR MOBILE TOGGLE (optional — shown on tablet)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
    .doc-dt-wrap {
        flex-direction: column;
    }

    .doc-dt-sidebar {
        display: block;
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        overflow: visible;
    }

    .doc-dt-sidebar-inner {
        padding: 16px 20px;
    }

    .doc-dt-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .doc-dt-main {
        padding: 32px 24px 60px;
    }
}
