:root {
    --doc-sidebar-width: 420px;
    --doc-resize-hitbox: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    overflow-x: hidden;
}

body {
    background: #fff;
}

/* Global safety against horizontal overflow */
.doc-layout,
.doc-sidebar,
.doc-content,
#contentList,
.card,
.card-body,
.accordion,
.accordion-item,
.accordion-body,
.offcanvas,
.offcanvas-body {
    min-width: 0;
    max-width: 100%;
}

img,
iframe,
table {
    max-width: 100%;
}

pre,
code {
    max-width: 100%;
}

pre {
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.toast{
    top: 86px;
    position: fixed;
    z-index: 999;
    right: 8px;
}

.min-w-0 {
    min-width: 0;
}

.top-anchor h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================
   LOADER
   ========================= */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.2s ease-in-out,
        visibility 0.2s ease-in-out;
}

.page-loader-inner {
    text-align: center;
}

/* =========================
   MOBILE + TABLET DEFAULT
   ========================= */

html,
body {
    height: auto;
}

body {
    overflow-y: auto;
    overflow-x: hidden;
}

.doc-layout {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: auto;
    height: auto;
    position: relative;
}

.doc-sidebar {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: none;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 0;
    background: #f8f9fa;
}

.doc-content {
    min-width: 0;
    min-height: auto;
    overflow: visible;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.sidebar-resize-handle {
    display: none !important;
}

/* =========================
   DESKTOP (>= 992px)
   ========================= */

@media (min-width: 992px) {
    html,
    body {
        height: 100%;
    }

    body {
        overflow: hidden;
    }

    .doc-layout {
        display: flex;
        width: 100%;
        height: 100vh;
        min-height: 0;
        position: relative;
    }

    .doc-sidebar {
        width: var(--doc-sidebar-width);
        min-width: 260px;
        max-width: 900px;
        flex: 0 0 var(--doc-sidebar-width);
        overflow-y: auto;
        overflow-x: hidden;
        border-right: 1px solid #dee2e6;
        background: #f8f9fa;
        position: relative;
        z-index: 2;
    }

    .doc-content {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        scroll-behavior: smooth;
    }

    .top-anchor {
        left: var(--doc-sidebar-width);
    }

    .sidebar-resize-handle {
        display: block !important;
        position: absolute;
        top: 0;
        bottom: 0;
        left: calc(var(--doc-sidebar-width) - (var(--doc-resize-hitbox) / 2));
        width: var(--doc-resize-hitbox);
        cursor: e-resize;
        z-index: 10;
        background: transparent;
    }

    .sidebar-resize-handle::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 1px;
        background: #ced4da;
    }

    .sidebar-resize-handle:hover,
    .sidebar-resize-handle.is-resizing {
        background: rgba(0, 0, 0, 0.04);
    }
}

/* =========================
   OFFCANVAS
   ========================= */

.offcanvas.offcanvas-start {
    --bs-offcanvas-width: 100vw;
    width: var(--bs-offcanvas-width);
    max-width: 100vw;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .offcanvas.offcanvas-start {
        --bs-offcanvas-width: 600px;
    }
}

@media (max-width: 767.98px) {
    .offcanvas.offcanvas-start {
        --bs-offcanvas-width: 100vw;
    }
}

/* navba search */
.search-input-wrapper {
    position: relative;
}

.search-input {
    padding-right: 2.25rem;
}

.search-input-wrapper::after {
    content: "\f057";
    position: absolute;
    top: 50%;
    right: 0.75rem;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
}

.search-input-wrapper.is-empty::after {
    display: none;
}

/* =========================
   MOBILE NAVIGATION
   ========================= */

@media (max-width: 991.98px) {
    .doc-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(100vw, 600px);
        height: 100vh;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.2s ease-in-out;
        border-right: 1px solid #dee2e6;
    }

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

    body.navigation-open {
        overflow: hidden;
    }
}

@media (max-width: 767.98px) {
    .doc-sidebar {
        width: 100vw;
    }
}

.navigation-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .navigation-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 39;
        display: block;
        opacity: 0;
        visibility: hidden;
        transition:
            opacity 0.2s ease-in-out,
            visibility 0.2s ease-in-out;
    }

    .navigation-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }
}

/* =========================
   TREE
   ========================= */

.tree-nested {
    padding-left: 1rem;
    margin-left: 0.5rem;
    border-left: 1px dashed #d0d7de;
}

.form-control {
    box-shadow: none !important;
}

.folder-button {
    box-shadow: none !important;
    padding: 0.35rem 0.5rem;
    background: transparent;
}

.folder-button:not(.collapsed) {
    background: #eef2f6;
    color: inherit;
}

.folder-label {
    font-weight: 600;
}

.tree-file-link {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #212529;
}

.tree-file-link:hover {
    background: #e9ecef;
}

.small-fqcn {
    font-size: 0.9rem;
    color: #6c757d;
    word-break: break-word;
}

/* =========================
   CONTENT
   ========================= */

.doc-entry + .doc-entry {
    margin-top: 1.5rem;
}

.doc-entry {
    scroll-margin-top: 6rem;
}
@media (max-width: 991.98px) {
    .top-anchor {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 30;
        background: #fff;
    }

    .doc-content {
        padding-top: 0;
    }

    #contentList {
        padding-top: 6rem;
    }
}

@media (max-width: 767.98px) {
    #contentList {
        padding-top: 5.5rem;
    }
    .doc-entry {
        scroll-margin-top: 5.5rem;
    }
}

.method-accordion .accordion-button {
    align-items: center;
}

.method-accordion .accordion-button:not(.collapsed) {
    background: #f8f9fa;
}

.text-preline {
    white-space: pre-line;
}

.muted-empty {
    color: #6c757d;
    font-style: italic;
}

.lt-spading {
    letter-spacing: 2px;
}

.badge {
    text-transform: lowercase;
}

/* =========================
   BOOTSTRAP TWEAKS
   ========================= */

.accordion-button:focus {
    z-index: 3;
    outline: 0;
    box-shadow: none;
}

/* =========================
   FOOTER
   ========================= */
footer {
    z-index: 99;
    bottom: var(--footer-bottom-offset, 0px) !important;
}

.footer-inner {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

html.is-standalone .footer-inner,
html.is-ios .footer-inner {
    padding-bottom: calc(env(safe-area-inset-bottom) / 2) !important;
}