import styled from 'styled-components'

import { ButtonBase, hoverStyles } from '../../../../styled'

type FullscreenProps = {
  isFullscreen: boolean,
}

export const Controls = styled.div<FullscreenProps>`
  z-index: 14;
  position: absolute;
  width: 100%;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
  bottom: ${({ isFullscreen }) => (isFullscreen ? '20px' : 0)};
  
  @media (orientation: landscape){
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
  }
`

export const ControlsRow = styled.div`
  width: 100%;
  display: flex;
  justify-content: space-between;

  ${hoverStyles}

  justify-content: flex-start;

  :first-child {
    margin-bottom: 15px;
    padding: 0 15px;
  }

  :last-child {
    padding-left: 0;
    padding-right: 0;
  }
`

export const ControlsGroup = styled.div`
  display: flex;
  align-items: center;

  :last-child {
    margin-left: auto;
  }
`

export const Fullscreen = styled(ButtonBase)<FullscreenProps>`
  width: 20px;
  height: 18px;
  background-image: ${({ isFullscreen }) => (
    isFullscreen
      ? 'url(/images/player-fullscreen-off.svg)'
      : 'url(/images/player-fullscreen-on.svg)'
  )};
`

export const PlaybackTime = styled.span`
  font-weight: 700;
  color: #fff;
  font-size: 12px;
  width: 100px;
  white-space: nowrap;
`
