import styled from '@emotion/styled'
import { css, keyframes } from '@emotion/react'
import {
  Card
} from '@chakra-ui/react'


export const MainWrapper = styled.main`
  display: flex;
  justify-content: center;
  height: 100%;
`

export const InputWrapper = styled.div`
  position: relative;
  padding: 12px;
  display: flex;
  align-items: center;

  @media screen and (max-width: 600px) {
    flex-direction: column;
  }
`
export const InputLabel = styled.label`
  position: absolute;
  top: -8px;
  left: 24px;
  z-index: 2;
`
export const InputElement = styled.input`
  border: 1px solid #ccc;
  padding: 12px;
  font-size: 24px;
  border-radius: 8px;
  color: #117623;
  max-width: 90vw;
  box-shadow: inset 7px 8px 20px 8px #4990db12;
`

export const StyledCard = styled(Card)`
  box-shadow: 2px 2px 6px #0000005c;
  padding: 16px;
  border-radius: 12px;
  min-width: 400px;
`

export const ArrowImg = styled.img`
  width: 48px;
  height: 48px;
`

export const IconButton = styled.button`
  border: none;
  background-color: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  height: 100%;
`

const reveal = keyframes`
    0% {
        transform: scale(0.85, 0.85);
    }

    100% {
        transform: scale(1);
    }
`

export const StartWrapper = styled.div`
  animation: ${reveal} 0.4s ease forwards;
  height: calc(100vh - 300px);
  position: relative;
`

export const Wrapper = styled.div`
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: auto;
`

export const UnorderList = styled.ul`
  padding-left: 0px;
  height: 600px;
  overflow: auto;
  padding-right: 20px;
`

export const Svg = styled.svg`
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%);
`

export const Papper = styled.div`
  position: relative;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 32px 16px 16px;
  box-shadow: 2px 2px 6px #0000005c;
`

export const LessonItem = styled.li<{ warn?: boolean }>`
  list-style: none;
  background-color: #ffffff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 2px 2px 6px #0000005c;
  margin-bottom: 12px;
  transition: all 0.5;

  ${(props) =>
    props.warn
      ? css`
          background-color: #fde3c5;
          color: #919191;
          box-shadow: inset 3px 2px 7px #c9b5a9;
        `
      : ''}
`

export const AddMissedButton = styled.button`
  float: right;
  border: none;
  background-color: #00000000;
  opacity: 0.1;

  :hover {
    cursor: pointer;
    opacity: 1;
  }
`

export const Lessonname = styled.span`
  display: inline-box;
  margin-right: 12px;
  margin-bottom: 20px;
`

export const QRCanvas = styled.canvas`
  display: block;
`

export const ErrorSpan = styled.span`
  color: #f9e2e2;
  display: block;
  padding: 16px;
  background-color: #d32f0b;
  border-radius: 11px;
`

export const Cross = styled.button`
  position: absolute;
  right: 19px;
  top: 14px;
  font-size: 24px;
  padding: 7px;
  cursor: pointer;
  background-color: #fff;
  border: none;

  :hover {
    background-color: #d7181812;
    border-radius: 20px;
  }
`

export const AddButton = styled.button`
  background-color: transparent;
  border: none;
  cursor: pointer;

  :hover {
    box-shadow: 3px 2px 5px #00000038;
  }
`
