@import "./_variables";
@import "./_mixins";

@font-face {
  font-family: 'bpmn-js-pp';
  src: url(@font-eot);
  src: url(@font-eot) format('embedded-opentype'),
       url(@font-woff) format('woff'),
       url(@font-ttf) format('truetype'),
       url(@bpp-font-svg) format('svg');
  font-weight: normal;
  font-style: normal;
}


.bpp-properties-panel {
  .overlay();
  position: relative;

  &:empty {
    display: none;
  }

  label,
  input {
    vertical-align: middle;
  }

  button,
  input,
  select,
  textarea,
  [contenteditable] {
    font-size: 14px;
    padding: 3px 6px;
    border: 1px solid @bpp-input-border-color;

    &:focus {
      .focus();
    }

    &.invalid {
      .invalid();
      &:focus {
        box-shadow: 0 0 0 2px @bpp-error-shadow-color, 0 0 0 1px @bpp-error-shadow-inset-color inset;
      }
    }
  }

  [type=text],
  [contenteditable],
  textarea,
  select {
    width: 100%;
  }

  [contenteditable],
  textarea {
    resize: vertical;
  }

  [contenteditable] {
    min-height: 24px;

    outline: 0px solid transparent;
    background-color: @bpp-input-background-color;

    overflow-y: auto;

    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+ */

    &:before {
      content: "\feff";
    }
  }

  [disabled] {
    color: @bpp-input-disabled-color;
  }

  label {
    .label();

    margin-bottom: 3px;
  }

  .entry-label {
    .label();
    font-size: 16px;
    margin-top: 5px;
    margin-bottom: 10px;

    &.divider {
      border-top: 1px dotted @bpp-divider-color;
      padding-top: 8px;
      margin-top: 16px;
      width: 100%;
    }
  }

  .action-button {
    .action-button();
  }

  .bpp-checkbox {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;

    > .bpp-error-message {
      order: 1;
      width: 100%;
    }
  }

}

.bpp-error-message,
.bpp-error-message.bpp-entry-link {
  margin-top: 5px;
  color: @bpp-error-color;
}

.bpp-row {
  margin-top: 10px;
  margin-bottom: 10px;
  &:first-of-type {
    margin-top: 0;
  }
  &:last-of-type {
    margin-bottom: 0;
  }
}

.bpp-textfield,
.bpp-textbox,
.bpp-autosuggest-textbox {
  margin-bottom: 3px;
}

.bpp-autosuggest-list {
  position: fixed;
  min-width: 100px;
  box-shadow: 0 2px 4px 0 @bpp-autosuggest-shadow-color;
  border: solid 1px @bpp-autosuggest-border-color;
  background-color: @bpp-color-ffffff;
  z-index: 1;

  display: none;

  overflow-y: auto;
  max-height: 200px;

  &.active {
    display: block;
  }
}

.bpp-autosuggest-item {
  padding: 6px 3px;

  &:hover {
    background: @blue-base-65;
    color: @bpp-color-ffffff;
  }
}

.bpp-radios-group {
  list-style: none;
  padding: 0;
  margin: 0 0 9px 0;

  .bpp-radio-wrapper {
    margin: 6px 0;
  }

  input,
  label {
    vertical-align: middle;
  }

  input {
    margin-top: 0;
    margin-left: 0;
  }
}

.bpp-radios-group,
.bpp-checkbox {
  input {
    margin-left: 0;
  }

  label {
    &:after {
      display: none;
    }
  }
}

.bpp-textfield {
  input {
    padding-right: 28px;
  }

  .clear {
    background: transparent;
    border: none;
    top: 0;
    right: 0;
  }
}

.bpp-combo-input {
  margin-top: 7px;
}

.bpp-select {
  select {
    height: 23px;
  }
  .action-button.add {
    top: -22px;
    right: 0;
  }
}

.bpp-select,
.bpp-element-list {

  .action-button {
    &.add,
    &.clear {
      top: -23px;
      border-bottom: none;
    }
  }

  .action-button.add {
    right: 0px;
  }

  .action-button.clear {
    right: 23px;
  }
}

.bpp-properties-entry {
  margin-bottom: 9px;

  .bpp-field-wrapper {
    position: relative;

    input[readonly] + .clear {
      display: none;
    }

    select {
      resize: vertical;
    }
  }

  &.bpp-entry--warning {
    background-color: @bpp-entry-warning-background-color;
    border-top: solid 1px @bpp-entry-warning-border-color;
    border-bottom: solid 1px @bpp-entry-warning-border-color;
  }
}

.bpp-hidden {
  display: none;
}

label.bpp-hidden {
  .bpp-hidden;
}

.bpp-table-add-row {
  > .action-button {
    position: relative;
    margin-left: 10px;
  }
}

.bpp-table {
  margin-top: 10px;
}

.bpp-table-row {
  margin-bottom: 2px;
  overflow: hidden;

  > input,
  > .action-button {
    float: left;
  }

  > label {
    padding-left: 5px;
  }

  > label,
  > input {

    &.bpp-table-row-columns-1 {
      width: 100%;
      &.bpp-table-row-removable {
        width: ~"calc(100% - 24px)";
      }
    }

    &.bpp-table-row-columns-2 {
      width: 50%;
      box-sizing: border-box;
      &.bpp-table-row-removable {
        width: ~"calc(50% - 12px)";
      }
      &:nth-child(2) {
        border-left: none;
      }
    }

    &.bpp-table-row-columns-3 {
      width: 33%;
      box-sizing: border-box;
      &.bpp-table-row-removable {
        width: ~"calc(33% - 8px)";
      }
      &:not(:first-child) {
        border-left: none;
      }
    }
  }

  > .action-button {
    border-left: none;
    position: static;
  }
}

