/**
 * DataTable
 */
.datatable-wrapper {
  position: relative;
  min-height: 600px;
  overflow-x: auto;
  table {
    border-collapse: collapse;
    width: 100%;
    color: $black;
    thead {
      background: $base-bg-color;
      border-bottom: 1px solid #eeeeee;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      th {
        padding: 10px;
        @include small-font;
        font-weight: bold;
        text-transform: uppercase;
        &:first-child {
          padding-left: 20px;
        }
        &:last-child {
          padding-right: 20px;
          width: 5%;
        }
        .arrow-up-down {
          display: inline-block;
          background: url("../icons/arrow-up-down.svg") no-repeat center;
          background-size: contain;
          width: 13px;
          height: 14px;
          vertical-align: bottom;
        }
        &.staff-service{
          width:20%;
        }
      }
    }

    tbody {
      tr {
        border-bottom: 1px solid #eeeeee;
        td {
          padding: 10px;
          @include normal-font;

          &:first-child {
            padding-left: 20px;
            min-width: 100px;
          }
          &:last-child {
            padding-right: 20px;
            width: 15%;
          }
          &.text-bold {
            color: $base-color;
          }
          &.column-id {
            min-width: auto;
          }

          .status {
            text-transform: capitalize;
            border-radius: 4px;
            border: none;
            padding: 10px 20px;
            line-height: 16px;
            font-weight: 500;
            color: $base-color;
            &.payment {
              display: inline-block;
              padding: 2px 5px;
              text-transform: none;
              margin-top: 5px;
              @include small-font;
            }
            &.pending-payment,
            &.pending-appointment {
              background: rgba(255, 212, 0, 0.3);
            }
            &.cancelled-appointment {
              background: rgba(217, 65, 65, 0.2);
            }
            &.complete-payment,
            &.approved-appointment {
              background: rgba(44, 191, 112, 0.2);
            }
          }

          .wh-day {
            display: inline-block;
            vertical-align: bottom;
            padding: 2px 10px;
            border-radius: 4px;
            background: $green;
            font-size: 12px;
            line-height: 15px;
            font-weight: 300;
            color: $white;
            margin: 0 0 4px 4px;
            span {
              display: block;
            }
            &.off {
              padding: 9.5px 10px;
              font-size: 10px;
              background: rgba(39, 39, 39, 0.5);
            }
          }

          .actions {
            color: $black;
            &:not(.appointment){
              display: inline-flex;
              width: 100%;
              column-gap: 10px;
              justify-content: center;
            }
            button{
              cursor: pointer;
              text-decoration: none;
              border-radius: 4px;
              border: none;
              @include smaller-font;
              transition: ease-in 0.1s;
              width:30px;
              height:30px ;
              padding:0;
              margin-left: unset;
              &:before{
                content: "";
                padding: 7px 8px;
                -webkit-mask-repeat: no-repeat;
                mask-repeat: no-repeat;
                -webkit-mask-position: center;
                mask-position: center;
                clip-path: padding-box inset(0.28125em 0);
              }
              &.edit-btn{
                color: $base-color;
                background: rgba(0, 102, 102, 0.1);
                &:before{
                  padding: 6px 9px;
                  background-color:$base-color;
                  -webkit-mask-image: url("../icons/edit.svg");
                  mask-image: url("../icons/edit.svg");
                }
                &:hover{
                  background: rgba(0, 102, 102, 0.2);
                }
              }
              &.delete-btn{
                color: $red;
                background: rgba(217, 65, 65, 0.1);
                &:before{
                  background-color:$red;
                  -webkit-mask-image: url("../icons/delete_red.svg");
                  mask-image: url("../icons/delete_red.svg");
                }
                &:hover{
                  background: rgba(217, 65, 65, 0.2);
                }
              }
            }

            a {
              color: $black;
              text-decoration: none;
              opacity: 0.5;
              span {
                display: inline-block;
                background-size: contain;
                width: 19px;
                height: 19px;
                vertical-align: bottom;
                &.edit-icon {
                  background: url("../icons/edit.svg") no-repeat center;
                }
                &.delete-icon {
                  background: url("../icons/delete.svg") no-repeat center;
                  width: 16px;
                }
              }
              &:hover {
                opacity: 0.8;
              }
            }

            &.appointment {
              display: inline-flex;
              width:100%;
              justify-content: flex-end;
              align-items: center;
              .past{
                display: inline-flex;
                width:100%;
                align-items: center;
                justify-content: space-between;
              }
              .past-title{
                opacity: 0.5;
                font-size: 16px;
                font-weight: 400;
              }
              button{
                display: inline-flex;
                justify-content: center;
                align-items: center;
                height: 36px;
                padding-right: 16px;
                font-weight: 500;
                text-transform: capitalize;
                margin-left: 10px;
                width: fit-content;
                &:first-child{
                  margin-left: 0;
                }
                @include smaller-font;
                font-size: 16px;

                &.button-light {
                  background: $base-bg-color;
                  color: $base-color;
                  cursor: default;
                  font-weight: 500;
                }
                &.delete-btn {
                  width: 36px;
                  height: 36px;
                  color: $red;
                  background: rgba(217, 65, 65, 0.1);
                  padding:0;
                  &:before{
                    position: absolute;
                    content: "";
                    width:16px;
                    height: 20px;
                    background-color:$red;
                    -webkit-mask-image: url("../icons/delete_red.svg");
                    mask-image: url("../icons/delete_red.svg");
                    -webkit-mask-repeat: no-repeat;
                    mask-repeat: no-repeat;
                    mask-size: 16px 20px;
                    -webkit-mask-size: 16px 20px;
                  }
                }
                &.edit-btn{
                  width: 36px;
                  height: 36px;
                  background: $base-bg-color;
                  padding:0;
                  &:before{
                    position: absolute;
                    content: "";
                    width:16px;
                    height: 15px;
                    background-color: $base-color;
                    -webkit-mask-image: url("../icons/edit.svg");
                    mask-image: url("../icons/edit.svg");
                    -webkit-mask-repeat: no-repeat;
                    mask-repeat: no-repeat;
                    mask-size: 15px 15px;
                    -webkit-mask-size: 15px 15px;
                  }
                }
                &.view-btn{
                  width: 36px;
                  height: 36px;
                  background: $base-bg-color;
                  padding:0;
                  &:before{
                    position: absolute;
                    content: "";
                    width:20px;
                    height: 13px;
                    background-color: $base-color;
                    -webkit-mask-image: url("../icons/view.svg");
                    mask-image: url("../icons/view.svg");
                    -webkit-mask-repeat: no-repeat;
                    mask-repeat: no-repeat;
                    mask-size: 20px 13px;
                    -webkit-mask-size: 20px 13px;
                  }
                }
                .check-icon {
                  background: url("../icons/check.svg") no-repeat center;
                  background-size: contain;
                  width: 18px;
                  height: 18px;
                  margin-right: 10px;
                }
                .reject-icon {
                  background: url("../icons/reject.svg") no-repeat center;
                  background-size: contain;
                  width: 18px;
                  height: 18px;
                  margin-right: 10px;
                }
                .edit-icon {
                  display: inline-block;
                  background: url("../icons/edit.svg") no-repeat center;
                  background-size: contain;
                  width: 15px;
                  height: 15px;
                  vertical-align: bottom;
                }
                .delete-icon {
                  display: inline-block;
                  background: url("../icons/delete.svg") no-repeat center;
                  background-size: contain;
                  width: 15px;
                  height: 15px;
                  vertical-align: bottom;
                }
              }
            }

          }

        }
      }
    }
  }

  .appointment-filters{
    display: inline-flex;
    align-items: center;
    height: 60px;
    padding: 0;
    width: 100%;
    .filter-field{
      margin-left: 10px;
      &.col-1{
        flex-basis: 8.33%;
      }
      &.col-2{
        flex-basis: 16.66%;
      }
      &.col-3{
        flex-basis: 25%;
      }
      &.col-4{
        flex-basis:33.33%
      }
      &.col-6{
        flex-basis: 50%;
      }
      &.col-12{
        flex-basis: 100%;
      }

      .bookit-filter-input{
        width: 100%;
      }
      &.date-range{
        label{
          display: none;
        }
        .date-time-picker{
          .field{
            &:before{
              width: 18px;
              height: 18px;
              content: " ";
              position: absolute;
              left: 10px;
              top:calc(100% - 30px);
              background: url("../icons/filter-calendar.svg") no-repeat;
              background-size: 18px 18px;
              z-index:1;
              opacity: 0.4;
            }
            &:not(.has-value){
              &:after{
                width: 18px;
                height: 18px;
                content: " ";
                position: absolute;
                right: 20px;
                background-color:rgba(0, 0, 0, 0.5);
                -webkit-mask-image: url("../icons/select-arrow.svg");
                mask-image: url("../icons/select-arrow.svg");
                -webkit-mask-repeat: no-repeat;
                mask-repeat: no-repeat;
                -webkit-mask-position: right;
                mask-position: right;
                background-size: 18px 18px;
                z-index:1;
                opacity: 0.7;
              }
            }

            .custom-button{
              .custom-button-effect{
                width: 23px;
                height: 23px;
              }
              .custom-button-content{
                margin-left: 1px;
              }
            }
            input{
              padding-left: 38px;
            }
          }
        }
      }
      &:first-child{
        margin-left: 20px;
      }
      input{
        height: 40px;
      }
    }
  }
  &.appointments{
    table{
      table-layout: auto;
      thead {
        th {
          &:first-child {
            width: 40px;
          }
        }
      }
      tbody{
        tr{
          td{
            font-size: 16px;
            &:first-child {
              min-width: 40px;
            }
            &.customer{
              span{
                display:block;
                width: 100%;
              }
            }
            &.appointment-payment{
              b{
                display: block;
                width: 100%;
                font-size: 16px;
                font-weight: 400;
              }
            }
            &.appointment-status{
                text-transform: capitalize;
                font-size: 16px;
                font-weight: 400;
                div{
                  display: inline-flex;
                  .pending-appointment{
                    margin-right: 5px;
                    display: inline-block;
                    position: relative;
                    border-radius: 50%;
                    width: 18px;
                    height: 18px;
                    background-color: #ffd400;
                    box-sizing: border-box;
                    &:after{
                      position: absolute;
                      content: '';
                      right: 4px;
                      top:4px;
                      width: 10px;
                      height: 10px;
                      background-color: $black;
                      -webkit-mask-image: url("../icons/clock_circular.svg");
                      mask-image: url("../icons/clock_circular.svg");
                      -webkit-mask-repeat: no-repeat;
                      mask-repeat: no-repeat;
                      -webkit-mask-position: center;
                      mask-position: center;
                      mask-size: 10px 10px;
                      -webkit-mask-size: 10px 10px;
                      z-index:1;
                    }
                  }
                  .approved-appointment{
                    margin-right: 5px;
                    display: inline-block;
                    position: relative;
                    border-radius: 50%;
                    width: 18px;
                    height: 18px;
                    background-color: $base-color;
                    box-sizing: border-box;
                    &:after{
                      position: absolute;
                      content: '';
                      right: 4px;
                      top:4px;
                      width: 10px;
                      height: 10px;
                      background-color: $white;
                      -webkit-mask-image: url("../../frontend/icons/validation-success.svg");
                      mask-image: url("../../frontend/icons/validation-success.svg");
                      -webkit-mask-repeat: no-repeat;
                      mask-repeat: no-repeat;
                      -webkit-mask-position: center;
                      mask-position: center;
                      mask-size: 10px 10px;
                      -webkit-mask-size: 10px 10px;
                      z-index:1;
                    }
                  }
                  .complete-appointment{
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    margin-right: 5px;
                    position: relative;
                    border-radius: 50%;
                    width: 18px;
                    height: 18px;
                    box-sizing: border-box;
                    &:after{
                      position: absolute;
                      content: '';
                      width: 10px;
                      height: 10px;
                      background-color: $base-color;
                      -webkit-mask-image: url("../../frontend/icons/validation-success.svg");
                      mask-image: url("../../frontend/icons/validation-success.svg");
                      -webkit-mask-repeat: no-repeat;
                      mask-repeat: no-repeat;
                      -webkit-mask-position: center;
                      mask-position: center;
                      mask-size: 10px 10px;
                      -webkit-mask-size: 10px 10px;
                      z-index:1;
                    }
                  }
                  .cancelled-appointment{
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    margin-right: 5px;
                    position: relative;
                    border-radius: 50%;
                    width: 18px;
                    height: 18px;
                    border: 1px solid $red;
                    box-sizing: border-box;
                    &:after{
                      position: absolute;
                      content: '';
                      width: 8px;
                      height: 8px;
                      background-color: $red;
                      -webkit-mask-image: url("../icons/cross.svg");
                      mask-image: url("../icons/cross.svg");
                      -webkit-mask-repeat: no-repeat;
                      mask-repeat: no-repeat;
                      -webkit-mask-position: center;
                      mask-position: center;
                      mask-size: 8px 8px;
                      -webkit-mask-size: 8px 8px;
                      z-index:1;
                    }
                  }
                }
            }
          }
        }
      }
    }
  }

  &.cancelled-appointments,
  &.approved-appointments {
    tbody {
      tr {
        td {
          &.appointment-actions {
            //min-width: 150px;
            .edit-button {
              display: none;
            }
          }
        }
      }
    }
  }
  &.pending-appointments {
    tbody {
      tr {
        td {
          &.appointment-actions {
            min-width: 210px;
            .edit-button {
              display: none;
            }
          }
        }
      }
    }
  }
}

