import styled from 'styled-components/macro'

import { devices } from 'config/devices'

export const ButtonsBlock = styled.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 80px;
  margin-bottom: 96px;
  position: relative;

  @media ${devices.mobile} {
    bottom: 20px;
    margin-bottom: 0;
    position: absolute;
  }
`

type SubscriptionsBlockProps = {
  forAdditionalTitle?: boolean,
  isSubsStep?: boolean,
}

export const SubscriptionList = styled.ul`
  display: flex;
  margin-top: 40px;

  @media ${devices.laptop} {
    margin-top: 27px;
  }

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

export const SubscriptionsBlock = styled.div<SubscriptionsBlockProps>`
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: ${({ forAdditionalTitle }) => (forAdditionalTitle ? '75px' : '80px')};

  @media ${devices.laptop} {
    margin-top: ${({ forAdditionalTitle, isSubsStep }) => {
    if (forAdditionalTitle) return '42px'
    if (isSubsStep) return '84px'
    return '80px'
  }};
  }

  @media ${devices.tablet} {
    margin-top: ${({ forAdditionalTitle, isSubsStep }) => {
    if (forAdditionalTitle) return '42px'
    if (isSubsStep) return '50px'
    return '80px'
  }};
  }
`

export const BlockTitle = styled.span`
  display: block;
  font-style: normal;
  font-weight: bold;
  font-size: 36px;
  line-height: 24px;
  color: ${({ theme: { colors } }) => colors.text};
  transition: color 0.3s ease-in-out;

  @media ${devices.tablet} {
    font-size: 24px;
    font-weight: 600px;
  }
`

export const AdditionalBlockTitle = styled(BlockTitle)`
  font-size: 32px;
  margin-bottom: 40px;

  @media ${devices.laptop} {
    margin-bottom: 30px;
  }

  @media ${devices.tablet} {
    font-size: 24px;
    font-weight: 600px;
  }
`

export const SubscriptionListItem = styled.li``

export const SubscriptionWrapper = styled.div`
  position: relative;
  width: 288px;
  height: 216px;
  padding: 24px;
  margin: 0 8px;
  display: flex;
  flex-direction: column;
  background: #3F3F3F;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.4);
  border-radius: 2px;

  @media ${devices.tablet} {
    padding: 0;
    align-items: center;
    justify-content: center;
    width: 163px;
    height: 100px;
    border-radius: 10px;
  }
`

export const SubscriptionTitle = styled.span`
  font-style: normal;
  font-weight: bold;
  font-size: 18px;
  line-height: 21px;
  color: ${({ theme: { colors } }) => colors.text};
`
type RowProps = {
  isPriceRow?: boolean,
}

export const Row = styled.div<RowProps>`
  position: absolute;
  display: flex;
  align-items: center;
  left: ${({ isPriceRow }) => (isPriceRow ? '70px' : '')};
  bottom: ${({ isPriceRow }) => (isPriceRow ? '100px' : '')};

  @media ${devices.tablet} {
    position: static;
    margin-top: ${({ isPriceRow }) => (isPriceRow ? '9px' : '')};
  }
`

export const PricesBlock = styled.div`
  width: 1200px;
  display: flex;
  justify-content: space-between;
  position: relative;

  @media ${devices.mobile} {
    max-width: 370px;
    overflow-x: auto;

  }
`

export const TotalInfoBlock = styled.div`
  width: 201px;
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  top: 4px;
  left: 294px;

  @media ${devices.tablet} {
    position: static;
    margin-bottom: 10px;
    width: 100%;
  }
`

export const TotalInfoText = styled.span`
  font-weight: normal;
  font-size: 14px;
  line-height: 22px;
  color: rgba(255, 255, 255, 0.3);
`

export const TotalPriceAmmount = styled(TotalInfoText)`
  font-weight: bold;
  margin-left: 6px;
`

export const TotalPriceDetails = styled(TotalInfoText)`
  text-transform: uppercase;
  margin-left: 7px;
`
