@mixin user-select($select) {
	-webkit-user-select: $select;
	-khtml-user-drag: $select;
	-khtml-user-select: $select;
	-moz-user-select: $select;
	@if $select == none { -moz-user-select: -moz-none; }
	-ms-user-select: $select;
	user-select: $select;
}

* {
    @include user-select(none);
}

input, textarea {
    @include user-select(text);
}

body {
    margin: 0;
}

#app {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;

    > * {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
    }
}

.stretched {
    flex-grow: 1;
}

.container {
    display: flex;
    box-sizing: border-box;

    &.direction-horizontal {
        flex-direction: row;
    }

    &.direction-vertical {
        flex-direction: column;
    }

    &.position-start {
        justify-content: flex-start;
    }

    &.position-end {
        justify-content: flex-end;
    }

    &.position-center {
        justify-content: center;
    }

    &.position-between {
        justify-content: space-between;
    }

    &.position-around {
        justify-content: space-around;
    }

    &.alignment-center {
        align-items: center;
    }

    &.alignment-start {
        align-items: flex-start;
    }

    &.alignment-end {
        align-items: flex-end;
    }
}

.image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: black;

    img {
        max-width: 100%;
        max-height: 100%;
    }
}

.button {
    white-space: nowrap;
    font-size: inherit;
    font-family: inherit;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progressbar {
    min-width: 100px;
    position: relative;

    .background {
        box-sizing: border-box;
        position: absolute;
        height: 100%;
        width: 100%;
    }

    .foreground {
        box-sizing: border-box;
        position: absolute;
        height: 100%;
    }
}

.checkbox {
    display: flex;
    align-items: center;

    label {
        white-space: nowrap;
    }

    .checkbox-outer {
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

.radio {
    display: flex;
    align-items: center;

    label {
        white-space: nowrap;
    }

    .radio-outer {
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

.combo {
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: default;

    .combo-button {
        font-size: inherit;
        font-family: inherit;
        user-select: none;
        -webkit-user-select: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        z-index: 11;
    }

    .combo-choices {
        position: absolute;
        z-index: 10;
        top: 100%;
        box-sizing: border-box;
        white-space: nowrap;
        min-width: 100%;
    }
}

.range {
    min-width: 100px;
    display: flex;
    align-items: center;

    .inner-range {
        padding: 0;
        box-sizing: border-box;
        outline: none;
        width: 100%;
        appearance: none;
        -webkit-appearance: none;

        &::-webkit-slider-runnable-track {
            -webkit-appearance: none;
            appearance: none;
        }

        &::-webkit-slider-thumb {
            cursor: pointer;
            -webkit-appearance: none;
            appearance: none;
        }

        &::-ms-thumb {
            border: none;
        }

        &::-ms-track {
            color: transparent;
        }

        &::-ms-fill-lower {
            background: transparent;
        }

        &::-moz-range-thumb {
            cursor: pointer;
        }
    }
}

.tabs {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;

    &.direction-vertical {
        flex-direction: row;

        .tab-titles {
            flex-direction: column;
            width: 200px;
        }
    }

    .tab-titles {
        cursor: default;
        display: flex;
        z-index: 2;

        .tab-title {
            box-sizing: border-box;
            display: flex;
            align-items: center;
        }
    }

    .tab {
        flex-grow: 1;

        > * {
            width: 100%;
            height: 100%;
        }
    }
}

.menubar {
    display: flex;
    position: relative;
    width: 100%;
    cursor: default;
    box-sizing: border-box;

    .menuitem {
        height: 100%;

        .menuitem-title {
            height: 100%;
            display: flex;
            align-items: center;
        }

        .menufunctions {
            display: flex;
            flex-direction: column;
            position: absolute;
            top: 100%;
            z-index: 100;

            .menufunction {
                display: flex;
                justify-content: space-between;

                span {
                    white-space: nowrap;
                }
            }
        }

        .underlined {
            text-decoration: underline;
        }
    }
}


.selectable {
    @include user-select(text);
}

.unselectable {
    @include user-select(none);
}
