import styled from 'styled-components';

// Styled components
export const StyledTableWrapper = styled.div`
  overflow-x: auto;
  max-height: calc(100vh - 290px);
  scrollbar-width: none;
  /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */
  &::-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`
  border-spacing: 0 10px;
  width: 100%;
  padding: 10px;
  thead {
    tr {
      border-radius: 40px;
      border-spacing: 0 10px;
      th {
        color: #3a3630;
        font-size: 14px;
        font-style: normal;
        font-weight: 600;
        line-height: normal;
        padding: 5px 15px;
        background: #f0f2f2;
        border-right: none;
        border-left: none;
        text-align: left;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-width: 1px 0;
        text-transform: capitalize;
        &:first-child {
          border-radius: 100px 0 0 100px;
          border-left: 1px solid rgba(0, 0, 0, 0.08);
        }
        &:last-child {
          border-radius: 0px 100px 100px 0;
          border-right: 1px solid rgba(0, 0, 0, 0.08);
        }
      }
    }
  }
  tbody {
    tr {
      td {
        color: #3a3630;
        font-size: 13px;
        font-style: normal;
        font-weight: 400;
        line-height: normal;
        padding: 12px 15px;
        background: #fff;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-right: none;
        border-left: none;
      }
      .link {
        color: #09f;
        font-family: Roboto;
        font-weight: 400;
        cursor: pointer;
      }
      td {
        .flex {
          display: flex;
          gap: 4px;
          align-items: center;
        }
        .overDue {
          border-radius: 20px;
          border: 1px solid #edebe8;
          background: #fff;
          padding: 4px 8px;
          color: #e95252;
          font-size: 12px;
          font-style: normal;
          font-weight: 600;
          line-height: 16px;
        }
      }
      &:nth-child(even) td {
        background: #f6fbff;
      }
      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);
      }
      .emptyTd {
        border-radius: 100px !important;
      }
      .flex {
        display: flex;
        flex-direction: row;
        gap: 5px;
        height: 29px;
        align-items: center;
      }

      &.insideTable {
        td {
          border-radius: 0;
          border: none;
          &:last-child {
            border-radius: 0;
            border-right: none;
          }
        }
        table {
          border-spacing: 0;
          width: 100%;
          border-radius: 5px;
          border: 1px solid rgba(0, 0, 0, 0.08);
          overflow: hidden;
          border-top-left-radius: 15px;
          border-top-right-radius: 15px;
          thead {
            tr {
              border-bottom: none;
              th {
                padding: 14px 20px;
                text-align: left;
                border-top: 0;
                border-right: 0;
                border-left: 0;
                background: #f8fafc;
                &:first-child {
                  border-radius: 0;
                  border-left: 1px solid rgba(0, 0, 0, 0.08);
                  border-top-left-radius: 15px;
                }
                &:last-child {
                  border-radius: 0;
                }
              }
            }
          }
          tbody {
            tr {
              td {
                padding: 14px 20px;
                text-align: left;
                border-bottom: 1px solid rgba(58, 54, 48, 0.15);
                background: #fff;
                > svg {
                  transform: scale(1.5);
                  background-color: #edebe8;
                  border-radius: 20px;
                  padding: 5px;
                }
                &:last-child {
                  border-radius: 0;
                  border-right: none;
                }
              }
            }
          }
        }
      }
    }
  }
  .actions {
    display: flex;
    align-items: center;
    gap: 20px;
    > svg {
      transform: scale(1.5);
      background-color: #edebe8;
      border-radius: 20px;
      padding: 5px;
    }

    .close-icon {
      transform: scale(1.3);
      background-color: transparent;
      border-radius: 0;
      padding: 0;
    }
  }
`;

export const EmptyDataContainer = styled.div`
  display: flex;
  justify-content: center;
`;

export const Badge = styled.div`
  div {
    display: flex;
    min-width: 85px;
    padding: 6px 10px;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: 22px;
    font-family: 'Open Sans';
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
  }
`;

export const BadgeStatus = styled.div`
  &.pending {
    background: #fff1d6;
    color: #f4a503;
  }

  &.resolved {
    background: rgba(41, 204, 106, 0.15);
    color: #1f9254;
  }

  &.overdue {
    background: rgba(233, 82, 82, 0.15);
    color: var(--contextual-red, #e95252);
  }
`;

export const ClearAll = styled.div`
  border-radius: 20px;
  border: 1px solid #edebe8;
  background: #fff;
  display: flex;
  padding: 6px 6px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;

  &.active {
    background: #313130;
    & > div {
      color: #fff;
    }
  }
`;
export const StyledFilterBtnIcon = styled.div`
  display: flex;
  width: 24px;
  height: 24px;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
  border: 1px solid #e2e0db;
  background: #f1f5f6;
  .cross {
    position: relative;
    &:after {
      display: inline-block;
      content: 'X';
      font-style: normal;
      font-size: 14px;
      color: #000;
    }
  }
`;
export const StyledFilterBtnLabel = styled.div`
  color: #6a7378;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
  white-space: nowrap;
`;
