import styled from "styled-components";

export const Container = styled.div`
  width: 100%;
  border-radius: 20px;
  background: #fffdf6;
  padding: 40px;
  max-width: 810px;
  &.isAudioError {
    background: #dfe5e5;
  }
`;

export const Player = styled.div`
  display: grid;
  place-items: center;
  gap: 40px;
  width: 100%;
  grid-template-columns: 185px 1fr;
`;

export const PlayPauseBtnContent = styled.div`
  width: 185px;
  height: 185px;
  border-radius: 50%;
  position: relative;
  background: #f5da8c;
  display: grid;
  place-items: center;
  &::before {
    content: "";
    position: absolute;
    border-radius: 86.5px;
    width: 153px;
    height: 153px;
    background: #feeebe;
    border: 7px solid #e4c56d;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
  &.isAudioErrorBtn{
    background:#F5F7F7;
    &::before{
      background:#fff ;
      border: 4px solid #C6CCCC;
    }
  }
`;

export const PlayPauseControl = styled.div`
  width: 109px;
  height: 109px;
  background-color: #fff;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  & > .sound_icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    &.sound_icon_left {
      left: 5px;
    }
    &.sound_icon_right {
      right: 5px;
    }
  }

  & > button {
    border: none;
    outline: none;
    background-color: #febf10;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;

    &:disabled {
      background-color: #c6cccc;
      cursor: not-allowed;
    }
  }
  & > p {
    color: #7c8080;
    font-size: 14px;
    font-weight: 400;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 8px;
    white-space: nowrap;
    line-height: 20px;
  }

  &.isAudioErrorControl {
    & > p {
      color: #dfe5e5;
    }
  }
`;

export const PlayerContent = styled.div`
  border-radius: 20px;
  background: #fff;
  width: 100%;
  padding: 20px;
  min-height: 185px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  &.isAudioErrorContent {
    background: #f5f7f7;
  }
`;

export const PlayerContentHeader = styled.div`
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  justify-content: flex-end;

  p {
    font-size: 16px;
    color: #949999;
    font-weight: 600;
    width: 100%;
    flex: 1;
  }
`;

export const PlayerContentBotton = styled.div`
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
`;

export const ProggessSection = styled.div`
  display: flex;
  flex-direction: column;
  gap: 3.5px;
  width: 100%;
`;
export const ProggessSectionHeader = styled.div`
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  gap: 20px;
  & > span {
    color: #7c8080;
    font-size: 14px;
    line-height: 24px;
  }
  &.isAudioErrorProgressTime{
    & > span{
      color:#C6CCCC;
    }
  }
`;

export const Progress = styled.div`
  position: relative;
  margin: 3.5px 0;
  border-radius: 50px;
  background: ${({ $error }) => ($error ? "#C6CCCC" : "#fef1cb")};
  height: 5px;
  /* overflow: hidden; */ /* Keep this visible if you want the badge to pop out top/bottom */

  &::before {
    content: "${({ $value }) => $value || "00:00"}";
    position: absolute;
    top: -3.5px;

    /* Dynamic positioning */
    left: ${({ $percentage = 0 }) => `${$percentage}%`};
    transform: translateX(${({ $percentage = 0 }) => `-${$percentage}%`});

    height: 12px;
    padding: 0 6px;
    background-color: ${({ $error }) => ($error ? "#C6CCCC" : "#febf10")};
    color: #fff;
    font-size: 6px;
    display: grid;
    place-content: center;
    border-radius: 100px;
    white-space: nowrap;
    z-index: 2;
  }

  &::after {
    content: "";
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    background-color: ${({ $error }) => ($error ? "#C6CCCC" : "#febf10")};
    border-radius: 100px;
    width: ${({ $percentage = 0 }) => `${$percentage}%`};
  }
`;

export const PlayerContentBottonSpeed = styled.div`
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  justify-content: space-between;
  span {
    color: #febf10;
    font-size: 14px;
  }
  button {
    display: flex;
    align-items: center;
    border: none;
    background-color: transparent;
    gap: 6px;
    cursor: pointer;
    border-radius: 10px;
    padding:5px 10px;
    &:disabled{
      cursor: not-allowed;
    }
  }

  &.isAudioErrorButtonSpeed{
    span{
      color:#DFE5E5;
    }
    button{
      background: #FFF;
    }
  }
`;
