import { styled } from "styled-components";

export const VideoPlayerContainer = styled.div`
  position: relative;
  overflow: hidden;
  /* background-color: #0000001a; */
  width: ${({ width }) => (width ? width : "auto")};
  height: ${({ height }) => (height ? height : "auto")};
  video {
    object-fit: contain;
  }
`;

export const VideoController = styled.div`
  position: absolute;
  padding: 22px 26px;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: flex-end;
  visibility: ${({ hide }) => (hide ? "hidden" : "visible")};
  .play_pause_wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    cursor: pointer;

    svg {
      width: 30px;
      height: 30px;
    }
  }
`;

export const RangeContainer = styled.div`
  border-radius: 16.5px;
  width: 100%;
  height: 29.307px;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 12.5px;
  height: 15px;
  gap: 15px;
  position: relative;
  max-width: 543px;
  width: 100%;
  margin: 0 auto;
  .range_body {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
  }
  .range-text {
    color: #b0dcdc;
    font-size: 10px;
    color: #636666;
    &.duration_text {
      color: #00c2c2;
    }
  }
  svg {
    cursor: pointer;
  }
  .range {
    border-radius: 9px;
    flex: 1;
    width: 100%;
    display: block;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
    cursor: pointer;
    background-color: transparent;

    &::-webkit-slider-runnable-track {
      height: 4px;
      background: rgba(198, 204, 204, 0.4);
      border-radius: 16px;
    }

    &::-moz-range-track {
      height: 4px;
      background: rgba(198, 204, 204, 0.4);
      border-radius: 16px;
    }

    &::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      height: 4px;
      width: 4px;
      background-color: #099;
      border-radius: 50%;
      border: 2px solid #099;
      box-shadow: -9999px 0 0 9993px #099;
    }

    &::-moz-range-thumb {
      height: 4px;
      width: 6px;
      background-color: #00c2c2;
      border-radius: 50%;
      border: 1px solid #009999;
      box-shadow: -9999px 0 0 9993px #009999;
    }
  }
  /* .range::-webkit-slider-thumb {
    box-shadow: 0 0 9999px ;
    border-radius: 9999px;
  } */
`;

export const VideoPrompts = styled.div`
  position: absolute;
  left: 0;
  right: 0;
  top: 20px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  div {
    cursor: pointer;
    border-radius: 0px 8px 8px 0px;
    background: #fff;
    height: 48px;
    min-width: 220px;
    padding: 2px 18px;
    border-radius: 0px 8px 8px 0px;
    width: fit-content;
    &:nth-child(2) {
      border-radius: 8px 0px 0px 8px;
    }
    p {
      font-size: 16px;
      font-weight: 700;
      line-height: 22px;
      &:nth-child(1) {
        color: #00c2c2;
        &::before {
          content: "";
          display: inline-block;
          border-radius: 50%;
          width: 12px;
          height: 12px;
          background-color: #00c2c2;
          margin-right: 7px;
        }
      }
      &:nth-child(2) {
        color: #febf10;
      }
    }
  }
`;

export const LoadingScreen = styled.div`
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background-color: rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;

  align-items: center;
  gap: 12px;
  .error {
    color: #f95454;
    text-align: center;
    padding: 0 16px;
    font-size: 14px;
    font-style: italic;
    font-weight: 500;
    margin-bottom: 100px;
    &.sm {
      font-size: 12px;
      margin-bottom: 16px;
    }
  }
`;

export const ErrorMessage = styled.div`
  width: ${({ width }) => (width ? width : "auto")};
  height: ${({ height }) => (height ? height : "auto")};

  background: #dbdbdb;

  display: grid;
  place-items: center;
  div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 40px;
    padding: 16px;
    img {
      width: 80px;
    }
    p {
      font-size: 22px;
      color: #4a4d4d;
      font-weight: 500;
    }
  }
  &.small {
    div {
      img {
        display: none;
      }
      p {
        font-size: 16px;
      }
    }
  }
`;
