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

import { isMobileDevice } from 'config/userAgent'

import { popupScrollbarStyles } from 'features/PopupComponents'

export const Wrapper = styled.div`
  width: 100%;
`

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

  ${popupScrollbarStyles}
`

export const Tabs = styled.div`
  display: flex;
  margin-bottom: 40px;
  ${isMobileDevice
    ? css`
      margin-top: 15px;
    `
    : ''}
`

type TabProps = {
  active?: boolean,
}

export const Tab = styled.button<TabProps>`
  position: relative;
  border: none;
  padding: 0;
  background-color: transparent;
  width: 288px;
  font-weight: 600;
  font-size: 16px;
  line-height: 50px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;

  ${({ active, theme }) => (
    active
      ? css`
        color: ${theme.colors.text100};

        ::after {
          position: absolute;
          bottom: 0;
          left: 0;
          content: '';
          width: 100%;
          height: 4px;
          background-color: #fff;
        }
      `
      : '')}

  ${isMobileDevice
    ? css`
      font-size: 14px;
      line-height: 14px;
      ::after {
        bottom: -15px;
        height: 2px;
      }
      @media (orientation: landscape){
        width: 50%;
      }
    `
    : ''}
`
