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

import { isMobileDevice } from 'config/userAgent'

import { customScrollbar, customStylesMixin } from 'features/Common'

export const Label = styled.label`
  letter-spacing: -0.01em;
  color: #999999;
  font-size: 16px;
`

export const PopOver = styled.ul`
  position: absolute;
  width: 100%;
  top: 55px;
  left: -1px;
  overflow: auto;
  z-index: 2;
  background: rgb(102, 102, 102);

  ${customScrollbar};
  ${customStylesMixin};
`

export const ListOption = styled.li.attrs(() => ({
  role: 'option',
  tabIndex: 0,
}))<{isHighlighted?: boolean}>`
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  padding-left: 24px;
  color: ${({ isHighlighted }) => (
    isHighlighted
      ? '#fff'
      : '#ccc'
  )};
  background-color: ${({ isHighlighted }) => (
    isHighlighted
      ? '#999'
      : '#3F3F3F'
  )};
  cursor: pointer;

  &:hover {
    background-color: #999;
    color: #fff;
  }

  ${isMobileDevice
    ? css`
      font-size: 12px;
      height: 36px;
      padding-left: 14px;
    `
    : ''};
`
export const WrapperIcon = styled.span`
  position: absolute;
  right: 22px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-60%);

  ${isMobileDevice
    ? css`
      right: 11px;
    `
    : ''};
`

export const ScAudioWrap = styled.div`
  margin-left: 20px;
`

export const ScLoaderWrapper = styled.div`
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  ${isMobileDevice
    ? css`
      max-width: 95vw;
      left: 0;
      border-radius: 4px;
      @media screen and (orientation: landscape){
        max-width: 368px;
      }
    `
    : ''};
`
