@keyframes open {
    0% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes close {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes opacity {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.settings[data-mobile="true"] {
    flex-direction: column;
    background: var(--primary-header);

    .sidebar,
    .content {
        background: var(--primary-background);
    }

    .sidebar {
        justify-content: flex-start;

        .container {
            padding: 20px 8px;
            min-width: 218px;
        }

        > div {
            width: 100%;
        }

        .version {
            place-items: center;
        }
    }

    .content {
        padding: 10px 12px var(--bottom-navigation-height);
    }
}

.settings:not([data-mobile="true"]) {
    top: 0;
    left: 0;
    z-index: 10;
    width: 100%;
    height: 100%;
    position: fixed;
    animation: open 0.18s ease-out, opacity 0.18s;

    &.closing {
        animation: close 0.18s ease-in;
    }
}

.settings {
    height: 100%;
    display: flex;
    user-select: none;
    flex-direction: row;
    /*justify-content: center;*/
    background: var(--primary-background);

    /* Scrollbox hides the scrollbar on the desktop app. */
    @media (hover: hover) { .scrollbox { visibility: hidden; }}

    .scrollbox {
        overflow-y: scroll;
        visibility: hidden;
        transition: visibility 0.1s;
    }

    .container,
    .contentcontainer,
    .scrollbox:hover,
    .scrollbox:focus {
        visibility: visible;
    }
    
    ::-webkit-scrollbar-thumb {
        background-clip: content-box;
        border-top: 80px solid transparent;
    }

    .sidebar {
        flex: 1 0 218px;
        display: flex;
        flex-shrink: 0;
        overflow-y: scroll;
        justify-content: flex-end;
        background: var(--secondary-background);

        display: flex;
        -webkit-box-flex: 1;
        -webkit-box-pack: end;
        justify-content: flex-end;

        .container {
            width: 218px;
            padding: 80px 8px;
            height: fit-content;
            display: flex;
            gap: 2px;
            flex-direction: column;
            visibility: visible;
        }

        .divider {
            height: 30px;
        }

        .donate {
            color: goldenrod !important;
        }

        .logOut {
            color: var(--error) !important;
        }

        .version {
            margin: 1rem 12px 0;
            font-size: 10px;
            color: var(--secondary-foreground);
            font-family: var(--monospace-font), monospace;
            user-select: text;
            display: grid;

            > div {
                gap: 2px;
                display: flex;
                flex-direction: column;
            }

            .revision a:hover {
                text-decoration: underline;
            }
        }

        scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    }

    .content {
        flex: 1 1 800px;
        display: flex;
        overflow-y: auto;
        overflow-x: hidden;

        .scrollbox {
            display: flex;
            flex-grow: 1;
        }

        .contentcontainer {
            display: flex;
            max-width: 740px;
            padding: 80px 2em;
            visibility: visible;
            flex-direction: column;
            flex-grow: 1;
        }

        details {
            margin: 14px 0;
        }

        h1 {
            margin-top: 0;
            line-height: 1em;
            font-size: 1.2em;
            font-weight: 600;
        }

        h3 {
            font-size: 13px;
            text-transform: uppercase;
            color: var(--secondary-foreground);
        }

        h4 {
            margin: 4px 2px;
            font-size: 13px;

            color: var(--tertiary-foreground);
            text-transform: uppercase;
        }

        h5 {
            margin-top: 0;
            font-size: 12px;
            font-weight: 400;
        }

        .footer {
            border-top: 1px solid;
            margin: 0;
            padding-top: 5px;
            font-size: 14px;
            color: var(--secondary-foreground);
        }
    }

    .closeButton {
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        height: 40px;
        width: 40px;
        border: 3px solid var(--tertiary-background);
        cursor: pointer;
        visibility: visible;
        position: sticky;
        top: 80px;

        svg {
            color: var(--secondary-foreground);
        }

        &:hover {
            background: var(--secondary-header);
        }

        &:active {
            transform: translateY(2px);
        }
    }

    /*.action {
        flex: 1;
        flex-shrink: 0;
        padding: 80px 8px;
        color: var(--tertiary-background);
        visibility: visible;
        position: sticky;
        top: 0;

        &:after {
            content: "ESC";
            margin-top: 4px;
            display: flex;
            text-align: center;
            align-content: center;
            justify-content: center;
            position: relative;
            color: var(--foreground);
            width: 40px;
            opacity: 0.5;
            font-size: 0.75em;
        }

        .closeButton {
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            height: 40px;
            width: 40px;
            border: 3px solid var(--tertiary-background);
            cursor: pointer;
            visibility: visible;

            svg {
                color: var(--secondary-foreground);
            }

            &:hover {
                background: var(--secondary-header);
            }

            &:active {
                transform: translateY(2px);
            }
        }

        > div {
            display: inline;
        }
    }*/

    section {
        margin-bottom: 1em;
    }
}

.loader {
    > div {
        margin: auto;
    }
}