html {
  &.active {
    overflow: hidden;
  }
}

// Panel
#eacf7-redirect-panel,
#eacf7-placeholder-panel,
#eacf7-submission-id-panel,
#eacf7-telegram-panel,
#eacf7-form-styler-panel,
#eacf7-conditional-panel,
#eacf7-pre-populate-panel,
#eacf7-multistep-panel,
#eacf7-pdf-generator-panel {
  padding: 20px 45px 45px !important;
  line-height: 1.5;
  background: white !important;

  h2 {
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
  }

  p {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }

  fieldset {
    .eacf7_redirect_status_wrap {
      margin-bottom: 5px;
    }

    .eacf7-wrapper {
      h3,
      .eacf7-field-label {
        font-size: 18px !important;
        line-height: 1.5;
        margin-bottom: 5px;
        font-weight: 600;
      }

      .bot_status_wrapper {
        margin-top: 10px;
        display: inline-block;

        .bot_status {
          overflow: hidden;

          > strong {
            border-radius: 5px;
            color: #fff;
            display: inline-block;
            padding: 8px;
          }

          &.offline {
            > strong {
              background-color: red;
            }
          }

          &.online {
            > strong {
              background-color: green;
            }
          }

          .bot_info {
            display: block;

            code {
              display: block;

              span {
                font-weight: bold;
              }
            }
          }
        }
      }

      ul {
        list-style: none;

        li {
          background-color: #ededf8;
          display: flex;
          justify-content: space-between;
          padding: 20px 30px;
          border: 1px solid #eee;
          border-radius: 8px;

          > label {
            font-weight: 600;
            font-size: 16px;
            line-height: 1.5;
          }

          .wp-picker-container {
            display: block;
            text-align: right;

            button {
              margin-bottom: 0 !important;
            }

            .wp-picker-input-wrap {
              display: inline-block;
            }
          }
        }
      }

      .eacf7-fieldset {
        .eacf7-checkbox {
          display: none;

          &:checked {
            + .eacf7-switch {
              background-color: #7983ff;

              &::after {
                left: 27px;
              }
            }
          }
        }

        .eacf7-switch {
          position: relative;
          display: inline-block;
          width: 50px;
          height: 25px;
          background-color: rgba(0, 0, 0, 0.25);
          border-radius: 20px;
          transition: all 0.3s;

          &::after {
            content: "";
            position: absolute;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background-color: white;
            top: 1px;
            left: 1px;
            transition: all 0.3s;
          }
        }

        > span {
          font-size: 14px;
          margin-bottom: 0px;
          display: block;
        }

        > label {
          font-size: 16px;
          font-weight: 600;
          line-height: 1.5;
          display: block;
        }

        input,
        select {
          &:not(.wp-color-picker, .wp-picker-clear) {
            width: 100%;
            max-width: 100%;
            padding: 12px 8px 12px 12px;
            border: 1px solid #c4cbd4;
            background-color: #f5f8ff;
            border-radius: 4px;
            height: 48px;
            color: #363e4a;
            font-size: 14px;
            line-height: 14px;
          }
        }

        .eacf7-single-repeater-clone-conditions,
        .eacf7-pre-populate-field-clone-item {
          display: none;
        }

        .pre-populate-field-item {
          display: flex;
          gap: 20px;
          margin-bottom: 15px;

          button {
            padding: 10px 20px;
            display: block;
            line-height: 1;
            transition: all 0.3s ease-in-out;

            span {
              color: red;
            }

            &:hover {
              span {
                color: white;
              }

              background-color: red;
            }
          }
        }

        .eacf7-progressbar-style-wrap {
          display: flex;
          flex-wrap: wrap;
          gap: 20px;

          li {
            &.active {
              border-color: #005e82;
            }

            cursor: pointer;
            background: transparent;
            width: 20%;
            padding: 15px;

            img {
              max-width: 100%;
            }

            span {
              font-weight: 700;
              text-align: center;
              display: block;
              margin: 0 auto;
            }
          }
        }

        .eacf7-image-upload-preview {
          position: relative;
          margin-bottom: 20px;
          width: max-content;
          display: none;

          &.active {
            display: block;
          }

          img {
            border: 1px solid;
            width: 100px;
            object-fit: contain;
            height: 100px;
            padding: 10px;
          }

          a {
            position: absolute;
            top: -10px;
            font-size: 14px;
            right: -10px;
            background: #fff;
            border: 1px solid #ddd;
            padding: 2px;
            line-height: 1;
            text-decoration: none;
            border-radius: 50%;
            width: 20px;
            display: flex;
            height: 20px;
            align-items: center;
            justify-content: center;
          }
        }

        .eacf7-image-upload-wrap {
          display: flex;
        }

        .mb-10 {
          margin-bottom: 10px;
        }
      }

      .eacf7_redirect_to_page,
      .eacf7_redirect_to_url {
        margin-top: 5px;
        margin-bottom: 10px;

        div {
          margin-top: 5px;

          select {
            width: 100%;
          }
        }
      }
    }

    .eacf7-heading {
      background: #f0f2f4;
      padding: 15px 20px;
      margin: 20px -45px 0;
      display: block;

      h3 {
        margin: 0;
      }
    }

    .eacf7-wrapper-settings {
      padding: 15px;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;

      .eacf7-wrapper-settings {
        padding: 0;
      }

      .eacf7-field {
        .eacf7-fieldset {
          input.eacf7-input,
          select.eacf7-select {
            margin: 13px 0;
            width: 100%;
            max-width: 100%;
            padding: 12px 8px 12px 12px;
            border: 1px solid #c4cbd4;
            background-color: #f5f8ff;
            border-radius: 4px;
            height: 48px;
            color: #363e4a;
            font-size: 14px;
            line-height: 14px;
            font-family: "Lato";
          }

          textarea {
            width: 100%;
            height: 250px;
          }
        }
      }

      .w-100 {
        width: 100%;
      }

      .w-50 {
        width: calc(50% - 10px);
      }

      .w-33 {
        width: calc(33.33% - 10px);
      }

      .w-25 {
        width: calc(25% - 10px);
      }

      .mt-15 {
        margin-top: 15px;
      }

      .mb-10 {
        margin-bottom: 10px;
      }

      .mb-12 {
        margin-bottom: 12px;
      }

      .mb-15 {
        margin-bottom: 15px;
      }

      @media screen and (max-width: 767px) {
        .w-33,
        .w-50 {
          width: 100%;
        }
      }
    }

    > label {
      font-size: 16px;
      line-height: 1.5;
      display: block;
    }

    .mb-15 {
      margin-bottom: 15px;
    }

    // conditional field
    .eacf7-conditional-field-init {
      display: none;
    }

    .eacf7-conditional-field-repeater-item {
      margin-bottom: 20px;

      .eacf7-conditional-field-repeater-item-header {
        display: flex;
        width: 100%;
        padding: 8px;
        background: #d8e6ff;
        position: relative;
        border-radius: 5px;
        align-items: center;
        cursor: pointer;

        &.open {
          border-radius: 5px 5px 0 0;
        }

        .eacf7-conditional-field-repeater-icon {
          .open:before {
            content: "\f343";
          }
        }

        .eacf7-conditional-field-repeater-title-text {
          flex: 1;
          font-weight: 700;
        }
      }

      .eacf7-conditional-field-repeater-item-content {
        display: none;

        &.open {
          display: block;
          background: #d8e6ff;
          padding: 8px;
          width: 100%;
          border-radius: 0 0 5px 5px;
        }
      }
    }
  }
}

