import styled from 'styled-components';

export const StyledModal = styled.div<{width?: string; height?: string;}>`
  width: ${(p) => p.width || '90%'};
  height: ${(p) => p.height || '90%'};
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity ease 500ms;
  border-radius: 8px;
  flex-direction: column;
  iframe: {
    border: none;
  }
`

export const Footer = styled.div`
  align-self: flex-end;
  width: 100%;
`

export const StyledOverlay = styled.div`
  z-index: 1000;
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
`
export const CloseIcon = styled.div`
  position: absolute;
  right: 1em;
  top: 1em;
  width: 32px;
  height: 32px;
  opacity: 0.6;

  &:hover {
    opacity: 1;
  }
  &:before, &:after {
    position: absolute;
    left: 15px;
    content: ' ';
    height: 33px;
    width: 2px;
    background-color: #333;
  }
  &:before {
    transform: rotate(45deg);
  }
  &:after {
    transform: rotate(-45deg);
  }
`

export const WidgetWrapper = styled.div`
  display: flex;
  flex-direction: column;
  font-family: "Poppins", sans-serif !important;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(42, 44, 208, 0.15);
  height: 100%;
  box-shadow: 0 8px 32px 0 rgba(42, 44, 208, 0.15);
  &:last-child {
    border-bottom: none;
  }
  &.loading {
    position: relative
    z-index: 5;
    &:after {
      content: ' .';
      color: #2d7fff;
      position: relative;
      font-size: 60px;
      display: block;
      width: 60px;
      height: 0px;
      top: -65px;
      bottom: 0;
      right: 0;
      left: 0;
      margin: auto;
      z-index: 6;
      animation: dots 1s steps(5, end) infinite;
    }
    &::before {
      position: relative;
      z-index: 5;
      content: '';
      top: -75px;
      bottom: 0;
      right: 0;
      left: 0;
      background-color: rgba(255,255,255,0.7)
    }
  }
  @keyframes dots {
    0%, 20% {
      color: rgba(0,0,0,0);
      text-shadow:
        .25em 0 0 rgba(0,0,0,0),
        .5em 0 0 rgba(0,0,0,0);}
    40% {
      color: white;
      text-shadow:
        .25em 0 0 rgba(0,0,0,0),
        .5em 0 0 rgba(0,0,0,0);}
    60% {
      text-shadow:
        .25em 0 0 #2d7fff,
        .5em 0 0 rgba(0,0,0,0);}
    80%, 100% {
      text-shadow:
        .25em 0 0 #2d7fff,
        .5em 0 0 #2d7fff;
      }
    }
`

export const Spinner = styled.div`
  width: 0;
  height: 0;

  &::after {
    content: ' .';
    color: #ff975b;
    position: relative;
    font-size: 3em;
    display: block;
    top: -0.75em;
    left: 2em;
    margin: auto;
    animation: spinner-dots 1s steps(5, end) infinite;
  }

  @keyframes spinner-dots {
    0%, 20% {
      color: rgba(0,0,0,0);
      text-shadow:
        .25em 0 0 rgba(0,0,0,0),
        .5em 0 0 rgba(0,0,0,0);}
    40% {
      color: white;
      text-shadow:
        .25em 0 0 rgba(0,0,0,0),
        .5em 0 0 rgba(0,0,0,0);}
    60% {
      text-shadow:
        .25em 0 0 #2d7fff,
        .5em 0 0 rgba(0,0,0,0);}
    80%, 100% {
      text-shadow:
        .25em 0 0 #2d7fff,
        .5em 0 0 #2d7fff;
      }
    }
`;

export const Circle = styled.div<{background: string;}>`
  background: ${props => props.background}
  width: 40px !important;
  height: 40px;
  border-radius: 50%;
  border-color: lightgrey;
  margin: -45px 0px 0 0;
  border-width: thin;
  border-style: solid;
  flex-shrink: 0;
`

export const Box = styled.div`
  display: flex;
  flex: 1;
  padding: 25px;
  justify-content: space-around;
`

export const StyledCheckbox = styled.div`
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  height: 100%;
`

export const PolicyContainer = styled.div`
  text-align: center;
`

export const BoxTitle = styled.p`
  color: #a8afc9;
  font-size: 13px;
  margin-top: 5px;
  margin-bottom: 5px;
  padding-left: 52px;
`

export const Title = styled.div`
  display: flex;
  align-items: center;
  font-size: 1em;
  height: 4em;
  color: #3f4277;
  border-bottom: 1px solid rgba(42, 44, 208, 0.15);
  & p {
    margin: 2em;
  }
  & img {
    width: 32px;
    margin-left: 2em;
  }
`

export const BoxFlex  = styled.div`
  display: flex;
  align-items: center;
  img {
    height: 26px;
  }
`

export const BoxText = styled.p`
  color: #3f4277;
  font-size: 13px;
`

export const CentralizationBox = styled.div`
  width: 52px;
  img {
    margin: 0
    &:nth-child(2) {
      position: relative
      top:10px;
      right:18px;
    }
  }
`

export const Checkbox = styled.input`
  position: absolute;
  opacity: 0;
  width: 0;
  & + label {
    position: relative;
    cursor: pointer;
    padding: 0;
  }
  & + label:before {
    content: '';
    margin-right: 10px;
    display: inline-block;
    vertical-align: text-top;
    width: 16px;
    height: 16px;
    background: white;
    border: solid 1px #dae4f5;
    border-radius: 4px;
    position: absolute;
    left: -40px;
  }
  &:checked + label:before {
    background: #2c80ff;
  }
  &:checked + label:after {
    content: '';
    position: absolute;
    left: -37px;
    top: 9px;
    background: white;
    width: 2px;
    height: 2px;
    box-shadow:
      2px 0 0 white,
      4px 0 0 white,
      4px -2px 0 white,
      4px -4px 0 white,
      4px -6px 0 white,
      4px -8px 0 white;
    transform: rotate(45deg);
  }
`

export const Button = styled.button<{background?: string;}>`
  background: ${props => props.background || '#2d7fff'};
  color: ${props => props.color || '#fff'};
  width: 100%;
  padding: 20px 20px;
  border-radius: 4px;
  border: 1px solid;
  font-size: 15px;
  margin: 0px 10px 0 0;
  &:disabled {
    opacity: 0.5;
  }
`

export const ButtonLink = styled.a`
  display: block;
  text-align: center;
  background: #ebf2ff;
  color: #4b7ad2;
  font-size: 15px;
  font-weight: bold;
  padding: 20px;
  margin: 40px 0 20px;
  border-radius: 4px;
  text-decoration: none;
`

export const QuoteTitle = styled.div`
  color: #a8afc9;
  font-size: 18px;
`

export const Row = styled.div`
  display: flex;
  flex-grow: 1;
  flex-direction: row;
  padding: 15px 0;
  align-items: center;
  justify-content: space-between;
`

export const Option = styled.div`
  color: #b0b2bb;
  float: left;
`

export const Value = styled.div`
  float: right;
  color: #5d5d69;
`
