/***********************************************************************************
  ARMSTRONG SCSS EXPORTS - CORE
  all scss to be consumed must be exported here.
  EVERYTHING IN HERE WILL ONLY BE IMPORTED ONCE AND SHOULD BE EXPORTING "REAL" CSS
************************************************************************************/

/*** HELPERS ***/
/*** HELPERS ***/
// DO NOT IMPORT THIS MORE THAN ONCE
/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */

/**
 * 1. Change the default font family in all browsers (opinionated).
 * 2. Prevent adjustments of font size after orientation changes in IE and iOS.
 */

html {
  font-family: sans-serif; /* 1 */
  -ms-text-size-adjust: 100%; /* 2 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

/**
 * Remove the margin in all browsers (opinionated).
 */

body {
  margin: 0;
}

/* HTML5 display definitions
   ========================================================================== */

/**
 * Add the correct display in IE 9-.
 * 1. Add the correct display in Edge, IE, and Firefox.
 * 2. Add the correct display in IE.
 */

article,
aside,
details, /* 1 */
figcaption,
figure,
footer,
header,
main, /* 2 */
menu,
nav,
section,
summary { /* 1 */
  display: block;
}

/**
 * Add the correct display in IE 9-.
 */

audio,
canvas,
progress,
video {
  display: inline-block;
}

/**
 * Add the correct display in iOS 4-7.
 */

audio:not([controls]) {
  display: none;
  height: 0;
}

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */

progress {
  vertical-align: baseline;
}

/**
 * Add the correct display in IE 10-.
 * 1. Add the correct display in IE.
 */

template, /* 1 */
[hidden] {
  display: none;
}

/* Links
   ========================================================================== */

/**
 * 1. Remove the gray background on active links in IE 10.
 * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
 */

a {
  background-color: transparent; /* 1 */
  -webkit-text-decoration-skip: objects; /* 2 */
}

/**
 * Remove the outline on focused links when they are also active or hovered
 * in all browsers (opinionated).
 */

a:active,
a:hover {
  outline-width: 0;
}

/* Text-level semantics
   ========================================================================== */

/**
 * 1. Remove the bottom border in Firefox 39-.
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */

abbr[title] {
  border-bottom: none; /* 1 */
  text-decoration: underline; /* 2 */
  text-decoration: underline dotted; /* 2 */
}

/**
 * Prevent the duplicate application of `bolder` by the next rule in Safari 6.
 */

b,
strong {
  font-weight: inherit;
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */

b,
strong {
  font-weight: bolder;
}

/**
 * Add the correct font style in Android 4.3-.
 */

dfn {
  font-style: italic;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */

h1 {
  font-size: 2em;
  margin: 0.67em 0;
}

/**
 * Add the correct background and color in IE 9-.
 */

mark {
  background-color: #ff0;
  color: #000;
}

/**
 * Add the correct font size in all browsers.
 */

small {
  font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Embedded content
   ========================================================================== */

/**
 * Remove the border on images inside links in IE 10-.
 */

img {
  border-style: none;
}

/**
 * Hide the overflow in IE.
 */

svg:not(:root) {
  overflow: hidden;
}

/* Grouping content
   ========================================================================== */

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */

code,
kbd,
pre,
samp {
  font-family: monospace, monospace; /* 1 */
  font-size: 1em; /* 2 */
}

/**
 * Add the correct margin in IE 8.
 */

figure {
  margin: 1em 40px;
}

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

/* Forms
   ========================================================================== */

/**
 * 1. Change font properties to `inherit` in all browsers (opinionated).
 * 2. Remove the margin in Firefox and Safari.
 */

button,
input,
select,
textarea {
  font: inherit; /* 1 */
  margin: 0; /* 2 */
}

/**
 * Restore the font weight unset by the previous rule.
 */

optgroup {
  font-weight: bold;
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */

button,
input { /* 1 */
  overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */

button,
select { /* 1 */
  text-transform: none;
}

/**
 * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
 *    controls in Android 4.
 * 2. Correct the inability to style clickable types in iOS and Safari.
 */

button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
  -webkit-appearance: button; /* 2 */
}

/**
 * Remove the inner border and padding in Firefox.
 */

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

/**
 * Change the border, margin, and padding in all browsers (opinionated).
 */

fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *    `fieldset` elements in all browsers.
 */

legend {
  box-sizing: border-box; /* 1 */
  color: inherit; /* 2 */
  display: table; /* 1 */
  max-width: 100%; /* 1 */
  padding: 0; /* 3 */
  white-space: normal; /* 1 */
}

/**
 * Remove the default vertical scrollbar in IE.
 */

textarea {
  overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10-.
 * 2. Remove the padding in IE 10-.
 */

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box; /* 1 */
  padding: 0; /* 2 */
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */

[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  outline-offset: -2px; /* 2 */
}

/**
 * Remove the inner padding and cancel buttons in Chrome and Safari on OS X.
 */

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

/**
 * Correct the text style of placeholders in Chrome, Edge, and Safari.
 */

::-webkit-input-placeholder {
  color: inherit;
  opacity: 0.54;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */

::-webkit-file-upload-button {
  -webkit-appearance: button; /* 1 */
  font: inherit; /* 2 */
}


body{
  font-family: -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans",
    "Droid Sans", "Helvetica Neue", sans-serif
    }

p{
  margin: 0;
  margin-bottom: $spacing-small;
}

pre{
  -webkit-margin-before: 0;
  -webkit-margin-after: 0;
  margin: 0;
}

h1,h2,h3,h4,h5,h6{
  -webkit-margin-before: 0;
  -webkit-margin-after: 0;
  margin: 0;
  margin-bottom: $spacing-small;
}

h1{
  font-size: $font-size-xlarge;
  font-weight: bold;
}

h2{
  font-size: $font-size-large;
  font-weight: bold;
}

h3{
  font-size: $font-size-medium;
  font-weight: bold;
}

ul, li{
  margin: 0;
  padding: 0;
  -webkit-padding-start: 0;
}

ul{
  margin-top: $spacing-small;
}

li{
  margin-left: $spacing-small;
  margin-bottom: $spacing-xxsmall
}
// DO NOT IMPORT THIS MORE THAN ONCE
@each $c-color in $colors{
  $color: nth($c-color, 2);
  .fg-#{nth($c-color, 1)}{
    color: #{$color};
  }
  .bg-#{nth($c-color, 1)}{
    background-color: #{$color};
  }
  .btn.bg-#{nth($c-color, 1)}{
    color: white;
    background-color: $color;
    &.shadow{
      @include button-shadow($color);
    }
  }
}
// DO NOT IMPORT THIS MORE THAN ONCE
.flex-override {
    position: absolute !important;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding-left: inherit;
    padding-right: inherit;
    padding-top: inherit;
    padding-bottom: inherit;
    box-sizing: border-box;
}

.t-align-center{
    text-align: center;
}

.t-align-left{
    text-align: left;
}

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

.width-wrapper{
    max-width: $fixed-site-width;
    margin: 0 auto;
}
// DO NOT IMPORT THIS MORE THAN ONCE
$sides: top bottom left right;

@each $size in $spacing-sizes{
  .m-#{nth($size, 1)}{
    margin: nth($size, 2);
  }
  .p-#{nth($size, 1)}{
    padding: nth($size, 2);
  }
  @each $side in $sides{
    .m-#{$side}-#{nth($size, 1)}{
      margin-#{$side}: nth($size, 2);
    }
    .p-#{$side}-#{nth($size, 1)}{
      padding-#{$side}: nth($size, 2);
    }
  }
}