#eacf7-redirect-panel-tab.ui-tabs-active {
  background: #000 !important;
  border: 2px solid #000 !important;

  a {
    color: #fff !important;
  }
}

//Address
fieldset {
  p.address-format {
    display: flex;

    label {
      margin-right: 15px !important;
      display: flex;
      align-items: center;
    }
  }

  p.description {
    margin-top: 0 !important;
    padding: 0 !important;
    font-size: 0.8rem;
  }

  // star rating
  .custom-icon-class {
    display: none;
  }
}

.address-required-fields {
  display: flex;
  flex-direction: column;
}

.mask-input-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 10px;

  > label {
    flex: auto;
  }
}

.tag-generator-panel {
  .insert-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    input[type="text"] {
      flex: 1;
      margin-right: 20px;
    }

    .submitbox {
      margin-left: auto;
    }

    .description {
      width: 100%;
    }
  }
}

// Notice
.eacf7-notice {
  display: flex;
  padding: 5px 15px;
  border: 1px solid #ebf2ff;
  border-radius: 4px;
  background-color: #ebf2ff;
  margin-top: 10px;

  a {
    margin-left: 3px;
  }

  p {
    margin: 0;
  }
}

header {
  &.description-box {
    .eacf7-notice {
      margin: 0 0 12px 0;
    }
  }
}

