@import '../../../assets/scss/_variables.scss';
@import "@vueform/toggle/themes/default.css";

// Hide default admin boxes
body.toplevel_page_generator-for-pdf {
  #wpbody {
    display: none;
  }
}

#generator-for-pdf-dashboard {
  margin-left: -20px;
  position: relative;
  overflow: hidden;
  display: flex;
  padding-bottom: 60px;

  @import '../../../assets/scss/_forms.scss';
  //@import '../../../assets/scss/_buttons.scss';


  .box {
    padding: 24px;
    background: $white;
    border-radius: 6px;
    margin-bottom: 20px;

    &.purple {
      background: $purple;
      border-color: transparent;
    }
  }

  .message {
    padding: 10px;
    border-radius: 6px;
    margin-top: 20px;
    box-shadow: 0 0 0 2px $gray-lighter inset;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;


    &.warning {
      background: $red-light;
    }

  }

  .screen {
    flex-grow: 1;
    padding: 30px;
    opacity: 0;

    .webien-ready & {
      opacity: 1;
    }

    .input {
      .above {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        margin-bottom: 10px;

        .label {
          font-weight: 500;
          color: $black;
          margin: 0;
        }
      }

      .field {
        position: relative;
      }
    }




    .pdf {

      .top {
        display: grid;
        grid-template-columns: minmax(50%, 600px) auto;
        grid-template-rows: auto auto;
        background: none;
        padding: 10px 0 20px;


        .logo {
          display: flex;
          align-items: center;
          height: 40px;
          line-height: 0;

          img {
            height: 100%;
            width: auto;
          }

          .headline {
            padding-left: 20px;
            font-size: 30px;
            font-weight: bold;
            line-height: 1;
            position: relative;

            span {
              position: absolute;
              display: block;
              font-size: 10px;
              opacity: 0.8;
              font-weight: normal;
              top: 100%;
              right: 0;
            }
          }
        }

        .register {
          display: inline-flex;
          justify-content: flex-end;
          height: fit-content;

        }

      }

      .input.api-key {

        .field {
          input {
            padding-right: 90px !important;
          }
          button {
            position: absolute;
            top: 50%;
            right: 10px;
            transform: translateY(-50%);
          }
        }

      }

    }



    .setting-field {
      padding-bottom: 20px;
      margin-bottom: 20px;
      border-bottom: 1px solid $gray-lighter;
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: baseline;


      &:last-of-type {
        border-bottom: none;
        padding-bottom: 0px;
        margin-bottom: 0px;
      }

      .setting {
        margin: 0 0 0 auto;
        padding-left: 30px;


        input[type='text'],
        input[type='number']{
          max-width: 200px;
          min-width: 100px;
          padding: 5px 10px;
        }

        select {
          padding: 5px 10px;
          max-width: 200px;
          min-width: 100px;
        }

        input[type='number']{
          -moz-appearance: textfield;
          position: relative;

          /* Chrome, Safari, Edge, Opera */
          &::-webkit-outer-spin-button,
          &::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
          }
        }

        .input {
          position: relative;

          &.percent,
          &.px {
            &:after {
              content: "%";
              position: absolute;
              top: 10px;
              right: 10px;
              color: $gray;
              font-size: 14px;
              font-weight: 500;
            }
          }

          &.px {
            &:after {
              content: "px";
            }
          }
        }
      }
      .descr {
        max-width: 850px;

        p, ul {

        }
        li {
          list-style: initial;
        }

        a {
          white-space: nowrap;
        }
      }


      .title {
        margin: 0 0 10px;

        &.bigger {
          font-size: 1.6em;
        }
      }

    }



    .supported-builders {
      list-style: none;
      padding: 10px 0;

      li {
        margin: 5px 0;
        list-style: none;
        display: flex;
        align-items: center;
        gap: 10px;


        img {
          width: 30px;
          height: 30px;
          border-radius: 30px;
        }


        &.coming-soon {
          margin-top: 15px;
        }

        &.disabled {
          opacity: 0.3;

          img {
            filter: grayscale(100%);
          }
        }

      }
    }






    .template-list {
      display: flex;
      flex-direction: column;
      align-items: baseline;

      .row {
        display: flex;
        align-items: center;;
        padding: 10px 0;
        gap: 20px;


        h5 {
          margin: 0 0 10px;
        }

        button.delete {
          border: none;
          box-shadow: none;
          font-size: 12px;
          font-weight: normal;
          align-self: flex-end;
          padding: 15px 0;
          opacity: 0.5;
          background: none;

          &:hover {
            opacity: 1;
          }

        }
      }

      button.new {
        margin-top: 20px;
      }
    }


    button.save-all {
      margin-top: 30px;
    }

  }



  .loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: grid;
    place-items: center;
    z-index: 999;

    .loader {
      background: $white;
      border-radius: 6px;
      padding: 20px 30px;
      line-height: 0;
    }

    img {
      width: 50px;
      height: auto;

      path {
        fill: $black;
      }
    }
  }

}




//------------------------------------------------------------------------------------//
// SWAL
//------------------------------------------------------------------------------------//

.swal2-container {
  padding-left: 160px !important;
}

.swal2-popup.swal2-modal {
  background: $white;
  border-radius: 6px;


  .swal2-icon.swal2-success {
    border-color: $green !important;
    color: $green !important;

    .swal2-success-ring {
      border: .25em solid $green !important;
    }

    [class^=swal2-success-line] {
      background-color: $green !important;
    }
  }

  .swal2-title {
    font-size: 23px;
    font-weight: 500;
    color: $black;
    padding-top: 40px;
  }

  .swal2-html-container {
    font-size: 15px;
    color: $black;
  }

  .swal2-footer {
    border-color: $gray-lighter;
    font-size: inherit;
  }

  .swal2-icon.swal2-warning {
    border-color: $red;
    color: $red;
  }

  .swal2-styled.swal2-confirm,
  .swal2-styled.swal2-cancel {
    background-color: $black;
    border-radius: 3px;
    padding: 15px 30px;
    font-size: 16px;

    &:focus {
      box-shadow: none;
    }
  }

  .swal2-styled.swal2-cancel {
    background-color: $gray;
  }
}

body.wp-admin.swal2-height-auto {
  height: inherit !important;
}


//------------------------------------------------------------------------------------//
// Vue Toggle
//------------------------------------------------------------------------------------//

#webien-dashboard {
  .toggle-container {

    &:focus {
      box-shadow: none;
    }

  }
}

:root {
  --toggle-width: 5.5rem;
  --toggle-height: 1.5rem;
  --toggle-border: 0.125rem;
  --toggle-font-size: 0.75rem;
  --toggle-duration: 150ms;
  --toggle-bg-on: #45BAC2;
  --toggle-bg-off: #BABABA;
  --toggle-bg-on-disabled: #d1d5db;
  --toggle-bg-off-disabled: #e5e7eb;
  --toggle-border-on: #3ea7ae;
  --toggle-border-off: #AAA;
  --toggle-border-on-disabled: #d1d5db;
  --toggle-border-off-disabled: #e5e7eb;
  --toggle-ring-width: 3px;
  --toggle-ring-color: #10B98130;
  --toggle-text-on: #ffffff;
  --toggle-text-off: #fff;
  --toggle-text-on-disabled: #9ca3af;
  --toggle-text-off-disabled: #9ca3af;
  --toggle-handle-enabled: #ffffff;
  --toggle-handle-disabled: #f3f4f6;
}

.toggle {
  .toggle-label {
    font-weight: 500;
  }
}