.bpp-properties-static {
  margin-bottom: 0;
  margin-top: 0;
  border: 1px solid @bpp-properties-static-border-color;
  background-color: @bpp-properties-static-background-color;
  padding: 3px 6px;
  font: 13.3333px Arial;
  width: 100%;
}

.bpp-entry-link {
  color: @bpp-primary-color;
  text-decoration: underline;

  &.bpp-entry-link-button {
    display: inline-block;
    padding: 3px 13px;
    background: @blue-base-65;
    color: @bpp-color-ffffff;
    border: solid 1px @blue-darken-62;
    border-radius: 100px;
    text-decoration: none;
  }
}

.bpp-icon-warning:before {
  .icon-font();
  content: '\E806';
}

.bpp-field-description {
  margin-top: 5px;
  color: @bpp-input-description-color;

  a {
    color: darken(@bpp-primary-color, 10%);
    text-decoration: none;

    &:hover {
      color: @bpp-primary-color;
    }
  }
}

.bpp-description {
  color: @bpp-input-description-color;
}

.bpp-collapsible {
  height: 19px;

  .bpp-field-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .bpp-collapsible__icon {
    display: block;

    padding-right: 2px;
  }

  .bpp-collapsible__icon:before {
    display: block;

    height: 16px;
    width: 16px;

    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpolygon fill='%23666666' fill-rule='evenodd' points='5 4.414 6.414 3 11.364 7.95 6.414 12.899 5 11.485 8.534 7.95'/%3E%3C/svg%3E%0A");
    transform: rotate(90deg);
  }

  &.bpp-collapsible--collapsed .bpp-collapsible__icon:before {
    transform: none;
  }

  .bpp-collapsible__title {
    display: block;
    margin: 0;
    padding-right: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  &:not(.bpp-collapsible--collapsed) .bpp-collapsible__title {
    padding-right: 0;
  }

  // make space for remove button
  &:not(.bpp-collapsible--collapsed) .bpp-collapsible__title:nth-last-child(3) {
    padding-right: 24px;
  }

  .bpp-collapsible__description {
    display: none;

    margin: 0;

    white-space: nowrap;
    color: @bpp-collapsible-description-color;
    font-weight: normal;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bpp-collapsible__description {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  &.bpp-collapsible--collapsed .bpp-collapsible__description {
    display: block;
  }

  .bpp-collapsible__remove {
    height: 24px;
    top: -4px;
    right: 0;
  }

  &.bpp-collapsible--collapsed .bpp-collapsible__remove {
    display: none;
  }
}

.bpp-collapsible ~ .bpp-properties-entry:not(.bpp-collapsible):not(.bpp-collapsible-break) {
  margin-left: 18px;
}

.bpp-process-variables {

  &.bpp-process-variables__description {
    margin-bottom: 16px;
  }

  &.bpp-process-variables__scope-title {
    font-size: 13px;
    font-weight: 600;
    color: @bpp-color-666666;
    margin-bottom: 16px;
  }

  &.bpp-process-variables__created-in {
    .bpp-process-variables__created-in-item {
      margin-bottom: 4px;
      margin-top: 4px;
    }
  }
}

.bpp-collapsible ~ .bpp-properties-entry.bpp-input-output {
  margin-left: 0;
}

.bpp-collapsible--with-mapping .bpp-collapsible__description:not(:empty) {
  position: relative;

  // make space for icon
  text-indent: 24px;
  padding-right: 24px;
}

.bpp-collapsible--with-mapping .bpp-collapsible__description:not(:empty):before {
  position: absolute;
  top: -1px;
  left: -24px;

  display: block;
  width: 16px;
  height: 16px;

  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpolygon fill='%23909090' fill-rule='evenodd' points='8 3 8 7 15 7 15 9 8 9 8 13 2 8'/%3E%3C/svg%3E");
  opacity: 0.7;
}

.bpp-input-output {
  .bpp-input-output__add {
    top: -28px;
    right: 0;
  }
}

.bpp-input-output-placeholder {
  padding-bottom: 3px;
  font-size: 14px;
}

.bpp-collapsible--with-template-out .bpp-collapsible__description:not(:empty):before {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpolygon fill='%23909090' fill-rule='evenodd' points='15 8 9 13 9 9 2 9 2 7 9 7 9 3'/%3E%3C/svg%3E");
}

.bpp-toggle-switch {

  .bpp-field-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .bpp-field-wrapper.bpp-hidden {
    .bpp-hidden;
  }

  .bpp-toggle-switch__label {
    margin: 0;
    margin-left: 6px;
  }

  .bpp-toggle-switch__switcher {
    position: relative;
    width: 48px;
    height: 20px;

    input[type='checkbox'] {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .bpp-toggle-switch__slider {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: @silver-darken-80;
      -webkit-transition: 0.4s;
      transition: 0.4s;
      border-radius: 34px;

      &:before {
        position: absolute;
        content: "";
        height: 16px;
        width: 16px;
        left: 2px;
        bottom: 2px;
        background-color: white;
        -webkit-transition: 0.4s;
        transition: 0.4s;
        border-radius: 50%;
      }
    }

    input[type='checkbox']:checked + .bpp-toggle-switch__slider {
      background-color: @blue-base-65;
      box-shadow: 0 0 1px @blue-base-65;

      &:before {
        -webkit-transform: translateX(28px);
        -ms-transform: translateX(28px);
        transform: translateX(28px);
      }
    }
  }
}

@import "./header";
@import "./groups";
@import "./listeners";
@import "./tabs";
