import styled from 'styled-components/macro'

type TooltipBlockWrapperProps = {
  top?: number,
}

export const TooltipBlockWrapper = styled.div<TooltipBlockWrapperProps>`
  background-color: #fff;
  border-radius: 4px;
  padding: 0.11rem 0.8rem 0.27rem 0.75rem;
  white-space: nowrap;
  position: fixed;
  top: ${({ top }) => top && `${top + 2.54}rem`};
  left: 2.36rem;
  z-index: 5;

  &::before {
    position: absolute;
    top: -0.38rem;
    left: 0.27rem;
    content: '';
    border-bottom: 0.38rem solid #fff;
    border-left: 0.472rem solid transparent;
    border-right: 0.472rem solid transparent;
  }
`

export const TooltipBlockItem = styled.span`
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1rem;
  letter-spacing: 0.3px;
  color: ${({ theme }) => theme.colors.black};

  &:hover {
    background-color: rgba(255, 255, 255, 0.7);
  }
`

export const TooltipBlockItemThin = styled(TooltipBlockItem)`
  font-weight: normal;
  font-size: 0.71rem;
  line-height: 1.14rem;
  display: flex;
  align-items: center;
`

export const Flag = styled.img`
  width: 0.85rem;
  height: 1.14rem;
  object-fit: contain;

  :not(:only-child) {
    margin: 0 0.472rem;
  }

  :last-child {
    margin-right: 0;
  }
`
