import styled from 'styled-components';

// Styled components
export const StyledTableWrapper = styled.div`
  overflow-x: auto;
  margin-top: 0;
  max-height: calc(100vh - 420px);
  min-height: calc(100vh - 420px);
  &::-webkit-scrollbar {
    width: 5px;
    border-radius: 100px;
    height: 5px;
  }

  &::-webkit-scrollbar-track {
    background: #777;
    border-radius: 100px;
  }

  &::-webkit-scrollbar-thumb {
    background: #7b61ff;
    border-radius: 100px;
  }

  &::-webkit-scrollbar-thumb:hover {
    background: #7b61ff;
  }
`;

export const StyledTable = styled.table`
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;

  thead tr {
    border-radius: 40px;
    border-spacing: 0;

    th:first-child {
      border-radius: 100px 0 0 100px;
      border-left: 1px solid rgba(0, 0, 0, 0.08);

    }
    th:last-child {
      border-radius: 0px 100px 100px 0;
      border-right: 1px solid rgba(0, 0, 0, 0.08);
    }
  }

  tbody tr {
    border-radius: 40px;

    td:first-child {
      border-radius: 100px 0 0 100px;
      border-left: 1px solid rgba(0, 0, 0, 0.08);

    }
    td:last-child {
      border-radius: 0px 100px 100px 0;
      border-right: 1px solid rgba(0, 0, 0, 0.08);
    }
    td.notFound:last-child {
      border-radius: 100px;
      
    }
    &:nth-child(even) td {
      background: #f6fbff;
    }
    td {
      .red {
        background: red;
      }
      .redColor {
        color: #e95252;
      }
      &.fixWidth {
        width: 200px;
      }
    }
  }
  &.mainTable {
    border-spacing: 0 6px;
    svg.tomTomIcon { 
    transform: scale(0.8);
}
  }
`;

export const StyledThBase = styled.th`
  color: #2C2D33;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
  padding: 5px 15px;
  background: #f0f2f2;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-right: none;
  border-left: none;
  text-align: left;
`;

export const StyledTdBasic = styled.td`
  /* color: #3a3630; */
  color: #6E7079;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  padding: 5px 15px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-right: none;
  border-left: none;

  input [type='checkbox'] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(70, 78, 95, 0.32);
  }
`;

export const StyledFlex = styled.div`
  display: flex;
  gap: 8px;
  align-items: center;
  em {
    padding-left: 8px;
    border-left: 2px dotted #758588;
    font-style: normal;
  }
  span {
    display: block;
    line-height: 1;
    &:first-child {
      margin-bottom: 5px;
    }
  }
`;
export const StyledRoundedBorder = styled.div`
  border-radius: 30px;
  border: 1px solid #edefef;
  background: #f6fbff;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
`;

export const RouteName = styled.div`
  font-weight: 600;
  color: #09f;
  margin-bottom: 6px;
`;

export const StyledFlexGap4 = styled.div`
  display: flex;
  gap: 4px;
  align-items: center;
`;

export const TomtomName = styled.div`
  color: #6E7079;
  font-size: 14px;
  font-weight: 600;
  line-height: 24px;
`;
export const StyledLineBreak = styled.div``;
export const Weight = styled.div`
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
`;

export const StyledIconCover = styled.div`
  display: flex;
  align-items: center;
  gap: 8px;
  span {
    margin-top: 4px;
    &.ascending svg path:first-child {
      fill: #000;
    }
    &.descending svg path:last-child {
      fill: #000;
    }
  }
`;

export const TomtomCover = styled.div`
  transform: scale(0.5);
`;

export const CustomDrop = styled.div`
  border-radius: 20px;
  border: 1px solid #e2e0db;
  background: #fff;
  display: flex;
  padding: 4px 8px;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  &.active .drop {
    transform: rotate(180deg);
  }
`;

export const CoverCustomDrop = styled.div`
  position: relative;
`;

export const IconCoverData = styled.div`
  display: flex;
  gap: 8px;
  align-items: center;
  svg {
    cursor: pointer;
  }
`;

//  For route details
export const StyledCollapseWrapper = styled.div`
  border-radius: 15px;
  border: 1px solid #e3e3e3;
  background: #fff;
  box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);
  padding-bottom: 10px;
`;

export const StyledCollapseHeadWrapper = styled.div`
  border-bottom: 1px solid #e3e3e3;
  background: #f8fafc;
  display: flex;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 15px 15px 0 0;
`;

export const StyledCollapseBody = styled.div`
  /* padding-left: 45px; */
  position: relative;
  padding-right: 15px;
`;