/**
 * Pagination
 */
.pagination {
  text-align: left;
  padding: 10px 20px 15px;
  ul {
    display: inline-block;
    padding-left: 0;
    > li {
      display: inline;
      padding: 10px 15px;
      border-radius: 4px;
      border: solid 1px $grey;
      @include normal-font;
      &:only-child {
        display: none;
      }
      + li {
        margin-left: 10px;
      }
      &.active {
        background: $base-color;
        border: solid 1px $base-color;
        color: $white;
      }
    }
  }
}

.no-results {
  text-align: center;
  @include big-font;
  color: $base-color;
  padding: 15px;
}


@media screen
and (max-device-width: 1440px)
and (min-device-width: 836px){
  .datatable-wrapper{
    &.appointments{
      table{
        table-layout: auto;
        thead {
          th {
            &:first-child {
              width: 40px;
            }
          }
        }
        tbody{
          tr{
            td{
              font-size: 14px;
              &:first-child {
                min-width: 40px;
              }
              &.appointment-payment{
                b{
                  display: block;
                  width: 100%;
                  font-size: 14px;
                }
              }
              &.appointment-status{
                text-transform: capitalize;
                font-size: 14px;
                font-weight: 400;
                div{
                  display: inline-flex;
                  .pending-appointment{
                    margin-right: 5px;
                    display: inline-block;
                    position: relative;
                    border-radius: 50%;
                    width: 18px;
                    height: 18px;
                    background-color: #ffd400;
                    box-sizing: border-box;
                    &:after{
                      position: absolute;
                      content: '';
                      right: 4px;
                      top:4px;
                      width: 10px;
                      height: 10px;
                      background-color: $black;
                      -webkit-mask-image: url("../icons/clock_circular.svg");
                      mask-image: url("../icons/clock_circular.svg");
                      -webkit-mask-repeat: no-repeat;
                      mask-repeat: no-repeat;
                      -webkit-mask-position: center;
                      mask-position: center;
                      mask-size: 10px 10px;
                      -webkit-mask-size: 10px 10px;
                      z-index:1;
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}