// column/grid
.eacf7-column-control-box {
  height: 100%;

  fieldset {
    table {
      border-collapse: collapse;

      tbody {
        tr {
          margin-bottom: 10px !important;
          display: block;
          cursor: pointer;
          padding: 5px;

          th {
            a.eacf7-column-button {
              margin-top: 10px;
              color: #7983ff;
              border: 1px dashed #7983ff;
            }
          }

          td {
            pre {
              margin: 0;
            }
          }
        }

        .eacf7-custom-column {
          .custom-column-wrap {
            margin-bottom: 10px;

            .remove-custom-column {
              color: #fff;
              border-radius: 50%;
              border: none;
              font-size: 10px;
              background-color: red;
              width: 30px;
              height: 30px;
              cursor: pointer;
              margin-bottom: 0;
            }
          }

          button {
            margin-bottom: 10px;
          }
        }
      }
    }
  }
}

form.tag-generator-panel[data-version="2"] footer .flex-container {
  width: 100%;
}

// column/grid v6
.tag-generator-panel {
  .control-box {
    .eacf7-column-button {
      margin-top: 10px;
      color: #7983ff;
      border: 1px dashed #7983ff;
    }

    .eacf7-custom-column {
      .custom-column-wrap {
        margin-bottom: 10px;

        .remove-custom-column {
          color: #fff;
          border-radius: 50%;
          border: none;
          font-size: 10px;
          background-color: red;
          width: 30px;
          height: 30px;
          cursor: pointer;
          margin-bottom: 0;
        }
      }

      button {
        margin-bottom: 10px;
      }
    }
  }
}

.eacf7-column-insert-box {
  display: none !important;
}

// Google Drive
.swal2-container {
  dialog {
    border: 0;
  }
}

.picker-dialog {
  z-index: 9999999 !important;
}

// Form Generator
.form-generator-btn,
.form-template-btn {
  background: $eacf7_color;
  color: #fff;
  padding: 7px 10px;
  display: inline-block;
  border-radius: 2px;
  font-weight: 500;
  height: 30px;
  font-size: 13px;
  line-height: normal;
  position: relative;
  top: -2.5px;
  margin-left: 10px;
  cursor: pointer;
  border: none;

  &:hover {
    background: darken($eacf7_color, 5%);
  }

}

