html {
    height: 100%;
}

body {
    background-color: var(--background-color);
    color: var(--color);
    font-family: var(--font-family);
    height: 100%;
    line-height: 1.4;
}

a {
    border: 0;
    color: var(--link-color);
    font-weight: 400;
    outline: none;
    text-decoration: none;

    &:not([href]):not([tabindex]):focus,
    &:not([href]):not([tabindex]):hover {
        color: inherit;
        text-decoration: none;
    }

    &:focus {
        outline-color: var(--focus-border-color);
    }
}

b {
    font-weight: 600;
}

code,
.shortcut-key {
    border-radius: 4px;
    color: var(--color);
    padding: 2px 6px 0 6px;
    vertical-align: baseline;

    .vscode-dark & {
        background-color: var(--background-color--lighten-15);
        border-bottom: 2px solid var(--background-color--lighten-15);
    }

    .vscode-light & {
        background-color: var(--background-color--darken-15);
        border-bottom: 2px solid var(--background-color--darken-15);
    }
}

.setting-key {
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
    padding: 1px 5px;
    vertical-align: text-top;

    .vscode-dark & {
        background-color: var(--background-color--lighten-15);
        border-bottom: 2px solid var(--background-color--lighten-15);
    }

    .vscode-light & {
        background-color: var(--background-color--darken-15);
        border-bottom: 2px solid var(--background-color--darken-15);
    }
}

h1 {
    border: none;
    font-size: 2.77em;
    font-weight: 400;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

h2 {
    font-size: 1.5em;
    font-weight: 200;
    line-height: normal;
    margin: 1em 0 0.3em 0;
    white-space: nowrap;
}

h3 {
    font-size: 1.17em;
    font-weight: 200;
    line-height: normal;
    margin: 1em 0 0.3em 0;
    white-space: nowrap;
}

header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1em;
}

input,
select,
button {
    font-family: var(--font-family);
    font-size: inherit;
    margin: 0;
}

input[type='checkbox'] {
    background: none;
    border: none;
    cursor: pointer;
    margin: 0;
    padding: 0 10px;

    &:focus {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 5px;
        outline: none;
    }

    &[disabled] {
        color: var(--color--75);
        cursor: default;
    }
}

