import styled from 'styled-components/macro'

import { devices } from 'config/devices'
import { T9n } from 'features/T9n'
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;
  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;


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

  @media${devices.tablet} {
    width: 100%;
    height: 299px;
    margin: 0;
  }

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

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

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

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

`

export const MatchStatus = styled.div`
  position: absolute;
  top: 24px;
  left: 24px;
  width: 125px;
  height: 24px;
  border-radius: 2px;
  padding: 5px 5px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  white-space: nowrap;

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

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.span`
  max-width: 90%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
`

export const Score = styled.span``

export const Rows = styled.div`
  width: fit-content;
  margin-top: 20px;
`

export const Row = styled.div`
  white-space: nowrap;
`

export const MoreVideo = styled(T9n)`
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 8px;
  border-radius: 2px;
  font-weight: 500;
  font-size: 11px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  background: linear-gradient(
    180deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0) 100%
  ),
   #5C5C5C;
  box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.1);
  cursor: pointer;

  :hover {
    background: rgba(153, 153, 153, 0.9);
    color: #fff;
  }
`

export const CardHoverWrapper = styled(CardWrapper)`
  padding: 16px 24px;
  cursor: default;
`

export const CardHoverInner = styled.div`
  position: relative;
  overflow: hidden;
`

export const CardHoverTitle = styled(T9n)`
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
`
