import { Link } from 'react-router-dom'

import styled, { css } from 'styled-components/macro'

import { devices } from 'config'
import { isMobileDevice } from 'config/userAgent'

import { MatchDate } from 'features/MatchCard/styled'

export const StyledLink = styled(Link)`
  position: relative;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 1.18rem;
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0) 100%
    ),
    #3F3F3F;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3);
  border-radius: 2px;

  :hover {
    background-color: #555555;
  }

  ${isMobileDevice
    ? css`
      flex-direction: row;
      justify-content: center;
      border-radius: 0;
    `
    : ''};
`

export const Title = styled.span`
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 2.36rem;
  letter-spacing: 0.03em;
  color: #ffffff;
  ${isMobileDevice
    ? css`
      text-transform: uppercase;
      font-weight: 700;
      font-size: 10px;
      line-height: 12px;
    `
    : ''};
`

export const Duration = styled(Title)`
  font-weight: 300;
  font-size: 1.14rem;
  letter-spacing: 0.05em;

  @media ${devices.mobile} {
    font-size: 17px;
    line-height: 16px;
    text-transform: none;
  }
`

export const LiveSign = styled(MatchDate)`
  width: 1.511rem;
  height: 0.71rem;
  background-color: #CC0000;
  position: absolute;
  right: 0.8rem;
  top: 50%;
  font-size: 0.32rem;
  transform: translateY(-38%);
  display: flex;

  ${isMobileDevice
    ? css`
      position: static;
      width: 32px;
      height: 22px;
      font-size: 10px;
      align-items: center;
      margin-left: 5px;
      transform: none;
    `
    : ''};
`