@each $f-size in $font-sizes{
  $size: nth($f-size, 2);
  .f-size-#{nth($f-size, 1)}{
    font-size: $size;
  }
}


/*** COMPONENTS ***/
img.rounded{
  border-radius: 50%;
}
@keyframes fade-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes scale-down {
  0% {
    transform: scale(1.2, 1.2);
    opacity: 0;
  }

  100% {
    transform: scale(1, 1);
    opacity: 1;
  }
}
$dialog-header-height: 50px;

.dialog-layer {
  box-sizing: border-box;
  height: 100%;
  width: 100%;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: $spacing-small;
  z-index: 255;
  animation-name: fade-in;
  animation-duration: 0.2s;

  .dialog {
    position: relative;
    max-height: calc(100% - (#{$spacing-small} * 2));
    width: 400px;
    background-color: white;
    display: flex;
    flex-direction: column;
    animation-name: scale-down;
    animation-duration: 0.3s;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    @include cubic-bezier(0.835, 0.305, 0.190, 1.250);

    .dialog-content {
      overflow: auto;
      flex: 1;
      flex-basis: auto;
      padding: $spacing-small;
      box-sizing: content-box;
      p:only-of-type{
        margin: 0;
      }
    }

    .dialog-footer {
      flex: 0 0 auto;
      padding: $spacing-small;
      .btn{
        margin-bottom: 0;
      }
    }

    .dialog-close-button{
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: $gray-base;
        height: 100%;
        width: $dialog-header-height;
        position: absolute;
        right: 0;
        top: 0;
      }

    .dialog-close-button-no-title{
      @extend .dialog-close-button;
      height: 50px;
      background: none;
      color: rgba(0,0,0,0.7);
    }

    .dialog-header {
      flex: 0 0 auto;
      border-bottom: 1px solid $gray-light;
      color: $gray-base;
      padding: $spacing-small;
      position: relative;
    }
  }
}


$max-width: 280px;

@keyframes animate-toast-outer {
    from {
        max-height: 0
    }

    to {
        max-height: 300px;
    }
}

@mixin animate-toast-inner-from($direction, $startTransform) {
    @keyframes animate-toast-inner-from-#{$direction} {
        from {
            transform: $startTransform;
        }

        to {
            transform: translate3d(0, 0, 0);
        }
    }
}

@include animate-toast-inner-from(left, translate3d(-100%, 0, 0));
@include animate-toast-inner-from(right, translate3d(100%, 0, 0));
@include animate-toast-inner-from(top, translate3d(0, -100%, 0));
@include animate-toast-inner-from(bottom, translate3d(0, 100%, 0));

.toast-container {
    position: fixed;
    z-index: 99;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;

    pointer-events: none;

    .toasts {
        position: absolute;
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: $max-width;
        padding: $spacing-small / 2 $spacing-small;

        &[class*="top"] {
            top: 0;
            flex-direction: column-reverse;
            justify-content: flex-end;
        }

        &[class*="bottom"] {
            bottom: 0;
            flex-direction: column;
            justify-content: flex-end;
        }

        &[class*="left"] {
            left: 0;

            .toast-notification {
                .toast-notification-inner {
                    transform: translate3d(100vw, 0, 0);
                    animation-name: animate-toast-inner-from-left;
                }
            }
        }

        &[class*="right"] {
            right: 0;

            .toast-notification {
                .toast-notification-inner {
                    transform: translate3d(100vw, 0, 0);
                    animation-name: animate-toast-inner-from-right;
                }
            }
        }

        .toast-notification {
            pointer-events: all;

            width: 100%;
            max-height: 300px;

            box-sizing: border-box;

            margin: $spacing-small / 2 0;

            transition-property: max-height;

            color: white;

            will-change: transform;

            animation-name: animate-toast-outer;

            user-select: none;

            &[data-dismissing="true"] {
                max-height: 0;
                pointer-events: none;

                .toast-notification-inner {
                    opacity: 0;
                }
            }

            &[data-type="success"] {
                .toast-notification-inner {
                    background-color: $color-positive;
                }
            }

            &[data-type="error"] {
                .toast-notification-inner {
                    background-color: $color-negative;
                }
            }

            &[data-type="info"] {
                .toast-notification-inner {
                    background-color: $color-info;
                }
            }

            &[data-type="warning"] {
                .toast-notification-inner {
                    background-color: $color-warning;
                }
            }

            .toast-notification-inner {
                background-color: white;
                box-shadow: 2px 2px 10px rgba(black, 0.3);
                border-radius: $corner-radius-small;
                padding: $spacing-small;

                transition-property: opacity;
                animation-fill-mode: forwards;

                .toast-notification-top {
                    display: flex;
                    justify-content: space-between;
                    margin-bottom: $spacing-small;

                    .toast-dismiss {
                        cursor: pointer;
                    }
                }

                p.toast-timestamp {
                    font-size: 0.8rem;
                }

                p {
                    margin-bottom: 0;
                }

                img,
                video,
                iframe {
                    width: 100%;
                }
            }
        }
    }
}

@include screen-phone {
    .toast-container {
        .toasts {
            box-sizing: border-box;
            max-width: 100%;

            &[class*="top"] {
                .toast-notification {
                    .toast-notification-inner {
                        animation-name: animate-toast-inner-from-top;
                    }
                }
            }

            &[class*="bottom"] {
                .toast-notification {
                    .toast-notification-inner {
                        animation-name: animate-toast-inner-from-bottom;
                    }
                }
            }
        }
    }
}
@keyframes spin{
  0%{
    transform: rotate(0deg)
  }
  100%{
    transform: rotate(360deg)
  }
}

.data-list-container{
  height: 100%;
  overflow: hidden;
  position: relative;
  .data-list{
    height: 100%;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    &:not(.dragging){
      transition: transform 0.1s linear;
    }
    &.hide-flow{
      overflow: hidden;
    }
  }
  .refresh-indicator{
    position: absolute;
    background: transparent;
    top: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    i{
      display: inline-block;
      margin-right: 5px;
    }
  }
  &.refreshing{
    .data-list{
      overflow: hidden;
    }
    .refresh-indicator{
      transition: height 0.1s linear;
      overflow: hidden;
      i{
        animation: spin 0.3s infinite;
      }
    }
  }
}



@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.btn {
  position: relative;
  background-color: $gray-medium;
  color: white;
  padding: $field-padding-vertical $field-padding-horizontal;
  cursor: pointer;
  transition: all 0.1s;
  border: none;
  border-radius: $corner-radius-small;
  outline: none;
  user-select: none;

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

  .left-icon {
    margin-right: $spacing-xsmall;
  }

  .right-icon {
    margin-left: $spacing-xsmall;
  }

  &.rounded {
    border-radius: 30px;
  }

  &:disabled {
    opacity: 0.4;
    cursor: default;
  }

  &.icon-button-left {
    padding-left: $field-padding-horizontal;
  }

  &.icon-button-right {
    padding-right: $field-padding-horizontal;
  }

  &.shadow {
    @include button-shadow($gray-medium);
  }

  &:before {
    content: '';
    display: inline-block;
    width: 0;
    transition: 0.2s width;
  }

  &.pending {
    &:before {
      height: 10px;
      width: 25px;
    }

    &:after {
      position: absolute;
      left: $field-padding-horizontal;
      content: '';
      height: 15px;
      width: 15px;
      border-bottom: 1px solid white;
      border-radius: 50%;
      animation: spin 0.75s linear infinite;
    }
  }
}

%align {
  display: flex;
  flex-direction: row;
}

%wrap-row {
  flex-wrap: wrap;
}

%align-content-horizontal-center {
  @extend %align;
  justify-content: center;
}

%align-content-vertical-center {
  @extend %align;
  align-items: center;
}

%align-content-vertical-top {
  @extend %align;
  align-items: flex-start;
}

%align-content-vertical-bottom {
  @extend %align;
  align-items: flex-end;
}

%align-content-horizontal-left {
  @extend %align;
  justify-content: flex-start;
}

%align-content-horizontal-right {
  @extend %align;
  justify-content: flex-end;
}

%align-content-center-both {
  @extend %align-content-horizontal-center;
  @extend %align-content-vertical-center;
}

.grid {
  .row {
    display: flex;
    flex: 1 1 0%;

    .col {
      flex: 1 1 0%;
    }
  }

  &.fixed {
    flex: 0 1 0%;
  }
}

.grid,
.row,
.col {
  box-sizing: border-box;
  background-repeat: no-repeat;
  background-size: cover;

  // https://bugs.chromium.org/p/chromium/issues/detail?id=487302&desc=3
  // https://bugzilla.mozilla.org/show_bug.cgi?id=1043520
  min-height: 0;
  min-width: 0;
}

.wrap-row {
  @extend %wrap-row;
}

.align-con-h-center {
  @extend %align-content-horizontal-center;
}

.align-con-v-center {
  @extend %align-content-vertical-center;
}

.align-con-v-top {
  @extend %align-content-vertical-top;
}

.align-con-v-bottom {
  @extend %align-content-vertical-bottom;
}

.align-con-h-left {
  @extend %align-content-horizontal-left;
}

.align-con-h-right {
  @extend %align-content-horizontal-right;
}

.fill-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  flex: 1;
  justify-content: center;
}

