/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */

/* ========================================================================
   Use this file to add custom CSS for api documentation page
 ========================================================================== */

html {
    background: #fff;
}

span.highlight {
    background: #E5EBDC;
    padding: 4px 5px;
    border-radius: 5px;
}

span.search-highlight {
    background: #3a9746;
    color: #fff;
    padding: 3px 5px;
    border-radius: 5px;
}

.tm-api-wrapper {
    height: auto;
    min-height: 100vh;
    width: 100%;
    position: relative;
    -webkit-font-smoothing: subpixel-antialiased;
    overflow: hidden;
}

.tm-api-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    background: #1C2222;

    .tm-api-sidebar-inner {
        height: 100vh;
        overflow-y: auto;

        &::-webkit-scrollbar { width: 4px }

        &::-webkit-scrollbar-track { background-color: transparent }

        &::-webkit-scrollbar-thumb {
            background-color: #535D78;
            border-radius: 5px;
        }

        .tm-top {
            flex: 1 0 auto;
        }

        .tm-bottom {
            flex-shrink: 0;
        }

        .tm-footer-certificate {
            padding: 24px 16px 0 16px;

            .custom-html-widget {
                overflow: hidden;
            }

            img {
                max-width: 110px;
            }

            a.uk-width-small {
                position: relative;

                span {
                    color: #fff;
                    position: absolute;
                    top: -4px;
                    left: 2px;
                    font-size: 10px;
                    font-weight: 600;
                }
            }
        }

        .tm-copyrights {
            font-size: 12px;
            color: #f5f7f1;
            padding: 16px;

            p {
                margin: 0;
            }
        }

        a.tm-logo {
            display: block;
            padding: 16px;
            text-align: center;
        }
    }
}

.tm-api-content {
    margin-left: 260px;
    height: 100%;
    padding-left: 24px;

    .tm-api-content-inner {
        padding: 16px 0;
        position: relative;
        overflow: hidden;

        .wpb-content-wrapper {
            > .vc_row:first-child {
                .vc_col-sm-4 {
                    > * > * {
                        position: relative;

                        &:before {
                            content: '';
                            top: -16px;
                            right: 0;
                            position: absolute;
                            z-index: -1;
                            background: #E5EBDC;
                            height: 100%;
                            min-height: 1000000px;
                            width: 100%;
                        }
                    }
                }
            }

            .vc_col-sm-4 {
                h4, .uk-h4 {
                    margin-bottom: 0 !important;
                    background: #F5F7F1;
                    padding: 12px 0 15px 15px;

                    &.tm-toggle-title {
                        cursor: pointer;
                        position: relative;
                        padding-left: 46px;

                        &:before {
                            content: '';
                            position: absolute;
                            top: 50%;
                            margin-top: -12px;
                            left: 15px;
                            width: 24px;
                            height: 24px;
                            background: #1c2222 url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjUgMTdhLjk5OS45OTkgMCAwIDEtLjcwNy0xLjcwN2wzLjMwNS0zLjMwNS0zLjE4LTMuMjkzYTEgMSAwIDAgMSAxLjQzOS0xLjM5bDMuODYyIDRhMSAxIDAgMCAxLS4wMTIgMS40MDJsLTQgNEExIDEgMCAwIDEgMTAuNSAxNyIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==") 50% 50% no-repeat;
                            border-radius: 4px;
                        }
                    }

                    + pre {
                        margin-top: 0;

                        code { padding-top: 0 }
                    }
                }
            }

            .uk-table {
                th {
                    text-transform: none;
                    font-weight: bold;
                    color: #41A94F;
                    font-size: inherit;
                    white-space: nowrap;
                }

                tr.group-header {
                    background: #41A94F;
                    color: #fff;
                    cursor: pointer;
                    font-weight: bold;
                }
            }
        }
    }
}