.eacf7-form-generator {
  width: 100%;
  position: fixed;
  border-radius: 5px;
  top: 0;
  left: 0;
  height: 100%;
  background-color: rgb(0 0 0 / 70%);
  z-index: 99999;
  visibility: hidden;
  opacity: 0;
  text-align: center;

  &-wrap {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    height: 100%;

    > .wrap {
      margin: 0;
      width: 100%;
      max-width: 700px;
      position: relative;

      .content {
        background: #f5f6fa;
        padding: 30px;
        border-radius: 10px;
        box-shadow: 1px 1px 20px 1px #545454;

        &.loading {
          text-align: center;
          padding: 120px 30px;
        }

        .header {
          display: flex;
          flex-direction: row;
          justify-content: space-between;
          align-items: center;

          .back-btn {
            display: flex;
            gap: 5px;
            color: #4b5563;
            text-decoration: none;
            font-size: 16px;
          }

          .actions {
            display: flex;
            gap: 10px;

            button {
              background: $eacf7_color;
              display: flex;
              gap: 4px;
              align-items: center;
            }
          }
        }

        .content-wrap {
          margin-top: 25px;

          textarea {
            background: #111827;
            color: #fff;
            scrollbar-width: thin;

            &::-webkit-scrollbar {
              scrollbar-width: thin;
            }
          }
        }

        &-field {
          display: flex;
          flex-direction: row;
          align-items: center;
          gap: 20px;
          margin-bottom: 10px;
          padding: 15px 20px;
          background: #fff;
          border-radius: 12px;

          h4 {
            width: 120px;
            display: flex;
            align-items: center;
            font-size: 0.875rem;
            font-weight: 600;

            &:after {
              content: ":";
              margin-left: auto;
            }
          }

          &-content {
            display: flex;
            align-items: flex-start;
            flex-direction: column;

            .components-button-group {
              .components-button {
                &:first-child {
                  border-top-left-radius: 5px;
                  border-bottom-left-radius: 5px;
                }

                &:last-child {
                  border-top-right-radius: 5px;
                  border-bottom-right-radius: 5px;
                }
              }
            }

            .components-base-control__field {
              margin-bottom: 0;
            }

            .description {
              margin-top: 5px;
              margin-bottom: 0;
              color: #666;
              display: flex;
              align-items: center;
              flex-wrap: wrap;
              font-size: 0.875rem;
            }
          }

          .eacf7-radio-group {
            .is-primary {
              background: #1e62b9;
              box-shadow: inset 0 0 0 1px #3265a6;
            }

            .is-secondary {
              box-shadow: inset 0 0 0 1px #1e62b9;
              color: #1e62b9;
            }
          }

          .components-form-toggle {
            line-height: normal;
            width: max-content;

            &.is-checked .components-form-toggle__track {
              background-color: $eacf7_color;
              border-color: $eacf7_color;
            }

            &:focus {
              .components-form-toggle__track {
                .components-form-toggle
                .components-form-toggle__input:focus
                + .components-form-toggle__track {
                  box-shadow: 0 0 0 #fff,
                  0 0 0 calc(var(--wp-admin-border-width-focus) * 2) #1e62b9;
                  outline: 2px solid #0000;
                  outline-offset: 2px;
                }
              }
            }
          }

          .eacf7-select-control {
            min-width: 300px;
            text-align: left;

            input {
              box-shadow: 0 0 0 0 transparent !important;
            }

            &:focus {
              + .components-input-control__backdrop {
                border-color: #1e62b9 !important;
                box-shadow: 0 0 0 0.5px #1e62b9 !important;
              }

              // >div[class^="css-"][class$="-control"] {
              //   box-shadow: 0 0 0 1px #1E62B9;
              //   border-color: #1E62B9;
              // }
            }
          }
        }

        .eacf7-generate-btn {
          background: $eacf7_color;
        }
      }

      .form-generator-close {
        position: absolute;
        top: -20px;
        background: #edf5ff;
        border-radius: 50%;
        height: 38px;
        width: 38px;
        border: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        right: -18px;
      }
    }
  }

  &.active {
    visibility: visible;
    opacity: 1;
  }
}

