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

import { isMobileDevice } from 'config/userAgent'

import { popupScrollbarStyles } from 'features/PopupComponents'
import { customScrollbar } from 'features/Common'

export const Wrapper = styled.div`
  width: 100%;
  max-height: 600px;
  overflow-y: auto;
  
  ${customScrollbar}
`

export const SubscriptionsWrapper = styled.div`
  width: 100%;
  height: 480px;
  overflow-y: auto;
  margin-bottom: 28px;

  ${popupScrollbarStyles}

  ${isMobileDevice
    ? css`
        margin-bottom: 35px;
    `
    : ''};
`

export const ScItem = styled.div`
  font-weight: 500;
  font-size: 18px;
  line-height: 22px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: row;
  margin-bottom: 25px;

  .additional_info {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
    font-size: 13px;
    line-height: 22px;
    text-transform: none;

    ${isMobileDevice
    ? css`
      font-size: 10px;
      line-height: 15px;
      margin-top: 20px;

    `
    : ''};
  }

  ${isMobileDevice
    ? css`
      flex-direction: column;
      margin-bottom: 20px;

    `
    : ''};

  .payment_title {
    width: 360px;

    ${isMobileDevice
    ? css`
      font-size: 10px;
      width: 150px;
    `
    : ''};
  }

  .change {
    margin-left: 10px;
    text-decoration: underline;
    text-transform: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
  }

  .payment_method {
    display: flex;
    flex-direction: row;
  }
`

export const ScText = styled.span<({ isActive?: boolean })>`
  color: ${({ isActive }) => (isActive ? '#FFFFFF' : 'rgba(255, 255, 255, 0.6)')};
  max-width: 560px;
  text-transform: capitalize;
  
  ${isMobileDevice
    ? css`
      font-size: 14px;
      line-height: 17px;
      align-items: center
    `
    : ''};
  
  `

export const ScCard = styled.div`
  margin-right: 50px;

  ${isMobileDevice
    ? css`
      margin: 0;
      width: 150px;
    `
    : ''};
  `

export const ScBtnWrap = styled.div`
  min-width: 360px;

  ${isMobileDevice
    ? css`
      min-width: 100%;
      display: flex;
      justify-content: center;
    `
    : ''};
`

export const ScSubscribe = styled.div`
  margin-bottom: 70px;
`

export const ScItemPaymentSum = styled.div`
  ${isMobileDevice
    ? css`
      display: flex;
      flex-direction: row;
    `
    : ''};
`

export const ScCancelButton = styled.button`
  border: none;
  outline: none;
  padding: 0;
  background-color: transparent;
  cursor: pointer;
  background: #294FC4;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  width: 100%;
  max-width: 244px;
  height: 50px;

  font-weight: 600;
  font-size: 20px;
  line-height: 50px;
  color: #FFFFFF;

  :disabled {
    opacity: 0.5;
  }

  ${isMobileDevice
    ? css`
      font-size: 16px;
      line-height: 16px;
      min-width: 100%;
    `
    : ''};
`

export const ScLoaderWrapper = styled.div`
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
`
