@import "_vars.scss";
@import "_mixins.scss";

//////////////// browser default overwrites

*:focus {
    outline: none;
}

/*Firefox*/
:invalid {
    box-shadow: none;
}

:-moz-submit-invalid {
    box-shadow: none;
}

:-moz-ui-invalid {
    box-shadow: none;
}

//////////////// jquery ui overwrites
.ui-autocomplete {
    @extend .dialogContextMenu;
}

.ui-state-active, .ui-state-focus {
    background-color: $lineColor;
}

//////////////// text

html {
    font-size: 62.5%;
}

body, input, textarea, select, a, pre, button {
    font-family: Arial;
    font-size: 1.4rem;
    color: $textColor;
}

.flot-text, .legendLabel {
    font-size: 1.4rem !important;
}

h1 {
    font-size: 20px;
    font-size: 2rem;
}

h2 {
    font-size: 18px;
    font-size: 1.8rem;
}

h3 {
    font-size: 16px;
    font-size: 1.6rem;
}

h4 {
    font-size: 14px;
    font-size: 1.4rem;
    font-weight: bold;
}

.searchHit {
    font-weight: bold;
}

//////////////// html elements
html, body {
    background-color: $windowColor;
}

#CLX_Root {

    p {
        margin: $dialogPadding 0;

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

        &:last-child {
            margin-bottom: 0;
        }
    }

    textarea {
        width: 100%;
        height: $textareaHeightSmall;
    }

    pre {
        margin: 0;
        white-space: pre-wrap; // css-3
        white-space: -moz-pre-wrap; // Mozilla, since 1999
        white-space: -pre-wrap; // Opera 4-6
        white-space: -o-pre-wrap; // Opera 7
        word-wrap: break-word; // Internet Explorer 5.5+
    }

    input[type=text], textarea, select, .combobox, .textBox {
        border: 1px solid $lineColorMedium;
        padding: $inputPadding;
        box-sizing: border-box;
        min-width: $minimalInputSize;
        background-color: $controlBackgroundColor;

        + button {
            margin-left: $inputPadding;
        }
    }

    .combobox {
        min-width: 12rem;
    }



    table {
        border-spacing: 0;
        border-collapse: separate;

        th {
            font-weight: 600;
            text-align: left;
            white-space: nowrap;
        }

        td, th {
            padding: $cellPadding ($cellPadding/2);
        }

        td {
            &.gradeInput {
                .combobox {
                    min-width: 6rem;

                    input[type=text] {
                        min-width: 2rem;
                    }

                    .dialogContextMenu {
                        min-width: 8rem;
                    }
                }
            }
        }
    }

    svg {
        width: $smallButtonSize;
        height: $smallButtonSize;
    }

    button, a.textButton {
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        width: $mediumButtonSize;
        height: $mediumButtonSize;

        svg {
            height: $mediumButtonSize;
            width: $mediumButtonSize;
        }
        // only change stroke if it actually was stroked (hover and context menu shown = .active)
        &:hover {
            path[stroke="#666"], rect[stroke="#666"], circle[stroke="#666"], ellipse[stroke="#666"] {
                stroke: $selectedColor;
            }

            path[fill="#666"], rect[fill="#666"], circle[fill="#666"], ellipse[fill="#666"] {
                fill: $selectedColor;
            }
        }

        &:active, &.active {
            path[stroke="#666"], rect[stroke="#666"], circle[stroke="#666"], ellipse[stroke="#666"] {
                stroke: $selectedColor;
            }

            path[fill="#666"], rect[fill="#666"], circle[fill="#666"], ellipse[fill="#666"] {
                fill: $selectedColor;
            }
        }
        // only change stroke if it actually was stroked
        &[disabled] {
            path[stroke="#666"], rect[stroke="#666"], circle[stroke="#666"], ellipse[stroke="#666"] {
                stroke: $inactiveColor !important;
            }

            path[fill="#666"], rect[fill="#666"], circle[fill="#666"], ellipse[fill="#666"] {
                fill: $inactiveColor !important;
            }
        }

        &:active svg {
            margin: $buttonIndent 0 0 $buttonIndent;
            height: $smallButtonSize;
            width: $smallButtonSize;
        }

        path, rect, circle {
            @include pre(transition, all $baseTransitionTime ease-out);
        }

        .loadingAnimation {
            min-height: $mediumButtonSize;
            min-width: $mediumButtonSize;
        }
    }

    label.required::after {
        content: " *";
    }

    .formRow .combobox button {
        height: 1.6rem;
    }

    .row {
        clear: both;
        float: left;
        width: 100%;

        .dialogInfo {
            margin: 2*$dialogPadding 0 0 0 !important;
        }

        > div {
            float: left;
            box-sizing: border-box;
            margin: 2*$dialogPadding $dialogPadding 0 0;

            &:last-child {
                margin: 2*$dialogPadding 0 0 0 !important;
            }
            
            .colLine {
                margin: 2*$dialogPadding 0 !important;
            }

            h4.rowTitle {
                font-weight: bold;
                margin: 0 0 $dialogPadding / 2 0;
            }
        }

        &:first-child {
            margin-top: -$dialogPadding !important;
        }

        .rowTitle, .blockTitle {
            margin: 3*$dialogPadding 0 0 0;
        }
    }
}   

