@import './vars';

.keyframes(@name; @arguments) {
  @-moz-keyframes @name { @arguments(); }
  @-webkit-keyframes @name { @arguments(); }
  @keyframes @name { @arguments(); }
}

.animation(@arguments) {
  -webkit-animation: @arguments;
  -moz-animation: @arguments;
  animation: @arguments;
}

@keyframes fadeIn {
  0% {
    opacity:0;
  }
  100% {
    opacity:1;
  }
}

.fade-in-animation() {
  animation: fadeIn ease .75s;
  -webkit-animation: fadeIn ease .75s;
  -moz-animation: fadeIn ease .75s;
  -o-animation: fadeIn ease .75s;
  -ms-animation: fadeIn ease .75s;
}

@keyframes fadeValid {
  0% {
    background-color: @color-white;
  }

  33%, 66% {
    background-color: #e9f8f3;
  }

  100% {
    background-color: @color-white;
  }
}

.input-valid-fade-animation() {
  animation: fadeValid ease 2s;
  -webkit-animation: fadeValid ease 2s;
  -moz-animation: fadeValid ease 2s;
  -o-animation: fadeValid ease 2s;
  -ms-animation: fadeValid ease 2s;
}

@keyframes selectFadeValid {
  0% {
    border-color: @color-gray-300;
    background-color: @color-white;
  }

  33%, 66% {
    border-color: @color-primary;
    background-color: #e9f8f3;
  }

  100% {
    border-color: @color-gray-300;
    background-color: @color-white;
  }
}

.select-valid-fade-animation() {
  animation: selectFadeValid ease 2s;
  -webkit-animation: selectFadeValid ease 2s;
  -moz-animation: selectFadeValid ease 2s;
  -o-animation: selectFadeValid ease 2s;
  -ms-animation: selectFadeValid ease 2s;
}

@keyframes fadeInvalid {
  0% {
    background-color: @color-white;
  }

  33%, 66% {
    background-color: #ffedec;
  }

  100% {
    background-color: @color-white;
  }
}

.input-invalid-fade-animation() {
  animation: fadeInvalid ease 2s;
  -webkit-animation: fadeInvalid ease 2s;
  -moz-animation: fadeInvalid ease 2s;
  -o-animation: fadeInvalid ease 2s;
  -ms-animation: fadeInvalid ease 2s;
}

.remove-button-styles() {
  background-color: white;
  border: none;
  outline: none;
}

.placeholder-font-size(@arguments) {
  &::-webkit-input-placeholder {font-size: @arguments !important;}
  &::-moz-placeholder {font-size: @arguments !important;}
  &:-ms-input-placeholder {font-size: @arguments !important;}
  &::placeholder {font-size: @arguments !important;}
}

.placeholder-input(@fontSize, @fontFamily, @color, @lineHeight) {
  &::-webkit-input-placeholder {
    font-size: @fontSize;
    font-family: @fontFamily !important;
    color: @color !important;
    line-height: @lineHeight !important;
  };
  &::-moz-placeholder {
    font-size: @fontSize;
    font-family: @fontFamily !important;
    color: @color !important;
    line-height: @lineHeight !important;
  };
  &:-ms-input-placeholder {
    font-size: @fontSize;
    font-family: @fontFamily !important;
    color: @color !important;
    line-height: @lineHeight !important;
  };
  &::placeholder {
    font-size: @fontSize;
    font-family: @fontFamily !important;
    color: @color !important;
    line-height: @lineHeight !important;
  };
}

