@import '../../theme/mixins';

.Header {
  flex-direction: row;
  align-items: center;
  flex: 1 1 auto;
  margin-left: var(--spacing-xs);

  .Avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .Username {
    color: var(--color-main);
    font-size: var(--medium-font);
    line-height: 24px;
    font-weight: 600;
    margin: -6px 0 -6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 12px;
  }
}

.Inbox {
  @include whiteBox();
}

.Search {
  display: none; // todo: later
  flex-direction: row;
  margin-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border);
  align-items: center;
  background-color: var(--color-light);
  height: 44px;

  .To {
    padding: var(--spacing-xxs);
    margin-left: 12px;

    h4 {
      font-weight: 600;
      font-size: var(--medium-font);
    }
  }
}

.FollowingUsers {
  h2 {
    margin: var(--spacing-m);
    font-weight: 600;
  }
}

.Messages {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  overflow-x: auto;
  min-height: 0;
  min-width: 0;
  padding: var(--spacing-m);
  justify-content: flex-end;
  align-items: stretch;
  align-content: stretch;
  margin-top: 31px;
  margin-bottom: var(--safe-area-inset-bottom);
}

.MessageTime {
  flex: 0 0 auto;
  justify-content: flex-start;
  align-items: stretch;

  &Wrapper {
    margin-top: 12px;
    margin-bottom: 24px;
    flex: 0 0 auto;
    justify-content: flex-start;
    align-items: stretch;
    align-content: stretch;
  }

  &Text {
    text-align: center;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-neutral-03);
    font-weight: 400;
    font-size: var(--small-font);
    line-height: 14px;
    margin: -2px 0 -3px;
  }
}

.SendMessage {
  position: fixed;
  bottom: 0;
  bottom: env(safe-area-inset-bottom);
  height: 76px;
  width: 100%;
  padding: var(--spacing-m);
  z-index: 5;
  background-color: var(--color-light);
}

.iOS11fix {
  position: absolute;
  bottom: -76px;
  background-color: var(--color-light);
  height: 100%;
  width: 100%;
  z-index: -1;
}

.End {
  position: absolute;
  bottom: -100px;
}

.Control {
  flex-direction: row;
  align-items: center;
  min-height: 44px;
  padding-left: 11px;
  padding-right: 8px;
  border: 1px solid var(--color-border);
  border-radius: 22px;

  &Wrapper {
    margin-right: 4px;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    justify-content: flex-start;
    align-items: stretch;
    align-content: stretch;

    textarea {
      height: 33px;
      background-color: transparent;
      border: 0;
      overflow: hidden;
      padding: 8px 9px;
      resize: none;
      outline: none;
    }
  }
}

.InitialLoading {
  width: 100%;
  flex-direction: row;
  justify-content: center;
  align-content: center;
  margin: var(--spacing-m) 0;
}

.SendButton {
  width: 90px;
  justify-content: center;
  align-items: center;

  button {
    font-size: var(--base-font)!important;
  }
}

.RoomCard {
  flex: 0 0 auto;
  justify-content: flex-start;
  align-items: stretch;
  align-content: stretch;

  &.UnRead {
    .RoomCardUsername {
      font-weight: 600;
    }

    .RoomCardMessageText {
      font-weight: 600;
      color: var(--color-main);
    }

    .Dot {
      position: absolute;
      right: var(--spacing-m);
      top: 50%;
      width: 8px;
      height: 8px;
      background-color: var(--color-accent);
      border-radius: 50%;
    }
  }

  a {
    color: var(--color-main);
  }

  &Wrapper {
    flex-direction: row;
    padding: var(--spacing-xs) var(--spacing-m);
    flex: 0 0 auto;
    justify-content: flex-start;
    align-items: center;
  }

  .Avatar {
    margin-right: 12px;
    justify-content: flex-start;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  &Info {
    justify-content: center;
    width: 77%;
  }

  &Username {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
  }

  &Message {
    flex-direction: row;
    color: var(--color-neutral-03);

    span {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    &Text {
      max-width: 200px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

.EmptyParents {
  text-align: center;
  margin: var(--spacing-m);
}

.lastOnline {
  font-size: var(--small-font);
  margin-left: var(--spacing-s);
}