input[type='text'],
input:not([type]) {
    background: none;
    color: var(--color);
    margin: 0 0.75em;
    max-width: 300px;
    padding: 4px;
    width: 100%;

    .vscode-light & {
        border: 1px solid rgba(0, 0, 0, 0.3);
    }

    .vscode-dark & {
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    &:focus {
        outline-color: var(--focus-border-color);

        .vscode-light & {
            background-color: rgba(255, 255, 255, 0.4);
        }

        .vscode-dark & {
            background-color: rgba(0, 0, 0, 0.2);
        }
    }

    &[disabled] {
        color: var(--color--75);
        cursor: default;
    }

    &::placeholder {
        color: var(--vscode-input-placeholderForeground);
    }
}

label {
    cursor: pointer;
}

section {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1em;
    padding: 1rem;

    .vscode-light & {
        background-color: var(--background-color--darken-05);
    }

    .vscode-dark & {
        background-color: var(--background-color--lighten-05);
    }
}

select {
    background: none;
    color: var(--color);
    cursor: pointer;
    margin: 0 0.75em;
    padding: 2px;

    .vscode-light & {
        border: 1px solid rgba(0, 0, 0, 0.3);
    }

    .vscode-dark & {
        border: 1px solid rgba(255, 255, 255, 0.3);
    }

    &:focus {
        outline-color: var(--focus-border-color);
        .vscode-light & {
            background-color: rgba(255, 255, 255, 0.4);
        }

        .vscode-dark & {
            background-color: rgba(0, 0, 0, 0.2);
        }
    }

    &[disabled] {
        color: var(--color--75);
        cursor: default;
    }
}

select option {
    .vscode-light & {
        background-color: var(--background-color--darken-05);
    }

    .vscode-dark & {
        background-color: var(--background-color--lighten-05);
    }

    &:focus {
        outline-color: var(--focus-border-color);
        .vscode-light & {
            background-color: rgba(255, 255, 255, 0.4);
        }

        .vscode-dark & {
            background-color: rgba(0, 0, 0, 0.2);
        }
    }
}

ul {
    font-size: 1em;
    list-style: none;
    margin: 0;
    padding: 0;
}

.button {
    background: none;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: inline-block;
    font-size: 0.8em;
    letter-spacing: 0.25em;
    margin: 1em 0.5em;
    padding: 1em 1.75em;
    text-decoration: none;
    text-transform: uppercase;
    user-select: none;
    white-space: nowrap;

    &:focus {
        outline: none;
    }
}

.button--big {
    font-size: 1.25em;
}

.button--flat {
    .vscode-light & {
        border: 1px solid rgba(0, 0, 0, 0.6);
        color: black;
    }
    .vscode-dark & {
        border: 1px solid rgba(255, 255, 255, 0.6);
        color: white !important;
    }
    transition: background-color 250ms, border-color 250ms, color 250ms;

    &:hover {
        .vscode-light & {
            background-color: var(--button-background-color--darken-30);
            border-color: var(--button-background-color--darken-30);
            color: white !important;
        }
        .vscode-dark & {
            background-color: white;
            border-color: white;
            color: black !important;
        }
    }

    .preload & {
        transition-duration: 0s !important;
    }
}

.button--flat-inverse {
    background-color: white;
    border: 1px solid white;
    color: black !important;
    font-weight: 600;
    transition: background-color 250ms, border-color 250ms, color 250ms;

    &:hover {
        background: rgba(0, 0, 0, 0.2);
        border-color: rgba(255, 255, 255, 0.6);
        color: white !important;
    }

    .preload & {
        transition-duration: 0s !important;
    }
}

.button--flat-primary {
    background-color: var(--button-background-color);
    border: 1px solid var(--button-background-color);
    color: var(--button-color) !important;
    font-weight: 600;
    transition: background-color 250ms, border-color 250ms, color 250ms;

    &:hover {
        .vscode-light & {
            background-color: var(--button-background-color--darken-30);
            border-color: var(--button-background-color--darken-30);
            color: white !important;
        }
        .vscode-dark & {
            background-color: white;
            border-color: white;
            color: black !important;
        }
    }

    .preload & {
        transition-duration: 0s !important;
    }
}

.button-group {
    display: flex;
    flex-wrap: wrap;

    & .button {
        white-space: nowrap;
    }
}

.button-group--support-gitlens {
    justify-content: center;
    margin: 1.5em 0 1em 0;

    & .button {
        margin-left: 1.5em;
        margin-right: 1.5em;
        white-space: nowrap;
    }
}

.button-group--support-gitlens-sidebar {
    font-size: 0.8em;

    & .button {
        font-weight: 400;
        margin: 0.75em 0;
    }
}

.changelog {
    border-radius: 1em;
    margin: 2em 4em 2em 2em;

    .vscode-light & {
        background-color: var(--background-color--darken-05);
        box-shadow: inset 0 0 6px 0px rgba(0, 0, 0, 0.05);
    }

    .vscode-dark & {
        background-color: var(--background-color--lighten-075);
        box-shadow: inset 0 0 6px 0px rgba(255, 255, 255, 0.075);
    }
}

.changelog__badge {
    background-color: #0366d6;
    border-radius: 3px;
    box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.5);
    color: #e6e6e6;
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    margin-right: 1.25em;
    padding: 2px 5px;
    text-align: center;
    text-transform: uppercase;
    vertical-align: text-top;
    width: 65px;
}

.changelog__badge--added {
    background-color: #28a745;
}