.poper() {
  background-color: @color-gray-500;
  border-radius: 2px;
  color: @color-white;
  border: solid 1px @color-gray-500;
  font-family: @font-family;
  padding: 16px;
  position: relative;
  text-align: left;
  box-shadow: none;
  margin-top: 10px;
  margin-bottom: 10px;

  &[x-placement^="bottom"] {
    [x-arrow] {
      &:before {
        content: '';
        position: absolute;
        left: -10px;
        top: -5px;
        border-bottom: 15px solid @color-gray-500;
        border-right: 15px solid transparent;
        border-left: 15px solid transparent;
        z-index: 1;
      }

      &:after {
        content: '';
        position: absolute;
        left: -10px;
        top: -5px;
        border-bottom: 15px solid @color-gray-500;
        border-right: 15px solid transparent;
        border-left: 15px solid transparent;
        z-index: 2;
      }
    }
  }

  &[x-placement^="top"] {
    [x-arrow] {
      &:before {
        content: '';
        position: absolute;
        left: -14px;
        bottom: -5px;
        border-top: 15px solid @color-gray-500;
        border-right: 15px solid transparent;
        border-left: 15px solid transparent;
        z-index: 1;
      }

      &:after {
        content: '';
        position: absolute;
        left: -14px;
        bottom: -5px;
        border-top: 15px solid @color-gray-500;
        border-right: 15px solid transparent;
        border-left: 15px solid transparent;
        z-index: 2;
      }
    }
  }

  &[x-placement^="right"] {
    [x-arrow] {
      &:before {
        content: '';
        position: absolute;
        top: -14px;
        left: -5px;
        border-right: 15px solid @color-gray-500;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        z-index: 1;
      }

      &:after {
        content: '';
        position: absolute;
        top: -14px;
        left: -5px;
        border-right: 15px solid @color-gray-500;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        z-index: 2;
      }
    }
  }

  &[x-placement^="left"] {
    [x-arrow] {
      &:before {
        content: '';
        position: absolute;
        top: -14px;
        right: -5px;
        border-left: 15px solid @color-gray-500;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        z-index: 1;
      }

      &:after {
        content: '';
        position: absolute;
        top: -14px;
        right: -5px;
        border-left: 15px solid @color-gray-500;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        z-index: 2;
      }
    }
  }
}
.poper-white-default-background() {
  border: none !important;
  background-color: @color-white !important;
  box-shadow: 0 8px 15px 0 rgba(152,169,188,0.27) !important;
  color: @color-dark;
}

.poper-white() {
  .poper();
  .poper-white-default-background();

  &[x-placement^="bottom"] {
    [x-arrow] {
      &:before {
        content: '';
        position: absolute;
        left: -14px;
        top: -5px;
        border-bottom: 15px solid @color-white;
        border-right: 15px solid transparent;
        border-left: 15px solid transparent;
        z-index: 1;
      }

      &:after {
        content: '';
        position: absolute;
        left: -14px;
        top: -5px;
        border-bottom: 15px solid @color-white;
        border-right: 15px solid transparent;
        border-left: 15px solid transparent;
        z-index: 2;
      }
    }
  }

  &[x-placement^="top"] {
    [x-arrow] {
      &:before {
        content: '';
        position: absolute;
        left: -14px;
        bottom: -5px;
        border-top: 15px solid @color-white;
        border-right: 15px solid transparent;
        border-left: 15px solid transparent;
        z-index: 1;
      }

      &:after {
        content: '';
        position: absolute;
        left: -14px;
        bottom: -5px;
        border-top: 15px solid @color-white;
        border-right: 15px solid transparent;
        border-left: 15px solid transparent;
        z-index: 2;
      }
    }
  }

  &[x-placement^="right"] {
    [x-arrow] {
      &:before {
        content: '';
        position: absolute;
        top: -14px;
        left: -5px;
        border-right: 15px solid @color-white;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        z-index: 1;
      }

      &:after {
        content: '';
        position: absolute;
        top: -14px;
        left: -5px;
        border-right: 15px solid @color-white;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        z-index: 2;
      }
    }
  }

  &[x-placement^="left"] {
    [x-arrow] {
      &:before {
        content: '';
        position: absolute;
        top: -14px;
        right: -5px;
        border-left: 15px solid @color-white;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        z-index: 1;
      }

      &:after {
        content: '';
        position: absolute;
        top: -14px;
        right: -5px;
        border-left: 15px solid @color-white;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        z-index: 2;
      }
    }
  }
}

.ds-notification-demo-body() {
  .ds-notification-demo-body {
    .ds-notification-demo-title {
      height: 19px;
      color: @color-dark;
      font-family: Roboto, sans-serif;
      font-size: 16px;
      letter-spacing: 0.2px;
      line-height: 19px;
      margin-bottom: 1px;
    }

    .ds-notification-demo-description {
      height: 21px;
      color: @color-gray-400;
      font-family: Roboto, sans-serif;
      font-size: 14px;
      letter-spacing: 0.2px;
      line-height: 21px;

      .ds-notification-demo-description-backlit {
        height: 21px;
        color: @color-primary;
        font-family: 'Roboto Medium';
        font-size: 14px;
        letter-spacing: 0.2px;
        line-height: 21px;
      }
    }
  }
}

.alternative-placeholder-wrapper() {
  .alternative-placeholder() {
    color: @color-gray-400;
    font-family: Roboto, sans-serif;
    font-size: 14px !important;
    letter-spacing: 0;
    line-height: 16px;
  }

  &::-webkit-input-placeholder {
    .alternative-placeholder();
  }

  &::-moz-placeholder {
    .alternative-placeholder();
  }

  &:-ms-input-placeholder {
    .alternative-placeholder();
  }

  &::placeholder {
    .alternative-placeholder();
  }
}
