.ar-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.75rem;
  width: 100%;
  height: 100%;

  > button {
    width: max-content !important;
  }

  > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;

    &.list {
      flex-direction: column;

      &.row,
      &.column {
        margin: 0;

        > li {
          width: 100%;
        }
      }
    }

    &.grid {
      flex-direction: row;

      &.row {
        margin: 0;

        > li {
          max-width: calc(100% / 4);
        }
      }

      &.column {
        > li {
          width: 100%;
        }
      }
    }

    > li {
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      padding: 0.5rem;
      border: solid 1px var(--gray-300);
      border-radius: var(--border-radius-sm);
      overflow: hidden;

      &::before {
        position: absolute;
        inset: 0;
        content: "";
        background-color: transparent;
        z-index: 1;
        transition: background-color 250ms ease-in-out;
      }

      &:hover {
        border: solid 1px transparent;
      }
      &:hover::before {
        background-color: rgba(var(--black-rgb), 0.25);
      }

      &:has(> .error) {
        border: solid 1px var(--danger);
      }

      .error {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        background-color: rgba(var(--danger-rgb), 0.75);
        color: var(--white);
        font-size: 0.75rem;
        font-weight: 700;
        text-align: center;
        z-index: 5;
      }

      .buttons {
        position: absolute;
        inset: 0;
        display: flex;
        justify-content: center;
        align-items: center;

        &:hover {
          div {
            visibility: visible;
            opacity: 1;
          }
        }

        &::before {
          position: absolute;
          inset: 0;
          content: "";
          background-color: transparent;
          z-index: 1;
          transition: background-color 250ms ease-in-out;
        }

        &:hover::before {
          background-color: rgba(var(--black-rgb), 0.75);
        }

        > div {
          display: flex;
          flex-direction: row;
          visibility: hidden;
          opacity: 0;
          z-index: 2;
          transition:
            visibility 250ms,
            opacity 250ms ease-in-out;
        }
      }

      > .file-name {
        width: 100%;
        color: var(--gray-700);
        font-size: 0.75rem;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      > div {
        display: flex;
        gap: 0.25rem;

        > .file-size {
          background-color: var(--primary);
          padding: 0.25rem 0 0.25rem 0.25rem;
          border-radius: var(--border-radius-sm);
          color: var(--white);
          font-size: 0.65rem;
          font-weight: 700;
          text-wrap: nowrap;

          > .size-type {
            background-color: rgba(var(--black-rgb), 0.5);
            margin-left: 0.25rem;
            border-top-right-radius: var(--border-radius-sm);
            border-bottom-right-radius: var(--border-radius-sm);
            padding: 0.25rem;
            color: var(--primary);
            font-size: 0.65rem;
            font-weight: 700;
            text-wrap: nowrap;
          }
        }

        > .file-type {
          background-color: var(--warning);
          padding: 0.25rem;
          border-radius: var(--border-radius-sm);
          color: var(--black);
          font-size: 0.65rem;
          font-weight: 700;
          text-wrap: nowrap;
        }
      }
    }
  }
}