.changelog__badge--changed,
.changelog__badge--fixed {
    background-color: #0366d6;
}

.changelog__badge--version {
    background-color: #914db3;
    font-size: 15px;
}

.changelog__date {
    font-size: 0.8em;
    font-variant: small-caps;
    font-weight: 600;
    margin-left: -7px;
    opacity: 0.9;
    vertical-align: middle;
}

.changelog__details {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 0 7em;
    position: relative;

    &:before {
        border-left: 1px solid rgba(122, 122, 122, 0.15);
        content: ' ';
        height: calc(100% + 7px);
        left: 37px;
        position: absolute;
        top: 1px;
    }
}

.changelog__details--list {
    flex-direction: column;

    & p {
        margin-bottom: 0;
    }

    & p:last-child {
        margin-bottom: 1em;
    }
}

.changelog__hint {
    color: var(--color--75);
    font-weight: 200;
    margin: 1em;
}

.changelog__image {
    margin: 1em 0;
    max-width: 65%;
}

.changelog__list {
    flex: 100% 0 1;
    font-size: 1.2em;
    font-weight: 200;
    line-height: 1.7;
    list-style-type: none;
    margin: 1em;

    & li {
        margin-bottom: 0.5em;
    }

    & code {
        font-size: 0.8em;
    }
}

.changelog__list-item--version {
    margin: 2em 0 0.5em 0;
    padding-top: 2em;

    .vscode-dark & {
        border-top: 1px solid var(--background-color--lighten-30);
    }

    .vscode-light & {
        border-top: 1px solid var(--background-color--darken-30);
    }
}

.changelog__scroller {
    flex: 100% 0 0;
    margin: 1.5em 0 0 0;
    max-height: 400px;
    overflow-y: auto;

    .vscode-dark & {
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .vscode-light & {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
}

.changelog__title {
    flex: 100% 0 0;
    text-align: center;
}

.changelog__version {
    background-color: #914db3;
    border-bottom: 2px solid #914db3;
    border-radius: 3px;
    color: #f2f2f2;
    margin: 0 0.25em;
    padding: 2px 10px;
    text-align: center;
    vertical-align: bottom;
}

.command {
    font-weight: 600;
    padding: 1px 3px;
}

.container {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100%;
    min-width: 100%;
}

.content {
    margin-top: 3em;
    max-width: 1200px;
    min-width: 450px;
    width: 90%;
}

.cta__container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 3em;

    & p {
        margin-top: -1em;
        opacity: 0.6;
    }
}

.cta__primary {
    margin: 0 1em;
}

.cta__secondary {
    margin: 0 1em;
}

.section-list {
    font-weight: 200;
    list-style: disc;
    margin: 0 0 2em 2em;

    & li {
        margin-bottom: 0.5em;
    }
}

.header__blurb {
    color: var(--color--75);
    flex: 55% 2 1;
    font-size: 1.2em;
    font-weight: 200;
    margin: -1em 0 0 6em;
    min-width: 345px;

    @media all and (max-width: 880px) {
        margin: 0 2em;
    }
}

.header__link {
    color: var(--color);
    outline: none;

    &:hover,
    &:active,
    &:focus {
        color: var(--color);
        outline: none;
    }
}

.header__logo {
    display: flex;
    flex-wrap: nowrap;
}

.header__subtitle {
    color: var(--color--50);
    display: block;
    font-size: 2em;
    font-weight: 100;
    margin-top: -0.2em;
    white-space: nowrap;
}

.icon {
    background-color: var(--color);
    display: inline-block;
    height: 24px;
    margin-bottom: -9px;
    width: 19px;
}

.icon__info {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 125"><path fill="none" d="M0 0h100v100H0z"/><path d="M50 21a29 29 0 1 0 29 29 29 29 0 0 0-29-29zm0 55a26 26 0 1 1 26-26 26 26 0 0 1-26 26z"/><path d="M48 45l-1 1v18l1 1h4l1-1V46l-1-1zm0-10l-1 1v4l1 1h4l1-1v-4l-1-1z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 125"><path fill="none" d="M0 0h100v100H0z"/><path d="M50 21a29 29 0 1 0 29 29 29 29 0 0 0-29-29zm0 55a26 26 0 1 1 26-26 26 26 0 0 1-26 26z"/><path d="M48 45l-1 1v18l1 1h4l1-1V46l-1-1zm0-10l-1 1v4l1 1h4l1-1v-4l-1-1z"/></svg>');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.icon--lg {
    height: 36px;
    margin-bottom: -16px;
    width: 30px;
}

.image__logo {
    margin: 9px 1em 0 0;
    max-height: 64px;
    max-width: 64px;
}

.image__preview {
    border-radius: 8px;
    box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.8), 0px 0px 12px 1px rgba(0, 0, 0, 0.5);
}

