@import "components/helpers";
@import "components/form-settings";
@import "components/promo";

.eacf7-preview {
  display: flex;
  flex-wrap: wrap;
  background: #f9f9f9;
  justify-content: space-between;
  align-items: flex-start;

  &-header {
    width: 100%;
    padding: 13px 30px;
    background: #FFF;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    .header-logo {
      display: flex;
      gap: 12px;
      align-items: center;

      img {
        max-width: 100%;
      }

      h2 {
        padding: 0 !important;
        margin: 0 !important;
        font-size: 18px !important;
        font-weight: 600;
        color: rgba(33, 33, 33, 1);
      }

      p {
        margin: 0;
        font-size: 16px;
        line-height: 22px;
        color: rgba(77, 77, 77, 1);
        font-style: italic;
      }
    }

    .header-title {
      font-weight: 400;
      font-size: 20px;

      .header-title-form-preview {
        color: #212121;
        font-weight: 600;
      }
    }

    .header-actions {
      position: relative;
      flex-basis: 200px;

      input {
        padding: 10px 10px 10px 36px;
        font-size: 14px;
        border-radius: 5px;
        line-height: 16px;
        border: 1px solid #ddd;
        height: auto;
        color: #1E62B9;
        font-weight: 500;
      }

      img {
        width: 16px;
        position: absolute;
        left: 10px;
        top: 12px;
        cursor: pointer;
      }
    }

  }

  &-form {
    max-height: calc(100vh - 165px);
    overflow-y: auto;
    padding: 30px;

    .eacf7-form-styler {
      padding: 20px;
      margin-bottom: 0;
    }

    &-wrap {
      flex: 1;
      margin: 30px;
      border-radius: 15px;
      overflow: hidden;
      border: 1px solid #e5e5e5;
      transition: all 0.3s;

      &.desktop {
        width: 100%;
      }

      &.tablet {
        flex: none;
        width: 768px;
        margin: 30px auto;
      }

      &.mobile {
        flex: none;
        width: 375px;
        margin: 30px auto;
      }

    }

    &-header {
      display: flex;
      justify-content: space-between;
      padding: 10px 15px;
      border-bottom: 1px solid #eee;
      background: #F1F4FA;

      .header-dots {
        span {
          background: #f26c6f;
          width: 13px;
          height: 13px;
          border-radius: 50%;
          display: inline-block;
          margin-right: 5px;

          &:nth-child(2) {
            background: #f0ad4e;
          }

          &:nth-child(3) {
            background: #5cb85c;
          }

        }
      }

      .eacf7-preview-devices {
        i {
          margin-right: 7px;
          cursor: pointer;
          color: #555;

          &:last-child {
            margin-right: 0;
          }

          &.active {
            color: #0073aa;
          }

        }
      }

    }

  }

  .eacf7-preview-styler {

    &-wrap {
      width: 350px;
      background: #FFF;
      border-left: 1px solid #e5e5e5;
      position: sticky;
      top: 55px;
      height: calc(100vh - 55px);
      overflow-y: scroll;
    }

    &-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 15px;
      border-bottom: 1px solid #e5e5e5;
      position: sticky;
      top: 0;
      z-index: 999;
      background: #fff;

      .header-title {
        font-weight: 600;
        font-size: .875rem;
      }

      button {
        background: #0073aa;
        color: #FFF;
        border: none;
        padding: 5px 15px;
        border-radius: 3px;
        cursor: pointer;
        transition: all 0.3s;

        svg {
          margin: 0 5px 0 0;
        }

        &:hover {
          background: #005f86;
        }
      }
    }

    .eacf7-form-settings-content {
      padding: 10px 12px;

      .settings-header {
        display: none;
      }

      .eacf7-alert{
        border: 1px dashed;
        border-radius: 3px;
        padding: 10px;
        margin-bottom: 10px;
        &.eacf7-alert-info{
          border-color: #f3754d;
        }

        &-icon{
          i{
            font-size: 50px;
            width: 50px;
            height: 50px;
            color: #f3754d;
          }
        }

        &-content{
          p{
            font-size: 16px;
            margin-bottom: 10px;
          }
          a{
            border-color: #0073aa;
            background-color: #0073aa;
            &:focus{
              color: #fff;
            }
          }
        }
      }

      .settings-content {
        .settings-field {
          margin-bottom: 0;
          padding: 10px 15px;
          border: none;
          border-radius: 0;

          .settings-field-label {
            width: 120px;
            font-size: 14px;
            font-weight: normal;
            margin-right: 20px;
          }

          &.field-style-preset {
            padding: 0;
            background: transparent;
            margin-bottom: 20px;
          }

          &:has(.eacf7-box-control, .eacf7-color-picker-wrapper, .components-select-control, .eacf7-upload-wrap) {
            .settings-field-label {
              width: 100%;
              margin-bottom: 7px;
              margin-right: 0;

              &:after {
                display: none;
              }
            }
          }

          .eacf7-box-control .components-h-stack .components-range-control {
            min-width: 80px;
          }

          .customize-preset-toggle {
          }

          .eacf7-color-picker-wrapper {
            .color-input {
              width: 80px !important;
              font-size: 14px;
              line-height: 1;
              padding: 5px 10px;
            }
          }

          .eacf7-box-control {
            .component-box-control__unit-control {
              max-width: 70px;
            }
          }

          .components-input-control__backdrop {
            border-color: #ddd;
          }

        }

        .collapse-wrapper {
          padding: 0;
          margin-bottom: 12px;

          .collapse-header {
            padding: 15px;

            .header-title {

              h3 {
                font-size: 14px;
                margin: 0;
              }

              p {
                display: none;
              }
            }
          }

          .collapse-content {
            margin-top: 0;
          }

          &:has(.collapse-content) {
            .collapse-header {
              border-bottom: 1px solid #eee;
            }
          }

        }

      }

    }

    .eacf7-popup-settings {

      .eacf7-popup-control {

        &-label {
          font-weight: normal;
        }

      }
    }

  }

  .eacf7-button-group {
    border: 1px solid #ddd;
    background: #fff !important;
    border-radius: 4px !important;
    display: flex;
    gap: 6px;

    .components-button {
      background: #EDF5FF !important;
      border-radius: 2px !important;

      &.is-primary {
        background: #1E62B9 !important;
      }
    }
  }

  .eacf7-color-picker-wrapper {
    .color-holder-wrap {
      background: #fff;
      border: 1px solid #ddd;
      padding: 6px;
      border-radius: 4px;

      .color-holder {
        border-radius: 3px !important;
        width: 32px !important;
        height: 32px !important;
      }
    }
  }
}