@use "design-system";

.sender-to-recipient {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  position: relative;
  flex: 0 0 auto;

  &--default {
    height: 42px;

    .sender-to-recipient {
      &__tooltip-wrapper {
        min-width: 0;
      }

      &__tooltip-container {
        max-width: 100%;
      }

      &__party {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex: 1;
        padding: 0 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-bottom: 1px solid var(--color-border-muted);

        &--sender {
          padding-right: 30px;
          cursor: pointer;
        }

        &--recipient {
          padding-left: 30px;
          border-left: 1px solid var(--color-border-muted);

          &-with-address {
            cursor: pointer;
          }
        }
      }

      &__arrow-container {
        position: absolute;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;

        [dir='rtl'] & {
          transform: rotate(180deg);
        }
      }

      &__arrow-circle {
        background: var(--color-background-default);
        padding: 5px;
        border: 1px solid var(--color-border-muted);
        border-radius: 20px;
        height: 32px;
        width: 32px;
        display: flex;
        justify-content: center;
        align-items: center;

        &__icon {
          color: var(--color-icon-muted);
        }
      }

      &__name {
        @include design-system.H7;

        padding-left: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        [dir='rtl'] & {
          /*rtl:ignore*/
          direction: ltr;

          /*rtl:ignore*/
          text-align: right;

          span {
            display: block;

            /*rtl:ignore*/
            direction: rtl;
          }
        }
      }
    }
  }

  &--cards {
    .sender-to-recipient {
      &__party {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex: 1;
        border-radius: 4px;
        box-shadow: var(--shadow-size-xs) var(--color-shadow-default);
        padding: 6px;
        background: var(--color-background-default);
        cursor: pointer;
        min-width: 0;
        color: var(--color-text-default);
        border: 1px solid var(--color-border-default);
      }

      &__tooltip-wrapper {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      &__name {
        @include design-system.H9;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        [dir='rtl'] & {
          /*rtl:ignore*/
          direction: ltr;

          /*rtl:ignore*/
          text-align: right;

          span {
            display: block;

            /*rtl:ignore*/
            direction: rtl;
          }
        }
      }

      &__arrow-container {
        display: flex;
        justify-content: center;
        align-items: center;

        [dir='rtl'] & {
          transform: rotate(180deg);
        }
      }
    }
  }

  &--flat {
    .sender-to-recipient {
      &__party {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex: 1;
        padding: 6px;
        cursor: pointer;
        min-width: 0;
        color: var(--color-text-default);
        border: 1px solid var(--color-border-default);
      }

      &__tooltip-wrapper {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      &__name {
        @include design-system.H8;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-inline-start: 8px;

        [dir='rtl'] & {
          /*rtl:ignore*/
          direction: ltr;

          /*rtl:ignore*/
          text-align: right;

          span {
            display: block;

            /*rtl:ignore*/
            direction: rtl;
          }
        }
      }

      &__arrow-container {
        display: flex;
        justify-content: center;
        align-items: center;

        [dir='rtl'] & {
          transform: rotate(180deg);
        }
      }
    }
  }
}
