import styled from 'styled-components/macro'

import { devices } from 'config/devices'

import { Name } from 'features/Name'
import { ProfileLogo } from 'features/ProfileLogo'

import { MATCH_CARD_WIDTH } from './config'

export const CardWrapper = styled.li.attrs({
  tabIndex: 0,
})`
  position: relative;
  flex: 0 0 auto;
  min-width: ${MATCH_CARD_WIDTH}px;
  height: 100%;
  padding-bottom: 18px;
  border-radius: 2px;
  border: 2px solid transparent;
  background-color: #3F3F3F;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: border 0.5s ease-out;
  margin-right: 16px;

  @media ${devices.laptop} {
    height: 279px;
    min-width: 279px;
  }

  @media ${devices.tablet} {
    height: 299px;
  }
  @media ${devices.mobile} {
    width: 100%;
    margin-bottom: 10px;
  }

  &:hover {
    border: 2px solid #A4A4A4
  }
`

export const PreviewWrapper = styled.div`
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  height: 147px;

  @media ${devices.tablet} {
    height: 208px;
  }
`

export const Preview = styled.img`
  width: 100%;
  height: 100%;

`

export const MatchDate = styled.div`
  position: absolute;
  top: 25px;
  left: 24px;
  width: 135px;
  height: 24px;
  border-radius: 2px;
  padding: 8px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  color: white;
  background-color: #6D6D6D;
  z-index: 1;

  @media ${devices.tablet} {
    top: 10px;
    left: 20px;
    width: auto;
    padding: 6px 8px;
  }
`

export const Time = styled.span`
  margin-left: 10px;
`

export const Info = styled.div`
  padding: 33px 24px 0;
  color: #fff;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;

  @media ${devices.tablet} {
    padding: 13px 18px 17px 18px;
  }
`

export const TournamentName = styled.span`
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;

  @media ${devices.tablet} {
    margin-top: 10px;
  }
`

export const Teams = styled.div`
  margin-top: 21px;

  @media ${devices.tablet} {
    margin-top: 0;
  }
`

export const Team = styled.div`
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 17px;
  font-weight: bold;
  line-height: 21px;
  color: #fff;
`

export const TeamName = styled(Name)`
  max-width: 90%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
`

export const Score = styled.div`
  margin-left: auto;
  text-align: center;
  width: 10%;
`

export const TeamLogos = styled.div`
  display: flex;
  padding-left: 24px;

  @media ${devices.mobile} {
    justify-content: space-between;
    padding-right: 20px;
  }
`

export const TeamLogo = styled(ProfileLogo)`
  width: 60px;

  :last-child {
    margin-left: 8px;
  }

  @media ${devices.mobile} {
    width: 134px;
  }
`

export const BuyMatchButton = styled.button`
  border: none;
  background: none;
  padding: 0;

  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 1;

  background-image: url(/images/dollar-sign.svg);
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fff;
  border-radius: 50%;
  border: 0.5px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.5);
`
