@keyframes AddAnimation {
  0% {
    background: var(--color-white);
  }

  65% {
    background: var(--color-yellow2);
  }

  100% {
    background: var(--color-white);
  }
}

@keyframes RevealAllowedContainer {
  from {
    opacity: 0;
    transform: scale(1);
  }

  to {
    opacity: 1;
    transform: scale(1.025);
  }
}

.Sortable-item.is-added {
  animation-duration: 1000ms;
  animation-fill-mode: forwards;
  animation-name: AddAnimation;
  animation-timing-function: ease-in-out;
}

.Sortable-drag.Sortable-selected,
.Sortable-drag.Sortable-chosen {
  --drag-count: 1;

  align-items: center;
  background: var(--color-blue5);
  border-top: none !important;
  box-shadow: var(--shadow-3);
  display: flex;
  justify-content: center;
  list-style: none;
  opacity: 0.9;
  user-select: none;

  &::before {
    .Text.is-s;

    background: none;
    box-shadow: none;
    color: var(--color-white);
    content: 'Move ' counter(count) ' item' attr(item-suffix);
    counter-reset: count var(--drag-count);
    display: flex;
    font-weight: bold;
    line-height: unset;
    margin: 0;
    opacity: 1;
    padding: 0;
    position: relative;
  }

  * > {
    display: none !important;
  }
}

.Sortable-selected {
  background-color: var(--color-blue2);
  border: 2px solid var(--color-blue5);
  opacity: 0.9;
}

.Sortable-ghost {
  background: var(--color-blue5);
}

.Sortable-ghost > div:first-child {
  color: var(--color-white);
}

.Sortable-allowedContainer {
  &::before {
    animation-duration: 350ms;
    animation-fill-mode: forwards;
    animation-name: RevealAllowedContainer;
    animation-timing-function: ease-in-out;
    background: rgb(178 215 248 / 40%);
    border: 2px dotted rgb(196 227 255 / 80%);
    border-radius: 5px;
    bottom: calc(-1 * var(--gap-l));
    content: '';
    left: calc(-1 * var(--gap-l));
    margin-top: calc(-1 * var(--gap-s));
    mix-blend-mode: multiply;
    pointer-events: none;
    position: absolute;
    right: calc(-1 * var(--gap-l));
    top: 0;
    z-index: 0;
  }
}

.CIG-small .Sortable-allowedContainer::before {
  top: var(--gap-xl);
}

.CIG-large .Sortable-allowedContainer::before {
  top: 0;
}

/* Multi-Sortable Styles */

.MultiSortable,
.MultiSortable.is-collapsed {
  flex-wrap: wrap;
  position: relative;

  /* RCIGs do not get this cursor because they use handles and the whole thing isn't draggable */
  &:hover:not(.RCIG-item) {
    cursor: move;
  }
}

.MultiSortable-buttonToggle {
  .Icon.is-s;
  .IconButton;

  --IconButton-name: 'low_priority';
}

.Sortable-item.is-focused .MultiSortable-buttonToggle {
  display: none;
}

/* Styling for ContentEditDrawer items when hovered over a list */
.Sortable.RCS-list,
.Sortable.RCIG-list,
.Sortable.CIG-row {
  &:not([class*='ContentEditDrawer-widget-carousel-list']) {
    .ContentEditDrawer-widget-carousel-list-item.Sortable-ghost {
      .ContentEditDrawer-widget-carousel-list-item-selectButton {
        display: none;
      }

      .ContentEditDrawer-widget-carousel-list-item-type {
        display: none;
      }

      &.RCS-item {
        &::before {
          display: none;
        }

        .ContentEditDrawer-widget-carousel-list-item-title {
          padding: var(--gap-m);

          &::before {
            display: none;
          }
        }
      }

      &.has-image {
        background-color: transparent;
        border: 0;

        .ContentEditDrawer-widget-carousel-list-item-image {
          height: 10em;
        }
      }

      .ContentEditDrawer-widget-carousel-list-item-title {
        background-color: var(--color-blue5);
      }

      .ContentSummary-info {
        display: none;
      }
    }

    .ContentEditDrawer-widget-carousel-list-item {
      &.is-gridItem {
        .ContentSelector-clear {
          display: none;
        }

        .ContentSelector-search {
          max-width: none;
          width: calc(100% - var(--gap-s) * 3 - var(--Icon-size));

          > figure {
            width: 100%;

            > img {
              height: calc(var(--RCIG-itemHeight) - var(--RCIG-titleHeight));
              object-fit: cover;
              width: 100%;
            }
          }
        }
      }
    }

    .ContentEditDrawer-widget-carousel-list-item {
      &.is-listItem {
        .ContentSelector-clear {
          display: none;
        }

        .ContentSelector-search {
          > figure > img {
            max-height: 10em;
          }
        }

        .inputContainer-bulkUpload {
          display: none;
        }
      }

      &.is-listItem.is-collapsed {
        .ContentSelector-edit,
        .ContentSelector-clear {
          display: none;
        }
      }
    }
  }

  &[data-type='record'] {
    &:not([class*='ContentEditDrawer-widget-carousel-list']) {
      &:not([data-field='items']) {
        .ContentEditDrawer-widget-carousel-list-item.Sortable-ghost {
          display: none;
        }
      }
    }
  }
}
