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

import { isMobileDevice } from 'config/userAgent'

import { ModalWindow } from 'features/Modal/styled'
import { Modal as BaseModal } from 'features/Modal'
import { customScrollbar, ButtonSolid } from 'features/Common'
import { HeaderTitle } from 'features/PreferencesPopup/styled'

export const ScModalContainer = styled(BaseModal)`
  z-index: 100;
  ${ModalWindow} {
    width: 1446px;
    height: 670px;
    padding: 0;
    background: #333333;
    border-radius: 5px;
    ${customScrollbar}
    
    ${isMobileDevice
    ? css`
         width: 95vw;
         height: 85vh;

         @media screen and (orientation: landscape){
           max-height: 70vh;
           min-width:95vw;
         }
         `
    : ''};
  }
`

export const ScBody = styled.div`
  padding: 30px 0px;
  display: flex;
  flex-direction: column;

  ${isMobileDevice
    ? css`
            padding: 20px 0;
      `
    : ''};
`

export const ScHeaderTitle = styled(HeaderTitle)`
  display: flex;
  justify-content: center;
  width: 100%;
  font-weight: 700;
  font-size: 24px;
  line-height: 34px;

  ${isMobileDevice
    ? css`
            font-size: 15px;
            line-height: 18px;
      `
    : ''};
`

export const ScGroups = styled.div`
  display: flex;
  flex-direction: row;
  margin: 50px 70px;
  width: 100%;

  ${isMobileDevice
    ? css`
            margin: 20px 0 0 0;
            width: auto;  
            overflow-y: auto;
          `
    : ''};
`

export const ScGroup = styled.div`
  width: 100%;
  ${isMobileDevice
    ? css`
            height: 65vh;

            @media screen and (orientation: landscape){
              height: 37vh;
            }
      `
    : ''};
`

export const ScGroupName = styled.span`
  display: block;
  font-weight: 500;
  font-size: 24px;
  line-height: 28px;
  margin-left: 10px;

  ${isMobileDevice
    ? css`
            font-size: 15px;
            line-height: 17px;
      `
    : ''};
`

export const ScTeamsList = styled.div`
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;

    max-height: 389px;
    margin-top: 20px;

  ${isMobileDevice
    ? css`
            flex-wrap: unset;
            max-height: unset;

            @media screen and (orientation: landscape){
              max-height: 500px;
              flex-wrap: wrap;
            }

            > * {
              margin-bottom: 15px;
              max-width: 150px;
            }

          `
    : ''};
`

export const ButtonsBlock = styled.div`
  display: flex;
  justify-content: center;

  ${isMobileDevice
    ? css`
            margin-top: 15px;
`
    : ''};
`

export const Button = styled(ButtonSolid)`
  width: 134px;
  height: 50px;
  background: #294FC4;
  border-radius: 5px;

  ${isMobileDevice
    ? css`
            width: 300px;
            height: 40px;
      `
    : ''};
`