body.admin-bar {

    .tm-api-wrapper {
        .tm-api-sidebar-inner {
            height: calc(100vh - 32px);
        }
    }

    .tm-api-sidebar {
        min-height: calc(100vh - 32px);
        top: 32px;
    }
}

/*
 * Search
 */

.tm-search-panel {
    border-top: 1px solid #535D78;
    padding: 16px;

    input[type="search"]::-webkit-search-cancel-button,
    input[type="search"]::-webkit-search-decoration {
        -webkit-appearance: none;
        appearance: none;
    }

    input[type="search"] {
        appearance: textfield;
    }

    input[type="search"]::-webkit-search-results-button {
        display: none;
    }

    input#tm-input-search {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #535D78;
        line-height: 36px;
        height: 40px;
        background: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNy45MTcgMTMuMzMzcS0yLjI3IDAtMy44NDQtMS41NzNRMi41MDEgMTAuMTg3IDIuNSA3LjkxN3QxLjU3My0zLjg0NFQ3LjkxNyAyLjV0My44NDQgMS41NzMgMS41NzIgMy44NDRhNS4wOCA1LjA4IDAgMCAxLTEuMDgzIDMuMTY2bDQuNjY3IDQuNjY3YS44LjggMCAwIDEgLjIyOS41ODMuOC44IDAgMCAxLS4yMy41ODQuOC44IDAgMCAxLS41ODMuMjI5LjguOCAwIDAgMS0uNTgzLS4yM2wtNC42NjctNC42NjZhNS4wOCA1LjA4IDAgMCAxLTMuMTY3IDEuMDgzbTAtMS42NjZxMS41NjIgMCAyLjY1Ni0xLjA5NCAxLjA5NS0xLjA5MyAxLjA5NC0yLjY1NlQxMC41NzMgNS4yNlE5LjQ4IDQuMTY4IDcuOTE3IDQuMTY3VDUuMjYgNS4yNiA0LjE2NyA3LjkxN3EtLjAwMyAxLjU2IDEuMDk0IDIuNjU2dDIuNjU2IDEuMDk0IiBmaWxsPSIjOGY5YmIzIi8+PC9zdmc+") 12px 50% no-repeat;
        border-radius: 4px;
        font-family: inherit;
        font-size: 14px;
        color: #fff;
        padding: 0 8px 0 40px;
        -webkit-appearance: none;
        appearance: none;

        &::placeholder { color: #8F9BB3; }
    }

    .tm-search-results {
        display: none;
        color: #fff;
        margin: 16px 0 0 0;
        padding: 0;
        list-style: none;
        font-size: 14px;
        max-height: 194px;
        overflow-y: auto;

        &::-webkit-scrollbar { width: 4px }

        &::-webkit-scrollbar-track { background-color: transparent }

        &::-webkit-scrollbar-thumb {
            background-color: #535D78;
            border-radius: 5px;
        }

        &.uk-visible { display: block; }

        a {
            display: block;
            padding: 6px 0;
            color: #fff;
            transition: all .3s ease-in-out;

            &:hover {
                text-decoration: none;
                color: #41A94F;
            }
        }
    }
}

/*
 * Navigation
 */

