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

import { isMobileDevice } from 'config/userAgent'

import { SportName as SportNameBase } from 'features/Common/SportName'
import { Price as BasePrice } from 'features/Price'
import { PriceAmount, PriceDetails } from 'features/Price/styled'

import { InlineButton } from '../../styled'

export const Wrapper = styled.div`
  :not(:first-child) {
    margin-top: 24px;
  }
`

export const SportName = styled(SportNameBase)`
  font-style: normal;
  font-weight: 500;
  font-size: 18px;
  line-height: 22px;
  color: rgba(255, 255, 255, 0.6);
  ${isMobileDevice
    ? css`
      font-size: 14px;
    `
    : ''}
`

export const List = styled.ul`
  margin-top: 6px;
`

export const Item = styled.li`
  display: flex;
  align-items: center;

  ${isMobileDevice
    ? css`
      display: block;
    `
    : ''}
`

export const Price = styled(BasePrice)`
  margin-right: 20px;

  ${PriceAmount} {
    font-size: 24px;
    line-height: 24px;
    font-weight: normal;
    ${isMobileDevice
    ? css`
      font-size: 14px;
    `
    : ''}
  }

  ${PriceDetails} {
    font-weight: 500;
    font-size: 12px;
    line-height: 18px;
    ${isMobileDevice
    ? css`
      font-size: 7px;
    `
    : ''}
  }
`

export const Subscription = styled.div.attrs(
  () => ({
    tabIndex: 0,
  }),
)`
  position: relative;
  width: 800px;
  height: 70px;
  display: flex;
  margin: 5px 0;
  align-items: center;
  justify-content: space-between;
  background-color: #3F3F3F;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  overflow: hidden;

  ${InlineButton} {
    width: 133px;
  }

  :focus-within, :hover {
    ${InlineButton} {
      transform: translateX(0);
    }
  }
  ${isMobileDevice
    ? css`
      height: 86px;
      width: 100%;
    `
    : ''}
`

export const InfoWrapper = styled.div`
  width: 68%;
  display: flex;
  padding: 14px 0 14px 20px;
  flex-direction: column;
  color: #fff;
  ${isMobileDevice
    ? css`
      padding: 10px 0 10px 15px;
    `
    : ''}
`

export const Header = styled.span`
  font-style: normal;
  font-weight: 600;
  font-size: 16px;
  line-height: 23px;
  text-transform: uppercase;
  ${isMobileDevice
    ? css`
      font-size: 14px;
      line-height: 20px;
    `
    : ''}
`

export const Description = styled.p`
  font-style: normal;
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  text-transform: capitalize;
  ${isMobileDevice
    ? css`
      font-size: 10px;
      line-height: 12px;
    `
    : ''}
`

export const SubscriptionEnd = styled.span`
  margin-left: 24px;
  font-style: normal;
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  color: rgba(255, 255, 255, 0.3);
  ${isMobileDevice
    ? css`
      font-size: 10px;
      margin-left: 0;
    `
    : ''}
`
