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

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

import { ButtonSolid } from 'features/Common'
import { Logo } from 'features/Logo'

type Props = {
  sportType: SportTypes,
}

export const Wrapper = styled.div`
  width: 100vw;
  height: 100vh;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
`

export const HeaderWrapper = styled.div`
  background-color: #13151B;
  padding: 20px 0;
  padding-left: 20%;
  width: 100%;
  @media ${devices.laptop} {
    padding-left: 5%;
  }
  ${isMobileDevice
    ? css`
      display: none;
    `
    : ''};
`

export const MainLogo = styled(Logo)`
  height: 26px;
  width: 80px;
`

export const MainInfoContainer = styled.div`
  height: 100%;

  ${isMobileDevice
    ? css`
      margin-top: 50px;
      overflow: scroll;
    `
    : ''};
`

export const BlockWrapper = styled.div`
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 20%;
  width: 100%;
  @media ${devices.laptop} {
    padding-left: 5%;
  }
  @media ${devices.mobile} {
    padding-left: 5.4rem;
  }
  ${isMobileDevice
    ? css`
      padding: 5.4rem;
      @media screen and (orientation: landscape){
        padding-top: 20px;
        height: auto;
      }
    `
    : ''};
`

export const SportImgWrapper = styled.div<Props>`
  background-image: url(/images/landing_${({ sportType }) => (
    isMobileDevice
      ? `mobile_${sportType}.png`
      : `${sportType}.png`
  )});
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  width: 512px;
  height: 80%;
  margin-right: 5%;
  ${isMobileDevice
    ? css`
      display: none;
      @media screen and (orientation: landscape){
        display: block;
        height: 100%;
        width: 70%;
      }
    `
    : ''};
`

export const MatchInfo = styled.div`
  margin-bottom: 60px;

  ${isMobileDevice
    ? css`
      width: 100%;
      height: 100%;
      @media screen and (orientation: landscape){
        padding-top: 0;
      }
    `
    : ''};
`

export const DateInfoWrapper = styled.div`
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  ${isMobileDevice
    ? css`
      justify-content: space-between;
      font-size: 2.3rem;
    `
    : ''};
`

export const DateInfo = styled.div`
  text-transform: uppercase;
  background-color: rgba(0,0,0,0.4);
  padding: 8px 25px;
  color: #B9B9B9;
  margin-right: 25px;
  border-radius: 5px;
  ${isMobileDevice
    ? css`
      padding: 0.7em 2.5rem;
    `
    : ''};
`

export const WatchLive = styled.div`
  display: flex;
  align-items: center;
`

export const WatchLiveText = styled.div`
  color: #EB5757;
  letter-spacing: .2rem;
`

export const WatchLiveCircle = styled.div`
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #CC0000;
  margin-right: 5px;
  ${isMobileDevice
    ? css`
      width: 15px;
      height: 15px;
    `
    : ''};
`

export const TeamsNameWrapper = styled.div`
  margin: 35px 0 40px;
  font-size: 20px;
  font-weight: 500;
  ${isMobileDevice
    ? css`
      margin: 10px 0;
      font-size: 2.4rem;
    `
    : ''};
`

export const MainInfoTitle = styled.div`
  font-weight: 600;
  font-size: 2rem;
  ${isMobileDevice
    ? css`
      font-size: 32px;
      margin-bottom: 15px;
    `
    : ''};
`

export const MainInfoButton = styled(ButtonSolid)`
  width: 260px;
  height: 50px;
  font-size: 20px;
  font-weight: 600;
  border-radius: 5px;

  ${isMobileDevice
    ? css`
      width: 100%;
      border-radius: 10px;
      font-size: 17px;
      margin-bottom: 30px;
    `
    : ''};
`

export const MainInfoText = styled.div`
  max-width: 400px;
  margin: 40px 0;
  font-size: 17px;
  line-height: 150%;
  ${isMobileDevice
    ? css`
      font-size: 2.2rem;
      margin: 0 0 25px;
    `
    : ''};
`

export const Footer = styled.div`
  font-size: 14px;
  background-color: black;
  padding: 16px 0;
  padding-left: 20%;
  width: 100%;
  @media ${devices.laptop} {
    padding-left: 5%;
  }
  @media ${devices.mobile} {
    padding-left: 35px;
  }
  ${isMobileDevice
    ? css`
      display: flex;
      padding: 15px 35px;
      justify-content: space-between;
      align-items: center;
    `
    : ''};
`

export const FooterLogo = styled(Logo)`
  display: none;
  ${isMobileDevice
    ? css`
      display: block;
      width: 48px;
      height: 11px;
      opacity: .4;
    `
    : ''};
`

export const FooterRights = styled.div`
  opacity: .5;
  ${isMobileDevice
    ? css`
      font-size: 12px;
    `
    : ''};
`

export const SportImgMobileDevice = styled(SportImgWrapper)`
  display: none;
  ${isMobileDevice
    ? css`
      display: block;
      height: 60%;
      width: 100%;
      margin-right: 0;
      @media screen and (orientation: landscape){    
        display: none;
      }
    `
    : ''};
`

export const EmptySpan = styled.span``
