.image-replacements-header-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  width: 100%;

  & > button {
    height: 40px;

    i {
      margin-right: 0;
    }
  }
}

.image-replacements {
  display: flex;
  flex-direction: column;
  width: 100% !important;
  flex-wrap: wrap;

  h3 {
    width: 100%;
    margin-bottom: 5px;
    font-size: 1.2rem;
    margin-top: 0;
  }

  p {
    margin-top: 0;
    font-size: .875rem;
    color: #777;
  }

  &-group {
    background-color: #F7F7FD;
    border-radius: 10px;
    border: 1px solid #E6E7FD;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    width: 100%;

    & > button {
      height: 40px;

      i {
        margin-right: 0;
      }
    }
  }

  .group-item {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-right: 20px;

    &-header {
      display: flex;
      flex-direction: column;
      margin: 7px 5px;

      .header-title {
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.5;
        color: #333;
      }

      .description {
        font-size: .8rem;
        font-weight: 400;
        line-height: 1.5;
        color: #666;
      }

    }

    .input-group {
      width: 100%;
      display: flex;
      align-items: center;
      flex-wrap: nowrap;

      .img-preview {
        margin-right: 16px;
        width: 100%;
        max-width: 121px;
        background: #fff;
        display: flex;
        border-radius: 5px;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        aspect-ratio: 1.5 / 1;

        img {
          max-width: 100%;
        }

        iframe {
          max-width: 90px;
          max-height: 60px;
          overflow: hidden;
        }

        video {
          max-width: 90px;
          max-height: 60px;
          overflow: hidden;
        }

        &:has([src*="img-placeholder"]) {
          padding: 15px;
          border: 1px dashed #8d86e0;

          img {
            width: 40px;
          }
        }

        &:has([src*="video-placeholder"]) {
          border: 1px dashed #8d86e0;

          img {
            width: 40px;
          }

        }
      }

      .border-none {
        border: 0;
      }

      .dark {
        background-color: #1f2937;

        &:has([src*="img-placeholder"]) {
          border: 1px solid #1f2937;
        }

        &:has([src*="video-placeholder"]) {
          border: 1px solid #1f2937;
        }
      }

      input {
        width: 100%;
        border: 1px solid #ddd;
        padding: .5rem;
        margin-right: 10px;
        height: 40px;
        border-radius: 5px;
      }

      .input-group-append {
        margin-left: -2px;
        border-radius: 6px;
        background: $dracula_color_light;
        color: #fff;
        padding: .5rem 1rem;
        height: 40px;
        width: 97px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease-in-out;

        .dracula-btn-icon {
          margin-right: 7px;
        }

        span {
          font-size: 12px;
          font-weight: 600;
        }

        &:hover {
          background: $dracula_color;
        }

      }

    }

  }

}

@media (max-width: 1279px) {
  .image-replacements-group {
    gap: 0 5px;

    .group-item {
      margin: 0;

      .input-group {
        .img-preview {
          max-width: 50px;
          height: 50px;
          margin-right: 8px;
        }

        input {
          font-size: 12px;
        }

        button {
          span {
            &:nth-child(1) {
              margin: 0 !important;
            }

            &:nth-child(2) {
              display: none;
            }
          }
        }
      }
    }
  }
}

@media (max-width: 991px) {
  .image-replacements-group {
    gap: 0 5px;

    .group-item {
      margin: 0;

      .input-group {
        .img-preview {
          max-width: 50px;
          height: 50px;
          margin-right: 8px;
        }

        input {
          font-size: 12px;
        }

        button {
          span {
            &:nth-child(1) {
              margin: 0 !important;
            }

            &:nth-child(2) {
              display: none;
            }
          }
        }
      }
    }
  }
}

@media (max-width: 767px) {
  .field-image-replacement, .field-video-settings {
    .settings-field-content {
      .image-replacements {
        .image-replacements-group {
          position: relative;
          padding-bottom: 40px;

          .btn-danger {
            position: absolute;
            bottom: 10px;
            right: 10px;
          }

          .group-item {
            margin: 0;

            .input-group {
              margin-bottom: 10px;

              .img-preview {
                max-width: 60px;
                height: 60px;
              }

              input {
                font-size: 12px;
              }

              button {
                span {
                  &:nth-child(1) {
                    margin: 0 !important;
                  }

                  &:nth-child(2) {
                    display: none;
                  }
                }
              }
            }
          }
        }
      }

      .live-edit-btn {
        top: 0 !important;
      }
    }
  }
}

@media (max-width: 479px) {
  .field-image-replacement, .field-video-settings {
    .settings-field-content {
      .image-replacements {
        .image-replacements-header-group {
          flex-direction: column;

          .group-item {
            p {
              margin-right: 0;
            }
          }

          .dracula-btn {
            display: none;
          }
        }

        .image-replacements-group {
          flex-direction: column;

          .group-item {
            margin: 0;
            width: 100%;
          }
        }
      }

      .live-edit-btn {
        top: 0 !important;
      }
    }
  }
}