.igd-module-builder-modal {
  * {
    box-sizing: border-box;
  }

  height: 100%;
  display: flex;
  flex-direction: column;
  background: #F7F8FA;

  // scrollbar styles
  // Firefox
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, .35) rgba(247, 248, 250, .6);

  // WebKit
  &::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, .35);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }

  &::-webkit-scrollbar-thumb:hover {
    background-color: rgba(100, 116, 139, .5);
  }

  &-wrap {
    height: 100%;

    &.inline-select {

      .shortcode-module {
        padding: 0;
      }

      .shortcode-builder-content {
        height: auto;
        max-width: 100%;
        min-height: auto;
      }
    }

  }

  &-container {
    z-index: 99999999 !important;

    .swal2-popup {
      width: calc(100% - 5%);
      height: calc(100vh - 10vh);
      padding: 0;
      overflow: hidden;

      .swal2-html-container {
        margin: 0;
        border-radius: .5rem;
        overflow-y: auto;
      }
    }
  }

  &-header {
    display: flex;
    align-items: center;
    padding: 12px 1rem;
    border-bottom: 1px solid #eaeaea;
    background: #fff;
    z-index: 99;
    box-shadow: 0 0 .5rem rgba(0, 0, 0, .1);
    position: sticky;
    top: 0;

    .header-title {
      display: flex;
      align-items: center;

      i {
        margin-right: 7px;
        color: #47cf64;
        height: 26px;
        font-size: 26px;
        width: 26px;
      }

      h3 {
        font-size: 18px;
        margin: 0;
        font-weight: 500;
        color: #555;
      }

      @media (max-width: 600px) {
        h3 {
          font-size: 1rem;
        }
      }

    }

    .input-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-left: 10px;
      border: 1px solid rgba(#5c637e, .3);
      border-radius: 7px;
      overflow: hidden;
      height: 40px;

      img {
        margin-right: 0px;
        padding: 5px;
        width: 40px;
        height: 100%;
        border-right: 1px solid #ddd;
        background: #eee;
      }

      .shortcode-title {
        background: #FFF;
        position: relative;
        border: none;
        height: 100%;

        &:focus, &:active, &:hover {
          border: none;
          box-shadow: none;
        }
      }

    }

    .close {
      margin-left: auto;
      margin-right: 15px;
    }

    .header-actions {
      display: flex;
      margin-left: auto;
    }

    button {
      padding: 7px 10px;
      font-size: .9rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .done {
      .igd-spinner {
        display: none;
      }

      &.loading {

        i {
          display: none;
        }

        .igd-spinner {
          display: inline-block;
        }
      }

    }

  }

  .shortcode-module {

    .media-uploader-post-content {
      margin-bottom: 30px;

      textarea {
        width: 100%;
        height: auto;
        padding: 8px 12px;
        line-height: 27px;
        vertical-align: top;
      }

    }

    &-header {
      align-items: flex-start;

      .module-title {
        line-height: 1;
      }

    }

    .igd-selected-list {
      top: 20px;
    }

    &-body {
      & > .settings-field {
        &:last-child {
          margin-bottom: 0;
        }
      }
    }

  }

}

.igd-shortcode-builder-form {
  margin: 0;
  overflow-y: auto;
  flex: 1;
  display: flex;

  .content-sources {
    .settings-field {
      &.form-entry-field {
        margin-top: 20px;
      }
    }

    .form-entry-title {
      margin-top: 30px;
    }

    #igd-select-files {
      width: 100%;
      margin-bottom: 20px;

      .igd-body {
        max-height: 400px;
      }
    }


  }

}

// Block placeholder
.igd-module-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  max-width: 100%;
  width: 420px;
  margin: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);

  img {
    width: 48px;
    margin-bottom: 5px;
  }

  .title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 18px 0;
  }

  .subtitle {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    margin-top: 15px;
    margin-bottom: 3px;
  }

  .description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 15px !important;
  }

  .divider {
    margin: 18px 0 5px;
    font-size: 14px;
    color: #9ca3af;
    font-weight: 500;
    position: relative;
  }

  .divider::before,
  .divider::after {
    content: '';
    height: 1px;
    background: #e5e7eb;
    position: absolute;
    top: 50%;
    width: 40%;
  }

  .divider::before {
    left: 0;
  }

  .divider::after {
    right: 0;
  }

  select {
    min-width: 260px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #374151;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.2s ease;

    &:focus {
      border-color: #22c55e;
      outline: none;
    }

    &:hover {
      border-color: #9ca3af;
    }

  }

  .components-input-control__backdrop {
    border-radius: 6px !important;
    border-color: #d1d5db !important;
  }

  .igd-btn.btn-primary {
    margin-top: 0;
    padding: 10px 16px;
    font-size: 14px;
    background-color: #22c55e;
    border: none;
    color: #fff;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.2s ease;
    line-height: normal;

    &:hover {
      background-color: #16a34a;
    }

    i {
      font-size: 16px;
      width: 16px;
      height: 16px;
      margin-right: 4px;
    }

    &.btn-configure {
      margin-top: 15px;
    }

  }

  &.pro-placeholder {
    h4 {
      margin-top: 20px;
      margin-bottom: 0;
      font-size: 1.5rem;
      color: #FF9458;
      font-weight: 500;
    }
  }

  .select2-container {
    .select2-selection {
      height: 40px;
      text-align: left;
      border-color: #DDD;

      .select2-selection__rendered {
        line-height: 40px;
        font-size: 15px;

        .igd-select2-selection {
          img {
            width: 20px;
            height: 20px;
            margin-right: 5px;
            vertical-align: middle;
          }
        }

      }

      .select2-selection__clear {
        margin-right: 7px;
      }

      .select2-selection__arrow {
        top: 7px;
      }

    }
  }

}

.igd-select2-option {
  font-size: 15px;
  display: flex;
  align-items: center;

  img {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    vertical-align: middle;
  }
}


.igd-shortcode-data-modal-container {

  .igd-shortcode-data-modal-input {
    height: 50px;
    padding: 1rem;
    border-radius: 0.5rem;
    line-height: 1.2;
    font-size: .878885rem;
    background: #f5f5f5;
    color: #555;
    width: 300px !important;
    margin: 30px auto auto;
    text-align: center;
  }

  .swal2-confirm {
    background: $igd_color;
  }

}

// Hide shortcode list when the module type selection is visible
.igd-module-builder-modal-container:has(.module-types-modal.modal-init) {
  background: transparent;

  .igd-shortcode-builder {
    display: none;
  }

  .swal2-html-container,
  .igd-module-builder-modal-wrap {
    background: transparent;
  }

}