@import url(colors.css);

:root {
    --category-transition: text-indent 0.1s ease, background-color 0.1s ease;
    --sidebar-width: 320px;
}

body {
    overflow-x: hidden;
}

.docs {
    display: flex;
    flex-direction: row !important;
    max-width: none !important;
    gap: 10px;

    box-sizing: border-box;
    padding: 20px;
    margin-left: calc(var(--sidebar-width) + 0px);

    margin-bottom: 3%;

    border: 2px solid var(--accent2-color);
    border-right: none; /* Removes the right border to not have it there since it's the edge of the display window */
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

main {
    background-color: var(--accent-color);
}

#doc-container {
    order: 1;
    width: 100%;
}

#doc-sidebar {
    position: fixed;

    padding: 0px;
    width: 100%;
    max-width: var(--sidebar-width);
    height: max-content;
    
    max-height: calc(100vh - 80px) !important;
    overflow-x: hidden;
    overflow-y: auto;
    
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    
    gap: 10px;
    
    /* background-color: var(--accent-color); */
    
    box-sizing: border-box;

    border-radius: 0px var(--border-radius) var(--border-radius) 0px;
    border: 2px solid var(--highlight-active-color);
    border-left: none; /* Removes the left border to not have it there since it's the edge of the display window */

    box-shadow: 0 5px 10px var(--transparent-white);
}

hr {
    width: 100%;
    height: 2px;
    background-color: var(--accent2-color);
    margin: 0 auto;
}

#doc-sidebar hr {
    margin: 0 0 10px 0;
    background: var(--highlight-inactive-color);
}

#doc-sidebar h1, #doc-sidebar h2, #doc-sidebar h3, #doc-sidebar h4, #doc-sidebar h5, #doc-sidebar h6 {
    text-align: left;
    text-indent: 8px;
    margin: 10px 0;
}

h2 {
    text-indent: 0px;
}

.sidebar-background {
    position: absolute;
    width: 100%;
    height: 5em;
    filter: blur(25px);
    opacity: 0.1;

    z-index: -1;
    background-color: var(--transparent-white);
}

#doc-sidebar a {
    transition: var(--category-transition);

    height: 24px;
    margin-left: 32px;
    display: flex;
    align-items: center;
    justify-content: left;
    text-align: left;
    font-family: var(--font-family);
    text-decoration: none;
    text-indent: 4pt;
    color: var(--text-color);

    /* background-color: var(--secondary-color); */
}

#doc-sidebar a:nth-child(even) {
    background-color: var(--highlight-inactive-color);
}

#doc-sidebar a:hover, #doc-sidebar a[selected] {
    transition: var(--category-transition);

    background-color: var(--highlight-active-color);
    text-indent: 8pt;
}

.doc-sidebar-category {
    text-align: center;
    width: 100%;
    height: 100%;
    margin-bottom: 8px;
}

.doc-img {
    justify-self: center;
    align-self: center;
    border-radius: 0px;
    margin: 15px;
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;

    cursor: zoom-in;
}

.docs-top {
    display: flex;
    justify-content: center;
}

.docs-top-inner {
    width: 100%;
}

summary::marker {
    display: none;
}

details summary {
    transition: 0.5s ease-in-out;
    margin-left: 16px;
    height: 24px;
    font-size: 12pt;
    font-weight: bold;
    
    display: flex;
    justify-content: left;
    align-items: center;
    cursor: pointer;
    list-style-type: none;

    user-select: none;

    background-color: var(--highlight-inactive-color);
    border: 2px solid var(--highlight-active-color);
    
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    border-right: none;
}

details:open summary {
    transition: 0.5s ease-in-out;
    background-color: var(--highlight-inactive-color);
    border: 2px solid var(--highlight-active-color);
    border-right: none;
    height: 36px;
}

/* ============================ */

details summary::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: 0 3px;

    /* absolutely horrendous way of rendering svg but whatever, thanks chatGPT you were helpfull for -1s overall during this operation */
    background: url('data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> <polyline points="10,6 22,16 10,26" style="stroke:%23E7D9D0; stroke-width:8; fill:none; stroke-linecap:round; stroke-linejoin:round;"/> </svg>') no-repeat center/contain;

    transition: transform 0.25s ease;
}

details[open] summary::before {
    transform: rotate(90deg);
}


/* ============================ */
details:open *{
    border-left: 2px solid var(--highlight-active-color);
    border-bottom: 2px solid var(--highlight-active-color);
}

details:open *:last-child{
    border-bottom-left-radius: var(--border-radius);
}

details summary:active {
    background-color: var(--highlight-active-color);
}

details:open summary:hover, summary:hover {
    transition: background-color .3s ease-in-out,
                border-color .3s ease-in-out,
                height .5s;
    background-color: var(--highlight-active-color);
    border-color: var(--highlight-inactive-color);
}

#doc-sidebar a::before {
    content: '';
    background-image: var(--barrelspin-url);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 16px;
    height: 16px;
    margin-right: 0px;
    display: inline-block;
}

version::before {
    content: "DOC VERSION: ";
}

gversion {
    color: var(--accent2-color);
}

#doc-container {
    transition: filter 0.25s;
    filter: blur(0px);
}

#doc-container.loading, .loading {
    transition: filter 0.1s;
    filter: blur(15px);
}

code {
    overflow-x: auto;
    overflow-y: auto;

    max-height: 480px;
}

p {
    margin: 4px 0px 4px 0px;
}

strong {
    margin-top: 16px;
    margin-bottom: 8px;
}

.hljs {
    background-color: var(--secondary-color) !important;
}

#sidebar-collapse {
    display: none;
}

@media screen and (max-width: 768px) {
    #doc-sidebar {
        position: fixed;
        top: 80px;
        margin: 0;
        max-width: 100%;
        max-height: 100vh;
        z-index: 1;
        background-color: var(--secondary-color);
    }

    #sidebar-collapse {
        position: fixed;
        display: block;
        top: 40px;
        margin-top: 0px;
        z-index: 1;
    }

    #doc-sidebar[collapsed = "true"] {
        display: none;
    }

    .docs[hide = "true"] {
        display: none;
    }

    body[hide-scroll = "true"] {
        overflow-y: hidden;
    }

    .docs {
        margin: 0;
    }

    .docs-top-inner {
        display: flex;
        flex-direction: column;
    }
}