/**
 * Bookit Forms
 */

// Form Fields
::-webkit-input-placeholder,
:-ms-input-placeholder,
::placeholder {
  opacity: 0.5;
}
button,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea {
  &:focus, &:hover {
    resize: none;
    outline: none;
    box-shadow: none;
  }
}
select {
  &:focus, &:hover {
    resize: none;
    outline: none;
    box-shadow: none;
  }
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"] {
  &:not(.bookit-filter-input){
    height: 45px;
    width: 100%;
  }
  border-radius: 4px;
  border: solid 1px $grey;
  background-color: $white;
  @include normal-font;
  line-height: normal;
  color: $black;
  padding: 10px 18px;
  margin: 0;
  &:disabled {
    background-color: #eeeeee;
  }
  &.error{
    border: 1px solid $red;
  }
}
textarea {
  height: auto;
  line-height: 23px;
  width: 100%;
  border-radius: 4px;
  border: solid 1px $grey;
  background-color: $white;
  @include normal-font;
  color: $black;
  padding: 10px 18px;
  margin: 0;
  &:disabled {
    background-color: #eeeeee;
  }
  &.error{
    border: 1px solid $red;
  }
}

input[type="radio"] {
  margin: 0 .5rem 0 0;
}
input[type="checkbox"]{
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid $base-color;
  margin-bottom: 0;
  &:checked{
    background-color: $base-color;
    box-shadow: none;
    &:before{
      width: 100%;
      height: 100%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background-image: url("../icons/checkbox_correct.svg");
      background-repeat: no-repeat;
      background-size: 16px 16px;
      margin:0;
      content: '';
    }
  }
}

::-webkit-input-placeholder { /* Edge */
  opacity: 0.4;
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
  opacity: 0.4;
}
::placeholder {
  opacity: 0.4;
}