// Inside table
export const StyledTableNexted = styled(StyledTable)`
  border-spacing: 0;
  td {
    position: relative;
  }
  .outerBorder {
    border-radius: 100px;
    border: 1px solid #edefef;
    background: #fff;
    padding: 8px 0;
    margin-top: 12px;
    position: relative;
    margin-left: 42px;
    padding-left: 15px;
    width: 98%;
    overflow: auto;

    td {
      em {
        color: #8e8a85;
        span {
          white-space: nowrap;
        }
      }
      .recepientName {
        color: #09f;
        font-weight: 600;
      }
      td td {
        padding: 0 10px;
      }
    }

    .HiddenArea {
      display: block;
      min-width: 30px;
      visibility: hidden;
    }
    .HiddenAreaLink {
      display: block;
      min-width: 40px;
      visibility: hidden;
    }
    &.activeList {
      border-radius: 15px;
    }
  }
  tbody {
    tr {
      td {
        &:last-child {
          border: none;
        }
      }
      &:nth-child(even) td {
        background: none;
      }
    }
  }

  .secondLable {
    margin-left: 15px;
    border-radius: 12px;

    border: 1px solid #edefef;
    background: #fff;
    border-spacing: 0;
    overflow: hidden;
    margin-top: 20px;
    tr {
      td {
        padding: 15px 10px;
        &:first-child {
          width: 128px;
        }
        border-bottom: 1px solid #edefef;
      }
    }
    tbody tr td {
      border-bottom: 1px solid #edefef !important;
      border-radius: 0;
    }
  }

  .topHead {
    border-radius: 40px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f0f2f2;
    padding: 2px 15px;
    margin-left: 45px;

    svg.tomTomIcon {
      transform: scale(0.7);
      position: relative;
      left: 4px;
    }
  }

  .headCoverFLex {
    display: flex;

    > div {
      display: flex;
      align-items: center;
      font-weight: 600;
      font-size: 13px;
      /* margin: 0 7px; // head space */
      padding: 0 4px 0 15px;
    }
  }
  .row {
    &:last-child .timeTrackOuter {
      display: none;
    }
  }
`;
export const StyledTh = styled(StyledThBase)`
  background: none;
  padding: 0px;
  border-radius: 0 !important;
  border: none;
  padding: 14px 20px;
  border-radius: 15px 0px 0px 0px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);

  background: #f8fafc;
`;

export const StyledTd = styled(StyledTdBasic)`
  background: none;
  border: none;
  padding: 0;
  td td {
    padding: 0 10px;

  }

`;

export const StyledDateWrapper = styled.div`
  border-radius: 100px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #faf9f9;
  padding: 6px 8px;
  color: #888075;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  display: inline-block;
`;

export const StyledLocationName = styled.div`
  color: #fc7743;
`;

export const StyledCompleteState = styled.div`
  border-radius: 22px;
  background: rgba(41, 204, 106, 0.15);
  display: flex;
  padding: 6px 10px;
  justify-content: center;
  align-items: center;
  color: #1f9254;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
`;

export const StyledToggleStatus = styled.div`
  border-radius: 20px;
  border: 1px solid rgba(233, 82, 82, 0.5);
  background: rgba(233, 82, 82, 0.15);
  padding: 2px 8px;
  display: flex;
  cursor: pointer;

  &.active .coverArrow {
    transform: rotate(0deg);
    position: relative;
    top: 2px;
  }
  .coverArrow {
    transform: rotate(180deg);
    position: relative;
    top: -2px;
  }

  .circle {
    width: 24px;
    height: 24px;
    border-radius: 100px;
    border: 1px solid #e95252;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    &:after {
      content: '';
      width: 10px;
      height: 10px;
      border-radius: 100px;
      background: #e95252;
    }
  }
`;

export const StyledTimeTrack = styled.div`
  border-radius: 12px;
  background: #fff;

  position: absolute;
  top: 86px;
  left: 3px;
  min-width: 36px;
  span {
    padding: 2px 6px;
    color: #687d9b;
    font-weight: 600;
    font-size: 11px;
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 100px;
    border: 1px solid #edefef;
  }

  i {
    width: 2px;
    height: 36px;
    background: #7b91b0;
    display: block;
    position: absolute;
    top: 58%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 1;
    &:after,
    &::before {
      width: 5px;
      height: 5px;
      display: block;
      background: #7b91b0;
      position: absolute;
      top: -5px;
      content: '';
      border-radius: 100px;
      left: -1px;
    }
    &:after {
      top: auto;
      bottom: -4px;
    }
  }
`;

export const StyledWeight = styled.div`
  font-size: 13px;
  color: #e95252;
`;
export const StyledCube = styled(StyledWeight)`
  font-size: 10px;
`;