.image__preview--overlay {
    left: 0;
    position: absolute;
    top: 0;
}

.label__hint {
    color: var(--color--75);
    display: block;
    font-weight: 200;
    margin: 1em 2em;
}

.list-button {
    border: none;
    color: var(--color);
    cursor: pointer;
    font-size: 1em;
    height: 5em;
    margin: 5px 1px;
    max-width: 475px;
    padding: 12px 10px;
    text-align: left;
    width: calc(100% - 2px);

    .vscode-light & {
        background-color: var(--background-color--darken-05);
    }

    .vscode-dark & {
        background-color: var(--background-color--lighten-05);
    }

    &:hover,
    &:focus {
        .vscode-light & {
            background-color: var(--background-color--darken-075);
        }

        .vscode-dark & {
            background-color: var(--background-color--lighten-075);
        }
    }

    &:focus {
        outline: 0;

        .vscode-light & {
            border: 1px solid var(--background-color--darken-15);
        }

        .vscode-dark & {
            border: 1px solid var(--background-color--lighten-15);
        }
    }
}

.list-button__title {
    font-size: 1em;
    font-weight: 400;
    margin: 0;
    margin-bottom: 0.25em;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-button__detail {
    color: var(--color--75);
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.page-header {
    margin: 1em 0 2em 0;
    position: relative;
}

.page-header--sticky {
    background: var(--background-color);
    margin: 1em 0 1em 0;
    padding-bottom: 1em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.page-header__row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.page-header__title {
    flex: 0 0 auto;
    font-size: 3em;
    margin: 0;
}

.page-header__title-actions {
    flex: 0 0 auto;
    margin: 1.75em 1em 0 1em;
}

.page-header__toolbar {
    display: flex;
    flex: 1 1 100%;
    justify-content: flex-end;
    margin: 1.5em 208px 0 0; // 208px ~ the width of the sidebar
    white-space: nowrap;

    @media all and (max-width: 860px) {
        margin-right: -9px;
    }

    select,
    option {
        background-color: var(--background-color) !important;
    }
}

.page-header__subtitle {
    color: var(--color--75);
    margin: 0.25em 0 0 0;
}

.section__preview {
    flex: 30% 1 1;
    margin-left: 2em;
    min-width: 400px;
    position: relative;
}

.section__settings {
    display: flex;
    flex: 100% 1 0;
    flex-wrap: wrap;
    margin-right: 1em;
}

.section__settings--multi {
    & > .settings-group {
        flex-basis: 100%;
        margin-left: 1em;
    }
}

.section__header {
    align-items: baseline;
    cursor: pointer;
    display: flex;
    flex: 100% 0 0;
    flex-wrap: wrap;
    margin-bottom: 2em;

    position: relative;

    &:after {
        background-color: var(--color--75);
        content: '';
        height: 40px;
        -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 125"><path d="M50 62a3 3 0 0 1-2-1L26 44a3 3 0 0 1 3-5l21 16 21-16a3 3 0 1 1 3 5L52 61a3 3 0 0 1-2 1z"/></svg>');
        mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 125"><path d="M50 62a3 3 0 0 1-2-1L26 44a3 3 0 0 1 3-5l21 16 21-16a3 3 0 1 1 3 5L52 61a3 3 0 0 1-2 1z"/></svg>');
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: 32px 40px;
        mask-size: 32px 40px;
        position: absolute;
        right: 0;
        top: 0;
        transition: transform 500ms cubic-bezier(0, 1.5, 1, 1);
        width: 32px;
    }

    &.collapsed {
        margin-bottom: 0;

        &:after {
            transform: rotateX(180deg);
        }

        & + .section__settings {
            display: none;
        }
    }
}

.section__title {
    flex: 100% 1 0;
    margin: 0;
}

.section__title-hint {
    color: var(--color--75);
    font-weight: 200;
    margin: 0.25em 0;
}

.section-group__content {
    flex: auto 1 1;
    margin-bottom: 50%;
    min-width: 0;
}

.section-group__sidebar {
    align-self: flex-start;
    margin: -6.4em 0 0 3em;
    max-width: 179px;
    position: sticky;
    top: 0;
    z-index: 2;

    li {
        white-space: nowrap;
    }
}

.section-group__sidebar--settings {
    @media all and (max-width: 860px) {
        display: none;
    }
}

.section-group__sidebar--welcome {
    margin-right: 3em;

    @media all and (max-width: 560px) {
        display: none;
    }
}

.section-group-section {
    p {
        font-size: 1.1em;
        font-weight: 200;
        margin: 1em 0.25em;
    }
}

.section-group-section__cols {
    display: flex;
    flex-wrap: wrap;
}

.section-group-section__col {
    flex: 45% 1 1;
    margin: 0 4px;
    min-width: 300px;
}

.section-groups {
    display: flex;
    justify-content: space-around;
    margin-top: -1em;
}

.settings-group {
    flex: 2 1;
    margin-bottom: 1em;
    min-width: 300px;
}

.settings-group__header {
    font-size: 1.2em;
    margin: 1em 0 1.5em 0;

    &:first-child {
        margin-top: 0;
    }
}

.settings-group__header-hint {
    color: var(--color--75);
    font-weight: 200;
    margin-top: -1em;
}

.settings-group__hint {
    color: var(--color--75);
    font-weight: 200;
    margin-left: 2.3em;
    text-indent: -2.75em;
}

.settings-group__hint--more {
    display: block;
    margin-top: 0.5em;
    text-indent: initial;
}

.settings-group__setting {
    align-items: baseline;
    display: flex;
    flex: 100% 1 1;
    flex-wrap: wrap;
    margin-bottom: 0.75em;
    position: relative;

    & input[type='checkbox'] {
        flex: 16px 0 0;
        height: 16px;
        margin: 0 0.75em 0 0;
        position: relative;
        top: 3px;
        width: 16px;
    }

    & label {
        flex: auto 0 1;
        margin-bottom: 0.75em;
    }

    &[disabled] {
        label {
            color: var(--color--75);
            cursor: default;
        }
    }
}

.setting__hint {
    color: var(--color--50);
    font-size: 0.9em;
    margin: -1em 0 1em 1em;
}

.settings-scope {
    flex: 0 0 auto;
}

.sidebar-group {
    margin-top: 1em;
}

.bold {
    font-weight: 600;
}

.center {
    text-align: center;
}

.hidden {
    display: none !important;
}

.mb-2 {
    margin-bottom: 2em !important;
}

.ml-1 {
    margin-left: 1em;
}

.ml-2 {
    margin-left: 2em;
}

.ml-3 {
    margin-left: 3em;
}

.ml-4 {
    margin-left: 4em;
}

.non-interactive {
    cursor: default !important;
}

.nowrap {
    flex-wrap: nowrap !important;
}

@import 'popup';
