$background-color: #fff;

@mixin disabled-element {
  .disabled {
    opacity: 0.2 !important;
  }
}

.preview-image {
  margin: 0 auto;
  display: block;
}

[class*="gk-gravityview-blocks"] {
  text-align: left;

  @include disabled-element;

  .entry-selector, .preview-control, .view-selector,.sort-field-selector {
    width: 100%;
    display: inline-block;
    text-align: left;
  }

  .view-selector,.sort-field-selector {
    input {
      margin: 0 !important;
      height: auto !important;
      box-shadow: none !important;
    }
  }

  .preview-image {
    margin: 0 auto 20px;
    display: block;
  }

  /*
   * Block editor
   */
  .block-editor {
    text-align: center;
    padding: 40px;

    .entry-selector, .preview-control, .view-selector,.sort-field-selector {
      width: 70%;
    }

    .preview-control span {
      display: flex;
    }
  }

  /*
  * Block preview
  */
  .block-preview {
    .loading-state {
      position: relative;

      &.initial {
        padding: 40px;
      }

      .loader {
        position: absolute;
        left: -10%;
        top: 5%;
      }
    }
  }

  /*
   * Sidebar
   */
  .components-panel {
    .view-selector, .sort-field-selector, .entry-selector:not(.no-entry-input) {
      margin-bottom: 24px;
    }

    .view-selector.edit-view {
      margin-bottom: 12px;

      p {
        margin: 10px 0;
      }
    }

    .entry-selector.minimal-bottom-margin {
      margin-bottom: 12px;
    }

    .btn-group-double, .btn-group-triple {
      width: 100%;
      margin-bottom: 24px;

      .components-button {
        justify-content: center;
      }
    }

    .btn-group-double .components-button {
      width: 50%;
    }

    .btn-group-triple .components-button {
      width: 33%;
    }

    .suggestion-list {
      ul {
        background: $background-color;
        border: 1px solid darken($background-color, 10%);

        li {
          cursor: pointer;
          line-height: 25px;
          margin: 0;
          padding: 10px;
          border-bottom: 1px solid #fff;

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

          &:hover {
            color: #fff;
            background: var(--wp-admin-theme-color-darker-10);
          }
        }
      }
    }
  }
}

.gravityview-blocks-preview-as-shortcode {
  margin-bottom: 24px;

  @include disabled-element;
}