//////////////// specialized html elements
.material-icons {
    &.reverse {
        -webkit-transform: scaleX(-1);
        transform: scaleX(-1);
    }
}

//////// buttons

.textButton {
    line-height: $mediumButtonSize;
    width: auto !important;
    white-space: nowrap;
    display: flex; 

    svg, div.loadingAnimation {
        float: left;
        height: $mediumButtonSize;
        width: $mediumButtonSize;
    }

    div:not(.loadingAnimation), h3 {
        font-weight: bold;
        margin-left: $dialogPadding + $mediumButtonSize;
        @include pre(transition, all $baseTransitionTime ease-out);
    }

    &:hover {
        div, h3, span {
            color: $selectedColor;
        }
    }

    path, rect, circle {
        @include pre(transition, all $baseTransitionTime ease-out);
    }

    &[disabled] {

        > div {
            color: $inactiveColor !important;
        }

        svg {
            height: $mediumButtonSize !important;
            width: $mediumButtonSize !important;
            margin: 0 !important;
        }

    }

    &.error div {
        color: $errorColor !important;
    }
}

//////// tables
.editTable {
    @extend .borderTable;

    td {
        padding: $cellPaddingLarge ($cellPaddingLarge / 2) !important;

        > input:not([type="checkbox"]), > .combobox input, > select, > textarea {
            height: auto;
        }
    }

    input.dateTextBox {
        width: calc(100% - #{$mediumButtonSize + $dialogPadding +$cellPaddingLarge});
    }
}

ul.noBullets {
  list-style-type: none;
}

.noIndent {
    padding-left: 0;
}

//////// titles
h4.blockTitle {
    color: $textColorBright;
    font-style: italic;
    border-bottom: solid 1px $lineColorMedium;
    padding-bottom: 0.8rem;
    margin-bottom: 0.8rem;
}

//////////////// comon and base definitions for SCSS

#CLX_Root, #CLX_Root > .ember-view {
    height: 100%;
}

#CLX_Root a, .overlayDialog a, .contextMenu a {
    text-decoration: none;
}

.ellipsis {
    white-space: nowrap;
    overflow: hidden;
    @include pre(text-overflow, ellipsis);
}

.noselect {
    -webkit-touch-callout: none; /* iOS Safari */
    @include pre(user-select, none);
}

.defaultShadow {
    @include boxShadow(null, null, null, null, null);
}

.borderBox {
    @include pre(box-sizing, border-box);
}

.blockNote {
    font-style: italic;
    margin: $dialogPadding / 2 0;
}

.buttonRight {
    float: right;
    margin-left: $dialogPadding;
}

.buttonLeft {
    float: left;
    margin-right: $dialogPadding;
}


//////////////// ember components

.fileChooser {
    float: left;

    > button, > div, > input {
        float: left;
        margin-right: $dialogPadding;
    }
    .deleteButton {
        margin-right: 2*$dialogPadding;

        svg {
            width: $smallButtonSize;
            height: $smallButtonSize;
            margin-top: ($mediumButtonSize - $smallButtonSize) / 2;
        }
    }
}

// defines filter color (background-color), rectangle border (always use px) and errorColor (color) of the foto filter tool
.fotoFilterRectangle {
    background-color: $overlayColor;
    border: 2px solid $selectedColor;
    color: $errorColor;
}

.blendElement {
    @include pre(transition, all $baseTransitionTime ease-out);

    &.slideIn {
        margin-left: -100% !important;
    }

    &.fadeIn {
        opacity: 0;
    }
}

//////////////// evento widgets