.eacf7-form-template {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99999;
  visibility: hidden;
  opacity: 0;

  &-wrap {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    height: 100%;

    &-inner {
      max-width: 1280px;
      width: 100%;
      margin: 0 auto 0 auto;
      background: #fff;
      border-radius: 10px;

      @media screen and (min-width: 1025px) and (max-width: 1280px) {
        max-width: 1000px;
        max-height: 500px;
        overflow: hidden;
      }

      .header {
        padding: 20px 30px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #ddd;

        h2 {
          margin-top: 0;
          margin-bottom: 4px;
          color: #212121;
          font-size: 18px;
          font-weight: 600;
        }

        p {
          font-size: 14px;
          font-weight: 400;
          color: #888;
          margin: 0;
        }

        button {
          background: #edf5ff;
          border-radius: 50%;
          height: 38px;
          width: 38px;
          border: 0;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          cursor: pointer;
        }
      }

      .wrap {
        display: flex;
        margin: 0;

        .sidebar {
          padding: 30px;
          width: 310px;
          @media screen and (min-width: 1025px) and (max-width: 1280px) {
            height: 350px;
            overflow-y: scroll;
          }

          .search {
            position: relative;

            input {
              border: 1px solid #ddd;
              padding: 8px 8px 8px 37px;
              width: 100%;

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

            img {
              position: absolute;
              left: 10px;
              top: 10px;
            }
          }

          h3 {
            font-size: 18px;
            font-weight: 500;
            color: #212121;
          }

          ul {
            li {
              margin: 0;

              a {
                font-size: 16px;
                font-weight: 400;
                color: #888888;
                padding: 10px 16px;
                border-radius: 6px;
                display: block;
                text-decoration: none;

                &:focus {
                  box-shadow: 0 0 0 !important;
                  border: 0 !important;
                }

                &.active {
                  background: #f5f6fa;
                  color: #212121;
                }
              }
            }
          }
        }

        .content {
          padding: 30px 0;
          width: 100%;
          overflow-y: auto;
          height: 600px;
          @media screen and (min-width: 1025px) and (max-width: 1280px) {
            height: 350px;
          }

          h3 {
            font-size: 16px;
            text-transform: uppercase;
            font-weight: 500;
            margin-top: 0;
            margin-bottom: 30px;
            padding: 16px 0;
            border-bottom: 1px solid #ddd;
          }

          .item-wrap {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 24px;
            @media screen and (min-width: 1025px) and (max-width: 1280px) {
              gap: 18px;
            }

            .item {
              position: relative;
              background: #f5f6fa;
              border-radius: 10px;
              border: 1px solid #ddd;
              width: 219px;
              height: 270px;
              overflow: hidden;
              transition: all 0.3s ease-in-out;

              &:hover {
                .details {
                  p {
                    display: none;
                  }

                  .action {
                    display: flex;
                  }
                }
              }

              &.blank {
                display: flex;
                align-items: center;
                justify-content: center;
              }

              > .wrap {
                margin: 0;
                position: absolute;

                .icon {
                  cursor: pointer;
                  width: 70px;
                  height: 70px;
                  border: 1px dashed #ddd;
                  border-radius: 50%;
                  display: flex;
                  align-items: center;
                  justify-content: center;
                }
              }

              img {
                &.loading {
                  max-width: 12px;
                  display: none;
                }

                max-width: 100%;
                border-radius: 10px;
              }

              .details {
                background: #fff;
                border-top: 1px solid #ddd;
                padding: 12px;
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                border-bottom-left-radius: 10px;
                border-bottom-right-radius: 10px;
                min-height: 65px;

                h3 {
                  text-transform: capitalize;
                  border-bottom: 0;
                  padding: 0;
                  margin-bottom: 10px;
                  font-size: 14px;
                  font-weight: 600;
                }

                p {
                  font-size: 12px;
                  line-height: 1.5;
                  margin: 0;
                }

                .action {
                  width: 100%;
                  display: none;
                  align-items: center;
                  justify-content: space-between;

                  a {
                    border-radius: 3px;
                    padding: 8px 6px;
                    text-decoration: none;
                    display: flex;
                    align-items: center;
                    border: 1px solid #1e62b9;
                    gap: 6px;
                    cursor: pointer;

                    .icon {
                      width: 13px;
                      height: 13px;
                    }

                    span {
                      font-size: 13px;
                      line-height: 1;
                      font-weight: 400;
                    }

                    &.insert {
                      background: #1e62b9;
                      color: #fff;
                    }
                  }
                }
              }

              .pro-badge {
                position: absolute;
                top: 0;
                right: 0;
                background: #F4C430;
                padding: 8px 16px;
                color: #fff;
                font-weight: bold;
                display: flex;
                align-items: center;
                gap: 5px;
                border-bottom-left-radius: 10px;

                i {
                  width: 16px;
                  height: 16px;
                }

              }
            }
          }
        }
      }
    }
  }

  &.active {
    visibility: visible;
    opacity: 1;
  }
}

#folder {
  font-weight: 600;
}

.custom-mask-format {
  display: none;
}

textarea#tag-generator-panel-section_break-content {
  width: 200px;
}

textarea#tag-generator-panel-custom_html-content {
  width: 100%;
  height: 150px;
}

#eacf7-form-dropdown {
  display: none;
  position: absolute;
  z-index: 9999;
  background: white;
  border: 1px solid #ccc;

  .eacf7-form-item {
    display: inline-block !important;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    padding: 8px;
    width: 100%;

    &:last-child {
      border-bottom: 0;
    }
  }
}