.form-group {
  margin-bottom: 20px;
  padding: 0;
  &.info{
    font-size: 16px;
  }
  &.create-wp-user-action{
    display: inline-flex;
    button{
      position: relative;
      display: inline-flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      text-decoration: none;
      border-radius: 4px;
      border: none;
      font-size: 12px;
      line-height: 20px;
      height:45px ;
      text-transform: uppercase;
      &.add-wp-user-btn{
        width: 30%;
        color: $white;
        background: $base-color;
        .add-icon{
          content: "";
          -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
          -webkit-mask-position: center;
          mask-position: center;
          width: 22px;
          height: 18px;
          display: block;
          float: left;
          margin-right: 5px;
          background-color:$white;
          -webkit-mask-image: url("../icons/add.svg");
          mask-image: url("../icons/add.svg");
        }
      }
      &.cancel-btn{
        width: 40%;
        margin-left: 10px;
        color: $base-color;
        border: 1px solid $base-color;
        background: none;
      }
      &:hover{
        opacity: 0.9;
      }
    }
  }
  label {
    display: block;
    text-transform: uppercase;
    @include small-font;
    color: $black;
    font-weight: bold;
    margin-bottom: 10px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    &.staff-services-label {
      @include smaller-font;
      display: flex;
      align-items: center;
      margin: 5px 0;
      &.working-hours-label {
        margin: 12px 0;
      }
    }
    &.send-notification-label {
      @include normal-font;
      font-weight: normal;
      display: flex;
      align-items: center;
      margin-bottom: 20px;
      text-transform: none;
      span{
        padding-left: 5px;
      }
    }
    &.help-label{
      display: inline-flex;
      align-items: center;
    }
    &.gc-label{
      text-transform: capitalize;
      font-size: 16px;
      margin-bottom: 20px;
    }
  }
  input[type=number]::-webkit-outer-spin-button,
  input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  input[type=number] {
    -moz-appearance:textfield;
  }
  select {
    display: table-cell;
    vertical-align: middle;
    cursor: pointer;
    border-radius: 4px;
    border: solid 1px $grey;
    color: $black;
    background-color: $white;
    padding: 10px 20px 10px 10px;
    height: 45px;
    width: 100%;
    max-width: 100%;
    background-position: 95% 50%;
    box-sizing: border-box;
    @include normal-font;
    line-height: normal;
    &::-ms-expand {
      display: none;
    }
    &:focus, &:hover {
      outline: none;
    }
    &.width-auto {
      width: auto;
      display: inline-block;
    }
    &.start-time,&.end-time{
      width: 45%;
    }
    &.end-time{
      float: right;
    }
    &.error{
      border: 1px solid $red;
    }
  }

  .staff-services{
    display: inline-flex;
  }
  .staff-wp-user{
    display: inline-flex;
    justify-content: space-between;
    width: 100%;
    select{
      width: calc(80% - 20px);
    }
    .add-wp-user-btn{
      width: 20%;
    }
    .error-tip{
      margin-right: 0;
    }
  }
  .help-label-block{
    position: relative;
    display: inline-flex;
    justify-content: flex-start;
    align-items:center;
    width: 100%;
    margin-bottom: 10px;
    label{
      flex-basis: content;
      margin-bottom: 0;
    }
    .help{
      position: absolute;
      z-index: 2;
      background-color: $white;
      bottom: 0;
      margin-bottom: 24px;
      border-radius:4px;
      .help-tip {
        font-size: 14px;
        line-height: 20px;
        background-color: rgba(0, 102, 102, 0.1);
        border-radius: 4px;
        -moz-border-radius: 4px;
        -webkit-border-radius: 4px;
        color: $base-color;
        padding: 10px 10px;
        text-align: center;
        box-sizing: border-box;
      }
    }
  }
  .input-type-number-wrapper {
    position: relative;
    .down {
      content: '';
      width: 0;
      height: 0;
      display: block;
      position: absolute;
      z-index: 10;
      border: 0;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-top: 6px solid $black;
      right: 0;
      top: 28px;
      margin-right: 10px;
    }
    .up {
      content: '';
      width: 0;
      height: 0;
      display: block;
      position: absolute;
      z-index: 10;
      border: 0;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-bottom: 6px solid $black;
      right: 0;
      top: 12px;
      margin-right: 10px;
    }
  }

  &.wp-media {
    a {
      display: inline-block;
      vertical-align: top;
      padding: 8px 10px;
      background: $green;
    }
    img {
      display: inline-block;
      max-width: 100px;
      max-height: 100px;
      margin-right: 10px;
    }
  }
  + .form-group:not(.no-margin) {
    margin-left: 20px;
    &.big-margin {
      margin-left: 50px;
    }
  }
  &.small-bottom-margin {
    margin-bottom: 10px;
  }
  &.no-bottom-margin {
    margin-bottom: 0;
  }
  .input-group {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    width: 100%;
    > input {
      position: relative;
      -webkit-box-flex: 1;
      -ms-flex: 1 1 auto;
      flex: 1 1 auto;
      width: 1%;
      margin-bottom: 0;
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
    .input-group-append {
      margin-left: -1px;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      button {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
      }
    }
    &.error{
      border: 1px solid $red;
      border-radius: 4px;
      margin: 0;
      padding: 0;
    }
  }
  .appointment-time{
    display: inline-flex;
    width: 100%;
    select{
      width: calc(50% - 10px);
      background-position: 90% 50%;
      &.end-time{
        margin-left: 20px;
      }
    }
  }
  .gc-data{
    display: flex;
    flex-wrap: wrap;
    position: relative;
    min-height: 45px;
    div{
      flex-basis: 100%;
    }
  }
}

.appointment-form{
  .input-type-number-wrapper {
    .down {
      margin-right: 30px;
    }
    .up {
      margin-right: 30px;
    }
  }
  .bookit-row{
    .form-group{
      select {
        option[value=""] { color: #A9A9A9; }
      }
      margin-left: 0;
      &.customer-action{
        display: inline-flex;
        &.registered{
          margin-top: 24px;
        }
      }

      input, select {
        width: calc(100% - 20px);
      }
      .error-tip{
        margin-right: 20px;
      }
      button{
        position: relative;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        text-decoration: none;
        border-radius: 4px;
        border: none;
        font-size: 12px;
        line-height: 20px;
        height:45px ;
        text-transform: uppercase;
        &.add-customer-btn{
          width: 30%;
          color: $white;
          background: $base-color;
          &:hover{
            opacity: 0.9;
          }
        }
        &.cancel-btn{
          width: 40%;
          margin-left: 10px;
          color: $base-color;
          border: 1px solid $base-color;
          background: none;
          &:hover{
            opacity: 0.7;
          }
        }
        .add-icon{
          content: "";
          -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
          -webkit-mask-position: center;
          mask-position: center;
          width: 22px;
          height: 18px;
          display: block;
          float: left;
          margin-right: 5px;
          background-color:$white;
          -webkit-mask-image: url("../icons/add.svg");
          mask-image: url("../icons/add.svg");
        }
      }

      .appointment-customer{
        display: inline-flex;
        justify-content: space-between;
        width: 100%;
        .search-customer{
          position:relative;
          width: calc(80% - 20px);
          .customer {
              width: 100%;
          }
          .autocomplete {
            margin-top: 2px;
            border-radius: 4px;
            .autocomplete-list{
              border: none;
              border-radius: 4px;
            }
          }
          .search-icon {
            position: absolute;
            width: 15px;
            height: 15px;
            position: absolute;
            right: 20px;
            top: 14px;
            background: $black;
            -webkit-mask-image: url("../icons/search.svg");
          }
        }
        .add-customer-btn{
          text-transform: uppercase;
          width: 20%;
          color: $white;
          background: $base-color;
        }
        .error-tip{
          margin-right: 0;
        }
      }
    }
  }

}
.form-date{
  position: relative;
}

@import 'button';
/**
 * Date style for Chrome
 */
input[type="date"]::-webkit-datetime-edit{
  line-height: normal;
}
input[type="date"]::-webkit-calendar-picker-indicator{
  padding: 0;
  background-image: url("../icons/calendar.svg");
  margin-right: -10px;
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper{
  padding: 0;
}
// todo create crossbrowser compatability for date