.dateTextbox {
    max-width: $smallInputSize;
    min-width: $minimalInputSize;

    input {
        width: calc(100% - #{$mediumButtonSize + $dialogPadding});
        float: left;
        min-width: $minimalInputSize - $mediumButtonSize - $dialogPadding;
    }
    input.noButton {
        width: 100%;
    }
}

.combobox {
    position: relative;
    line-height: normal;

    input, > div {
        width: calc(100% - #{$inputPadding + $mediumButtonSize});
        border: none !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    input {
        @extend .ellipsis;
    }

    button {
        float: right;
    }
}

//***clean up***//
#httpErrorIcon {
    height: $errorIconHeight;
    width: $errorIconWidth;
}

.errorContainer {
    float: left;
    padding: 5%;
    width: 90%;

    #httpErrorIcon {
        margin-right: 2*$dialogPadding;
    }

    > div, > h2, #httpErrorIcon {
        float: left;
    }

    > div, > h2 {
        width: calc(100% - #{$errorIconWidth + 2*$dialogPadding});
    }

    > h2 {
        font-size: 2.6rem;
        color: $selectedColor;
        font-weight: bold;
        margin-bottom: 2*$dialogPadding;
        border-bottom: 1px solid $lineColorMedium;
    }

    > .dialogInfo {
        float: left;
    }
}

.error {
    color: $errorColor;
}
.warning {
    color: $warningColor;
}

.urlDiv {
    word-break: break-all;
}

.bodyContainer a, .dialogBody a {
    color: $linkColor;
}

.borderTable {
    width: 100%;

    td {
        border-bottom: 1px solid $lineColor;
    }

    tr:last-child > td {
        border-bottom: none;
    }

    th {
        border-bottom: 1px solid $lineColorDark;
    }
}


.ellipsisTable {
    table-layout: fixed;

    th, td {
        @extend .ellipsis;
    }
}

.radioButtonList {
    input[type="radio"] {
        float: left;
    }

    label {
        float: left;
        vertical-align: middle;
        margin-right: $dialogPadding;
    }

    div {
        line-height: $mediumButtonSize;
    }
}

.dialogContextMenu td {
    padding: ($cellPadding/2) $cellPadding;
}

.toggleIcon svg {
    height: $tinyButtonSize;
    width: $tinyButtonSize;
}
//###clean up###//




//////////////// modal overlay
.modalOverlay {
    background-color: $overlayFallbackColor;
    background-color: $overlayColor;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.dialogDraggable {
    position: fixed !important;
    min-width: $minDialogWidth;
    min-height: $minDialogHeight;
    background-color: $windowColor;
    width: $dialogWidth;
    height: $dialogHeight;
    left: calc((100% - #{$dialogWidth}) / 2);
    top: calc((100% - #{$dialogHeight}) / 2);
}

.informationPopup {
    max-width: $breakpointWidth;
    max-height: $breakpointWidth;
    padding: $dialogPadding;
}

//////////////// loading template

.centerWrapper {
    margin: auto;
    display: table;
    height: 600px;
}

.middleWrapper {
    display: table-cell;
    vertical-align: middle;
    height: 100%;
}

.loadingAnimation {
    background-image: url(images/ember_loading.gif);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100px 100px;
    min-height: 100px;
    min-width: 100px;
}

.fullScreenLoading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: $windowColor;

    .loadingAnimation, .loadingText {
        width: 100%;
        text-align: center;
    }
}

//////////////// dialog

.dialogFlexContainer {
    height: 100%;
    @include displayFlex();
    @include flexDirection(column);

    > div {
        padding: 0 $dialogPadding;
        margin: $dialogPadding 0;
    }

    > div:first-child {
        margin-top: 0;
    }

    > div:last-child {
        margin-bottom: 0;
    }
}

.dialogBlock, .oneHalfBlock, .oneThirdBlock, .dialogBody hr, .dialogPart, .dialogBody {
    float: left;
}

.dialogElement, hr {
    width: 100%;
}

.dialogBlock {
    padding: $dialogPadding;
    width: calc(100% - #{2*$dialogPadding});
}

.dialogBlockFlex {
    @include flex(1, 1, auto);
}

.dialogBlockFixed {
    @include flex(0, 1, auto);
}

.columnLeft {
    margin-right: 10%;
}

.dialogColumnContainer {
    position: relative;
    @include displayFlex();
    @include flexDirection(row);
}

.dialogColumnFixed {
    @extend .dialogBlockFixed;
}

.dialogColumnFlex {
    @extend .dialogBlockFlex;
}

.dialogTitle svg, .searchToolbar svg {
    width: $mediumButtonSize;
    height: $mediumButtonSize;
}

.dialogBody {
    padding: $dialogPadding;
    width: 100%;
    overflow-y: auto;
    @include flex(1, 1, auto);
    @extend .dialogElement;

    hr {
        margin: $dialogVerticalMargin 0;
    }

    > div.ember-view {
        height: 100%;
    }

    > .dialogToolbar {
        margin-left: - $dialogPadding;
        width: 100%;
    }
}

.dialogTitle {

    h2 {
        font-style: normal;
        padding: 0 !important;
        margin: 0 !important;
        display: inline;
    }

    button {
        @extend .buttonRight;
    }
}

.dialogElement 
{
    float: left;
    width: 100%;
    box-sizing: border-box;
}

.dialogHeader {
    padding: $dialogPadding;
    background-color: $barColor;
    font-weight: bold;
    border-bottom: solid 1px $lineColorMedium;
    @extend .dialogElement;
    @include flex(0, 1, auto);
    min-height: $minDialogHeaderHeight;

    h2 {
        color: $textColor; 
        font-size: 1.5rem;
    }
}

.dialogFooter {
    min-height: $footerHeight; // needed for IE
    line-height: $footerHeight;
    border-top: solid 1px $lineColorMedium;
    background-color: $barColor;
    @include flex(0, 1, $footerHeight);
    padding: 0 $dialogPadding + 1;
    position: relative;

    .textIcon {
        float: none;
        display: inline-block;
    }

    .pdfReport {
        margin: 0;
    }

    .linkDiv {
        float: left;
        margin-left: $dialogPadding;
    }

    .buttonDiv {
        float: right;
        margin-left: 2*$dialogPadding;
    }

    .validationErrorMessage {
        border: none;
        padding: 0 $dialogPadding;
    }

    .buttonContainer {
        padding-right: $dialogPadding;
    }
}


.footerValidation {
    color: $errorColor;
    position: absolute;
    right: $dialogPadding;
    bottom: $footerHeight + $dialogPadding;
    width: $footerValidationWidth;
    padding: $dialogPadding;
    white-space: normal !important;
}


.sectionTitle {
    color: $mediumBlue;
    margin-top: $dialogPadding / 2;
    text-align: center;
    width: 100%;
    clear: both;
}

.fillVertical {
    height: 100%;
}

.dialogSubTitle {
    margin-bottom: $dialogPadding;
}

.dialogInfoTable {
    margin-bottom: $dialogPadding;
    width: 100%;
    td {
        padding-left: 0 !important;
        padding-right: 2 * $dialogPadding !important;
    }

    .dialogMainInfo {
        color: $mediumBlue;
        font-weight: bold;
    }
}

.dialogToolbar {
    line-height: $dialogToolbarHeight;
    height: $dialogToolbarHeight;
    border-top: 1px solid $lineColorMedium;
    background-color: $barColor;
    padding: 0 $dialogPadding;

    > div:not(.buttonContainer) {
        margin-right: $dialogPadding;
        float: left;
    }

    .combobox button {
        top: $tabHeight / 2 - $smallButtonSize / 2;
    }

    .verticalSpacer {
        border-left: $lineColorDark 1px solid;
        height: $dialogToolbarHeight - 2*$inputPadding;
        margin-top: $inputPadding;
    }
}

.dialog {
    background-color: $windowColor;
    width: 100%;
    height: 100%;
    min-width: $minDialogWidth;
    min-height: $minDialogHeight; 
    @include displayFlex();
    @include flexDirection(column);
}

.smartDialog {
    top: 50%;
    left: 50%;
    min-height: 100px;
    min-width: 200px;
    margin-top: -50px;
    margin-left: -100px;

    > div {
        float: left;
        clear: left;
        width: 100%;
    }

    .dialogHeader {
        box-sizing: border-box;
    }

    .dialogBody {
        padding: 0;
    }

    h4 {
        margin: $dialogPadding 0;
    }

    .dialogToolbar {
        padding: 0 $dialogPadding;
    }

    .dialogFooter { 
        button {
            margin: 0 $dialogPadding;
        }
    }

    .dialogBlock {
        float: none;
        padding: $dialogPadding;
        margin: 0;
    }
}

.flexDialogNeck {
    margin: $dialogPadding;
    @include flex(0, 1, auto);
}

/*detail dialog*/

.dialogTab, .dialogIcon, .dialogTitle, .dialogQuickTabsChoice, .browseText {
    float: left;
}

.buttonContainer {
    float: right;

    button {
        float: right;
        margin-left: 0.8rem;
    }
}

.detailDialog .dialogTitle {
    @extend .ellipsis;
}

.dialogIcon {
    margin-right: $dialogPadding;

    img {
        max-height: $mediumButtonSize;
        max-width: $mediumButtonSize;
        cursor: pointer;
    }
}

.tabBar {
    height: $tabHeight;
    @extend .dialogElement;
    @include gradientTop($buttonColor2, $buttonColor1, $buttonColor2, null);
    @include boxShadow($fallbackShadow, transparentize($defaultShadow, 0.4), 0, 2px, 3px);
}

a.active .dialogTab {
    color: $activeTextColor;
    font-weight: bold;
    @include gradientTop($activeColor1, $activeColor1, $activeColor2, $activeColor3);
}

.dialogTab {
    text-align: center;
    cursor: pointer;
    height: $tabHeight;
    padding: $tabPadding;
    border-right: 1px solid $lineColorMedium;
    @extend .borderBox;
}

.dialogQuickTabsChoice {
    cursor: pointer;
    padding: $tabPadding;
    width: 1.4rem + (2*$tabPadding);
    height: $tabHeight;
    @extend .borderBox;
}

.dialogQuickTabs {
    right: 0;
    margin-top: $tabHeight !important;

    a {
        text-decoration: none;
        padding: 0 !important;
    }
}

.dialogContextMenu {
    overflow-y: auto;
    overflow-x: hidden;
    background-color: $windowColor;
    position: absolute;
    padding: $dialogPadding/2 $dialogPadding;
    margin: 0;
    line-height: normal;
    font-weight: normal;
    white-space: nowrap;
    @extend .defaultShadow;

    &.tooltipMenu {
        overflow-x: auto;
        white-space: pre-wrap;
        text-align: left;
    }

    &.htmlTooltipMenu {
        overflow-x: auto;
        white-space: normal;
        text-align: left;
    }

    a, div, li {
        display: block;
        padding: $dialogPadding/2;
        cursor: pointer;
        text-decoration: none;
        white-space: nowrap;
        width: calc(100% - #{$dialogPadding});
        float: left;
        clear: left;
        border-bottom: 1px solid $lineColor;

        &:last-child {
            border: none;
        }

        &:hover, &.itemHover {
            background-color: $lineColor;
        }
    }

    li a {
        border-bottom: 1px solid $lineColor !important;
    }

    li:last-child a {
        border: none !important;
    }
}

.dialogAccordionTable {
    margin-top: 2 * $dialogPadding;
    width: 100%;
}

.hierarchyNode {
    height: auto !important;
}

/*detail dialog list dialog*/

.groupRow {
    background-color: $lineColorMedium;
    font-weight: bold;
}

.toggleIcon {
    float: left;
    margin-right: $dialogPadding;
}


/*detail dialog field dialog*/

.fieldDialogSection {
    float: left;
}

.fieldDialog {
    overflow-y: auto;
    height: 100%;
}

.dialogValue {
    padding: $dialogPadding / 4;
    margin: $dialogPadding / 4;
    @extend .ellipsis;
}

.dialogLabel {
    @extend .dialogValue;
    @extend .ellipsis;
    @extend .groupRow;
}

.browseText {
    @extend .ellipsis;
    width: calc(100% - #{$mediumButtonSize + $dialogPadding});
    margin-right: $dialogPadding;
}

/*detail dialog hierarchy dialog*/

.hierarchyNode {
    margin: $dialogPadding/2 0;
}

.indent {
    margin-left: $hierarchyIndent;
}

.parentNode {
    cursor: pointer;
    @extend .groupRow;
    @extend .dialogValue;
}

//////////////// search table

.markedRow {
    background-color: $barColor;
}

.searchSelected {
    @extend .markedRow;
    font-weight: bold;
}

.searchTable {
    border-spacing: 0;
    width: 100%;
    table-layout: fixed;
    clear: left;
    @extend .borderTable;

    td {
        cursor: pointer;
    }

    td:not(.multiline, .noData) {
        @extend .ellipsis;
    }

    th {
        min-width: $searchTableMinColSize;

        input, select {
            display: table-cell;
            width: calc(100% - #{$dialogPadding});
            clear: left;
            margin: 0;
        }

        input[type="checkbox"] {
            width: auto !important;
        }
    }

    tbody tr:hover {
        @extend .markedRow;
    }
}

.dataRow:focus {
    @extend .markedRow;
}

.bodyContainer {
    overflow-y: auto;

    &.noFixedHeader {
        overflow: visible;
    }
}

.headerLabel {
    float: left;
    @extend .ellipsis;
    @extend .noselect;
    width: calc(100% - 1.5rem); //todo: move to _vars?
}

.headerText div, .searchTable th input, .searchTable th select { //todo: is there a better way? cannot extend .headerText div in upper block
    float: left;
}

.sortingDirection {
    width: 0;
    height: 0;
    border-width: 0 0.4rem 0.6rem 0.4rem; //todo: move to _vars or make mixin for triangle (https://css-tricks.com/snippets/sass/css-triangle-mixin/)
    border-color: transparent;
    border-style: solid;
    margin: 0.3rem 0 0 0.6rem;
    float: left;
    padding: 0;
}

.sortedAsc, .sortedDesc {
    @include pre(transition, $baseTransitionTime cubic-bezier(0.565, 1.65, 0.765, 0.88));
}

.headerText:hover .sortAsc, .sortedAsc {
    @include pre(transform, rotate(0deg));
}

.headerText:hover .sortDesc, .sortedDesc {
    @include pre(transform, rotate(180deg));
}

.headerText:hover .sortAsc, .headerText:hover .sortDesc, .sortedAsc, .sortedDesc {
    border-bottom-color: $textColor;
}

.iconColumn, .searchTable td.iconColumn {
    min-width: $smallButtonSize + $cellPadding !important;
    width: $smallButtonSize + $cellPadding;
    @include pre(text-overflow, initial);
}

th.iconColumn {
    vertical-align: bottom;
}

.noData {
    padding-top: $dialogPadding;
}

.loadingText {
    margin-bottom: $dialogPadding;
}

/*search toolbar*/

.searchToolbar {
    button {
        @extend .buttonLeft;
    }
}

.toolbarItem {
    @extend .buttonLeft;
}

//////////////// form controls 

.form {
    float: left;
}

.formRow {
    clear: left;
    margin: $dialogPadding / 2 0;
    float: left;
    width: 100%;
    min-height: 2.6rem;

    .subscriptionDetail > .blendElement > label {
        float: left;
        margin-right: $dialogPadding;
        width: 30%;
        min-width: 400px;
        position: relative;
    }

    &.fullWidth > label, &.fullWidth > input {
        width: 100%;
        margin-bottom: $dialogPadding;
    }

    > input:Not([type="checkbox"]), > select, > .radioButtonContainer, .radioButtonList,
    .subscriptionDetail > .blendElement > * {
        float: left;
        width: 40%;
        min-width: $smallInputSize;
    }

    input.dateTextBox {
        width: calc(40% - #{$mediumButtonSize + $dialogPadding});
    }

    .subscriptionDetailValue {
        padding: $inputPadding;
    }

    input:checked + label {
        color: $mediumBlue;
    }

    .combobox {
        float: left;
    }
}


.formLabelTop {
    @extend .ellipsis;
}

.formControl {
    > input, > span.combobox, > div, > textarea, > select {
        display: block;
        width: 100%;
        margin-top: 2px;
    }

    > span.combobox input {
        width: 100%;
    }     
}

div.col12 {
    width: calc(100% - #{$dialogPadding});
}

div.col8 {
    width: calc(66.7% - #{$dialogPadding});
}

div.col6 {
    width: calc(50% - #{$dialogPadding});
}

div.col5 {
    width: calc(41.66% - #{$dialogPadding});
}

div.col4 {
    width: calc(33.3% - #{$dialogPadding});
}

div.col3 {
    width: calc(25% - #{$dialogPadding});
}

div.col2 {
    width: calc(16.66% - #{$dialogPadding});
}

.colLine {
    margin: $dialogPadding 0 !important;
    border-bottom: 1px solid $lineColorDark;
}

pre.address {
    padding: $dialogPadding 0;
}

.editControl {
    position: relative;

    .textButton {
        position: absolute;
        right: 0;
        bottom: 0;
        display: inline-block;
        background-color: $textColor;
        border-radius: $buttonBorderRadius $buttonBorderRadius 0 0;
        padding: $dialogPadding/4;
        color: $windowColor;

        div {
            font-weight: normal;
        }

        svg {
            path[stroke="#666"], rect[stroke="#666"], circle[stroke="#666"], ellipse[stroke="#666"] {
                stroke: $windowColor;
            }

            path[fill="#666"], rect[fill="#666"], circle[fill="#666"], ellipse[fill="#666"] {
                fill: $windowColor;
            }
        }

        &:hover svg {

            path[stroke="#666"], rect[stroke="#666"], circle[stroke="#666"], ellipse[stroke="#666"] {
                stroke: $selectedColor;
            }

            path[fill="#666"], rect[fill="#666"], circle[fill="#666"], ellipse[fill="#666"] {
                fill: $selectedColor;
            }
        }
    }
}

.formControl {
    position: relative;

    .textButton {
        float: right;
        margin: 0 $dialogPadding;
    }
}

.tooltipButton {
    position: absolute;
    overflow: visible;
    margin-left: $dialogPadding / 2;

    svg {
        height: $smallButtonSize;
        width: $smallButtonSize;
    }
}

.buttonContainer {
    .tooltipButton {
        position: static;
        svg {
            height: $mediumButtonSize;
            width: $mediumButtonSize;
        }
    }
}

.radioButtonContainer {
    input, label {
        float: left;
        width: auto;
    }

    label {
        margin: 0 $dialogPadding 0 $dialogPadding / 2;
    }
}

//////////////// validation & error

.validationError {
    @include pre(transition, border-color $baseTransitionTime ease-out);

    &.showError {
        border: 1px solid $errorColor !important;
    }
}

.validationErrorMessage {
    color: $errorColor;
    border-bottom: 1px solid $lineColorMedium;
    padding: $dialogPadding/2;
    width: auto;

    &.warning {
        color: $warningColor;
    }
}

//////////////// commentary template

#CLX_Root #txtCommentary {
    height: $textareaHeight;
    width: calc(100% - #{2*$dialogPadding + $smallButtonSize});
}

#CLX_Root #divCommentary {
    min-height: 200px;
    width: calc(100% - #{$dialogPadding});
    margin-top: $dialogPadding;
}

#CLX_Root #btnSaveCommentary, #btnSaveCommentary svg {
    width: $smallButtonSize;
    height: $smallButtonSize;
}


//////////////// grading template

.collapseTriangle {
    width: 0;
    height: 0;
    border-width: 0 0.6rem 0.6rem 0.6rem;
    border-color: transparent;
    border-style: solid;
    float: left;
    padding: 0;
    border-bottom-color: #666;
    @include pre(transition, all $baseTransitionTime ease-out);
}

.triangleCollapsed {
    @include pre(transform, rotate(90deg));
}

.triangleExpanded {
    @include pre(transform, rotate(135deg));
}

.gradeInput .combobox {
    max-width: $smallInputSize; 
}



//////////////// subscription 

.subscriptionDetail {
    > div > label > a {
        color: $linkColor;
    }
}

//////////////// subscriptionNew template

.addSubscription {
    float: left;
    margin-top: 3*$dialogPadding;
}

.subscriptionNewTemplate {
    background-color: $windowColor;
}

//////////////// workprogress

.workProgressView {
  margin: 8px 0;
  width: 100%; 
  @include displayFlex();
}

.workProgress {
  @include flex(1, 1, 0px);
  min-width: 0;

  &:first-child .workProgressStage {
      margin: 0;
      padding-left: $dialogPadding;
  }

  &:last-child .workProgressStage {
      width: calc(100% - #{$tabHeight/2});
      .workProgressTip {
          right: -$tabHeight;
      }
  }
}

.workProgressStage {
  height: $tabHeight;
  line-height: $tabHeight;
  padding-left: $tabHeight + $dialogPadding;
  margin-left: - $tabHeight / 2;
  color: white;
  font-weight: bold;
  position: relative;
  box-sizing: border-box;
}

.stage0{
  background-color: $mediumBlue;
  .workProgressTip {
      border-color: transparent transparent transparent $mediumBlue;
  }
}

.stage1 {
  background-color: $gray;
  .workProgressTip {
      border-color: transparent transparent transparent $gray;
  }
}

.stage2 {
  background-color: $gray1;
  .workProgressTip {
      border-color: transparent transparent transparent $gray1;
  }
}

.workProgressLine {
    background-color: $gray;
    height: 0.7rem;
    margin: 2*$dialogPadding 0 $dialogPadding;
    position: relative;
}

.workProgressLine svg {
    position: absolute;
    left: calc(50% - 0.7rem);
    top: -0.3rem;
    z-index: 10;
}

.workProgressLabel {
    width: calc(100% - #{$dialogPadding});
    margin: 0 $dialogPadding/2; 
    text-align: center;
    @extend .ellipsis;

    .active {
        color: $textColor !important;
        font-weight: bold;
    }

    &.error a {
        color: $errorColor;
        font-style: italic;
    }
    &.subsequent a {
        color: $warningColor;
        font-style: italic;
    }
}

.workProgressLabel div {
    @extend .ellipsis;
}

.currentWorkProgress, .adjacentWorkProgress {
  min-width: auto;
}

.currentWorkProgress circle {
  fill: $gray;
}

.valid circle {
  stroke: $okColor;
  fill: $okColor;
}

.subsequent circle {
  stroke: $warningColor;
  fill: $warningColor;
}

.error circle {
  stroke: $errorColor;
  fill: $errorColor; 
}

.workProgressTip {
    border-style: solid;
    border-width: $tabHeight/2 0 $tabHeight/2 $tabHeight;
    width: 0;
    height: 0;
    position: absolute;
    right: - $tabHeight / 2;
    top: 0;
    z-index: 1;
}

.stageName {
    overflow: visible;
    position: absolute;
    z-index: 1;
}

.firstOfStage.lastOfStage .stageName {
    @extend .ellipsis;
    position: inherit;
}

//////////////// flot
.flotThumb {
    height: 20rem;
    width: 30rem;
    margin-bottom: 3rem;
}

.flotFull {
    height: calc(100% - #{6*$dialogPadding});
    width: calc(100% - #{6*$dialogPadding});
    margin: auto;
}

.flotLegend {
    margin-left: $dialogPadding;
}

.flotDialog {
    float: left;
    background-color: $flotBackground;
    @extend .defaultShadow;

    .flotLegend {
        margin: 0;
        float: left;
    }

    .dialogTitle {
        float: left;
        width: calc(100% - #{2 * $dialogPadding});
    }

    .flotFull {
        float: left;
        margin: 0 4 * $dialogPadding 4 * $dialogPadding;
    }
}

.flotColumnContainer {
    height: 26rem;
}

.flotLegendOverlay {
    float: left;
}

.legendLabel {
    padding-right: $dialogPadding;
}

.flotPointLabel {
    font-weight: bold;
}

.flot-tick-label {
    font-weight: normal;
}

.axisLabel {
    position: absolute;
    text-align: center;
    font-weight: bold;
}

.yaxisLabel {
    top: 50%;
    left: -2rem;
    transform: rotate(-90deg);
    transform-origin: 0 0;
}

.xaxisLabel {
    bottom: -2.5rem;
    left: 50%;
}

.noteContainer {
    border: 1px solid $lineColorMedium;
    padding: $dialogPadding;
    margin-bottom: $dialogPadding;
}

.noteTitle {
    font-weight: bold;
    margin-bottom: $dialogPadding;
}

.checkBoxContainer {
    float: left;
}

/* fmei */

.pdfReportBar {
    float: left;
    width: 100%;
}

.pdfReport {
    margin: $dialogPadding;
    svg {
        height: $mediumButtonSize;
        margin-right: $dialogPadding;
    }
}

.subscriptionTemplate {
    position: relative;
    margin-top: 3*$dialogPadding;

    .collapseTriangle {
        margin: 0.6rem 0.6rem 0 0; 
    }

    h3 {
        border-bottom: 1px solid $gray;
        padding: $dialogPadding;
    }
}

.treeViewButton {
    height: $mediumButtonSize;
    position: absolute;
    right: $dialogPadding;
    top: $dialogPadding;
    float: right;
    vertical-align: middle;
}


.accordionNavigation {
    height: 100%;

    > a {    
        background-color: $barColor;       
        padding: $dialogPadding;
        float: left;
        width: 100%;
        border-bottom: 1px solid $lineColorDark;
        box-sizing: border-box;
    }

    > a:nth-last-child(2) {
        border-bottom: none;
    }

    > .active {
        color: $windowColor;
        background-color: $textColor;

        svg {
             path[stroke="#666"], rect[stroke="#666"], circle[stroke="#666"], ellipse[stroke="#666"] {
                stroke: $windowColor;
            }

            path[fill="#666"], rect[fill="#666"], circle[fill="#666"], ellipse[fill="#666"] {
                fill: $windowColor;
            }
        }
    }

    .searchTable {  
        th, td {
            padding: $dialogPadding;
        }
    }
}

.navigationContent {
    float:left;
    width: 100%;
    padding: $dialogPadding;
    box-sizing: border-box;
    overflow-y: auto;

    > div {
        position: relative;
    }

    @include fillHeightNavigation(1,3);
}

.textIcon { 
     line-height: $mediumButtonSize;    
     height: $mediumButtonSize;  
     float: left;

     h3 {
         margin: 0;
         float: left;
         vertical-align: middle;
     }

     svg {
         margin-right: $dialogPadding;
         width: $mediumButtonSize;
         height: $mediumButtonSize;
         float: left;
     }

     a, button {
         color: $linkColor;
         width: auto;
     }
}
a.textIcon {
    color: $linkColor;
}

.treeViewNode {   
    width: calc(100% - 3 * #{$dialogPadding});
    margin: 0 $dialogPadding $dialogPadding;
    float: left;
    clear: left;
    cursor: pointer;

    &.textIcon {
        margin-top: 2*$dialogPadding;
        border-bottom: 1px solid $lineColorMedium;
        padding-bottom: $dialogPadding / 2;
    }
}

.formRow.treeViewNode {
    cursor: default;
}

.onlaWorkProgressText {
    float: left;
    width: 20rem;
}

.treeViewContent {
    margin-left: 2 * $dialogPadding;
}

.treeViewSubNode {
    color: $textColorBright;
    font-style: italic;
}

.dialogInfo {
    padding: $dialogPadding;
    background-color: $infoBgColor;
    border: solid 1px $lineColorMedium;
    margin: $dialogPadding;
}

.formRemark {
    color: $mediumBlue;
}

.formRemarkRow {
    margin-top: 2*$dialogPadding;
}

.invoiceContainer {
    width: 600px;

    > table {
        width: 100%;

        td.right {
            text-align: right;
        }
    }
}

.personalDataSheetColumn {
    width: 50%;
    height: 100%;
    float: left;
    overflow-y: auto;
    box-sizing: border-box;
    padding-right: 0.8rem;

    &:first-child {
        border-right: solid 1px $lineColorDark;
    }

    &:last-child {
        background-color: $infoBgColor;
        padding-left: $dialogPadding;
    }

    .question {
        padding-bottom: $dialogPadding;

        > .text {
            padding-bottom: $dialogPadding;
        }
    }

    > .placeholder {
            height: 100%;
            float: left;
        }

    > .info{
        padding-bottom: $dialogPadding;
        margin-bottom: $dialogPadding;
    }
}

#pnlInfos {
    > button {
        display: none;
    }
}

#ovlPersonalDataSheetEdit {
    table.dialogInfoTable th {
        white-space: normal;
    }
}



@media only screen and (max-device-width: $breakpointWidth), only screen and (max-width: $breakpointWidth) {

    div.col12, div.col6, div.col5, div.col4, div.col3, div.col2 {
        width: 100%;
    }

    .dialogDraggable, .dialog, .flexDialog {
        width: 100% !important;
        height: 100% !important;
        left: 0 !important;
        top: 0 !important;    
        min-width: 0;
        min-height: 0;
    }

    .formRow {
        > span > *:not(.combobox), .combobox {
            width: 100% !important;
        }

        > span > label {
            margin-bottom: $dialogPadding / 2;
        }
    }

    .dialogFooter {
        border-top: none;
    }

    #ovlPersonalDataSheetEdit .dialogBody {
        overflow: hidden;
        white-space: nowrap;
        
        > div {
            white-space: normal;
        }
    }

    .personalDataSheetColumn {
        width: 100%;
        margin-right: 0 !important;
        padding-right: 0 !important;
        border: none !important;
        background-color: $windowColor !important;
        @include pre(transition, all $baseTransitionTime ease-out);

        &:last-child.active {
            margin-left: 0;
        }
        &:last-child.inactive {
            margin-left: 100%;
            > button {
                display: none !important;
            }
        }
        &:first-child.active {
            margin-left: 0;
        }
        &:first-child.inactive {
            margin-left: -100%;
        }
    }

    #pnlInfos {
        margin-top: 2*$dialogPadding;

        > button {
            display: block;
            position: absolute;
            right: 4*$dialogPadding;
            margin-top: - 2*$dialogPadding;
        }
    }
}