.grid-debug {
  border: 1px dashed green;
  position: relative;

  > .row {
    border: 1px dashed blue;

    > .col {
      border: 1px dashed red;
    }
  }
}

.no-flex {
  flex: none !important;
}

.table-container {
  .table-titles {
    .title {
      font-weight: 500;
      font-size: $font-size-large;
    }
    .sub-title {
      font-weight: 300;
      font-size: $font-size-medium;
      color: $gray-base;
    }
    margin-bottom: $spacing-small;
  }

  .table-options-container {
    display: flex;
    flex: 1;
    align-items: center;
    padding: $spacing-small 0px;

    .table-options {
      flex: 1;
      display: flex;
      justify-content: flex-end;
      i {
        padding: 0px $spacing-small;

        &:last-of-type {
          padding-right: 0px;
        }

        &:hover {
          color: $color-info;
        }
        &:active {
          color: $color-positive;
        }
      }
    }
  }

  .table {
    border: 1px solid $gray-very-dark;
    border-collapse: collapse;
    width: 100%;
    .table-header {
      border: 1px solid $gray-very-dark;
      text-align: left;
      vertical-align: middle;

      tr {
        height: 40px;
        th {
          border: 1px solid $gray-very-dark;
        }
      }
    }

    .table-body {
      .table-row {
        text-align: left;
        vertical-align: middle;
        td {
          height: 20px;
          border: 1px solid $gray-very-dark;
        }
      }
    }
  }
}
.table-pagination {
  padding: $spacing-small;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  .pagination {
    justify-self: center;
  }

  .table-item-dropdown {
    display: flex;
    flex: 1;
    min-width: 100px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    select {
      margin-left: $spacing-small;
      flex: 1;
      min-width: 100px;
      padding: $spacing-small;
      border: none;
    }
  }
}

.table-filters {
  display: flex;
  flex: 1;
  flex-direction: row;
  align-items: center;

  .title {
    font-size: $font-size-medium;
    color: $gray-base;
    font-weight: 500;
  }

  .table-reset-filter-btn {
    background-color: transparent;
    color: $color-info;
  }
}

.table-filter-dialog-container {
  width: 50%;
  height: 50%;
}