#tm-toc {
    border-top: 1px solid #535D78;
    padding: 8px 16px;

    ul.tm-toc-level-1 {
        margin: 0;
        padding: 0;
        list-style: none;

        li {
            a {
                position: relative;
                display: block;
                font-weight: 600;
                font-size: 16px;
                padding: 8px 8px 8px 0;
                transition: all .3s ease-in-out;

                &:before {
                    content: '';
                    position: absolute;
                    background: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjUgMTdhLjk5OS45OTkgMCAwIDEtLjcwNy0xLjcwN2wzLjMwNS0zLjMwNS0zLjE4LTMuMjkzYTEgMSAwIDAgMSAxLjQzOS0xLjM5bDMuODYyIDRhMSAxIDAgMCAxLS4wMTIgMS40MDJsLTQgNEExIDEgMCAwIDEgMTAuNSAxNyIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==") 50% 50% no-repeat;
                    width: 24px;
                    height: 24px;
                    top: 50%;
                    margin-top: -12px;
                    right: -6px;
                    transition: all .3s ease-in-out;
                    opacity: 0;
                }

                &:hover {
                    text-decoration: none;
                    color: #E5EBDC;
                }
            }

            &.uk-active > a {
                color: #E5EBDC;

                &:before { opacity: 1 }
            }
        }

        li.tm-toc-h2 {
            > a {
                color: #fff;
            }

            ul.tm-toc-level-2 {
                margin: 0;
                padding: 0;
                list-style: none;
                display: none;

                > li {
                    > a {

                    }

                    &.uk-active > a {

                    }

                    &.uk-active,
                    &:has(li.uk-active) {

                        ul.tm-toc-level-3 {
                            display: block;
                        }
                    }
                }
            }

            ul.tm-toc-level-3 {
                margin: 0;
                padding: 0 0 0 16px;
                list-style: none;
                display: none;

                > li {
                    > a {
                        padding-top: 4px;
                        padding-bottom: 4px;
                        font-weight: 500;
                        font-size: 14px;
                    }

                    &.uk-active > a {

                    }
                }
            }

            &.uk-active,
            &:has(li.uk-active) {

                ul.tm-toc-level-2 {
                    display: block;
                }
            }
        }
    }
}

/*
 * Code style
 */

pre.theme-atom-one-light {
    padding: 0;
    border: none;
    background: none;
}

pre code.hljs {
    display: block;
    overflow-x: auto;
    padding: 1em 15px;
    background: #F5F7F1;
}
code.hljs {
    padding: 3px 5px
}
/*

Atom One Light by Daniel Gamage
Original One Light Syntax theme from https://github.com/atom/one-light-syntax

base:    #fafafa
mono-1:  #383a42
mono-2:  #686b77
mono-3:  #a0a1a7
hue-1:   #0184bb
hue-2:   #4078f2
hue-3:   #a626a4
hue-4:   #50a14f
hue-5:   #e45649
hue-5-2: #c91243
hue-6:   #986801
hue-6-2: #c18401

*/
.hljs {
    color: #383a42;
    background: #fafafa
}
.hljs-comment,
.hljs-quote {
    color: #a0a1a7;
    font-style: italic
}
.hljs-doctag,
.hljs-keyword,
.hljs-formula {
    color: #a626a4
}
.hljs-section,
.hljs-name,
.hljs-selector-tag,
.hljs-deletion,
.hljs-subst {
    color: #e45649
}
.hljs-literal {
    color: #0184bb
}
.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta .hljs-string {
    color: #50a14f
}
.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-number {
    color: #986801
}
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
    color: #4078f2
}
.hljs-built_in,
.hljs-title.class_,
.hljs-class .hljs-title {
    color: #c18401
}
.hljs-emphasis {
    font-style: italic
}
.hljs-strong {
    font-weight: bold
}
.hljs-link {
    text-decoration: underline
}

@media (min-width: 960px) {
    .tm-api-content-inner h2, .tm-api-content-inner .uk-h2 {
        font-size: 40px;
        padding-bottom: 20px;
        border-bottom: 2px solid #d9e1e7;
    }
}

@media (max-width: 960px) {
    .tm-api-sidebar { display: none }

    .tm-api-content {
        margin-left: 0;
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 768px) {
    .tm-api-content {
        & .tm-api-content-inner {
            & .wpb-content-wrapper {
                & > .vc_row:first-child {
                    & .vc_col-sm-4 {

                        & > * > * {

                            &:before {
                                display: none;
                            }
                        }
                    }
                }
            }
        }
    }

    .vc_col-sm-4 .wpb_wrapper .tm-code-snippet:last-child {
        margin-bottom: 60px;
    }

    .tm-custom-table .uk-table {
        font-size: 12px;
    }
}
