import { Button } from '@bjsdistribution/dms-component-library';
import styled from 'styled-components';

export const IconContainers = styled.div`
  display: flex;
  gap: 5px;
  i {
    display: flex;
    width: 25px;
    height: 25px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    border-radius: 15px;
    background: #edebe8;
    svg {
    }
  }
`;

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

export const ModalTitle = styled.span`
  font-size: 20px;
  font-weight: 900;
  line-height: 32px;
  margin: 5px;
  padding: 0;
  text-transform: uppercase;
  align-items: center;
  display: flex;
  justify-content: center;
`;

export const Description = styled.span`
  color: #aea9a1;
  padding: 10px;
`;

export const Container = styled.div`
  display: flex;
  align-items: center;
  justify-content: center;
  width: 75px;
  height: 75px;
  padding: 14px;
  border-radius: 50%;
  background: #eff2f5;
  border: 10px solid #b7d0f7;
`;

export const ConfirmButton = styled(Button)``;

export const CancelButton = styled.button`
  cursor: pointer;
  font-size: 16px;
  opacity: 1;
  background: white;
  color: #3a3630;
  border: thin solid #3a3630;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 6px;
`;

export const SectionsContainer = styled.div`
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px;
  text-align: center;
`;

export const MainContainer = styled.div`
  padding: 24px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0px 20px 24px -4px #10182814;
  width: 30%;
  max-width: 50%;
  margin: 0 auto;
  @media (max-width: 1024px) {
    max-width: 40%;
  }
`;

export const ButtonContainer = styled.div`
  display: flex;
  flex-direction: row;
  gap: 10px;
`;

// export const StyledTable = styled.table`
//   border-spacing: 0 12px;
//   width: 100%;
//   thead {
//     tr {
//       border-radius: 40px;
//       border-spacing: 0 12px;
//       th {
//         color: #3a3630;
//         font-size: 14px;
//         font-style: normal;
//         font-weight: 600;
//         line-height: normal;
//         padding: 11px 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;
//         &: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;

//         > svg {
//           transform: scale(1.5);
//           background-color: #edebe8;
//           border-radius: 20px;
//           padding: 5px;
//         }
//       }
//       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);
//       }
//       .flex {
//         display: flex;
//         flex-direction: row;
//         gap: 15px;
//         height: 29px;
//         align-items: center;

//         > svg {
//           transform: scale(1.5);
//           background-color: #edebe8;
//           border-radius: 20px;
//         }
//       }
//     }
//   }
// `;

export const Header = styled.div`
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e3e3e3;
`;

export const HeaderText = styled.div`
  color: #3a3630;
  font-size: 16px;
  font-weight: 500;
  text-transform: uppercase;
  padding: 10px;
`;

export const Padding = styled.div`
  padding: 0px 10px 10px 10px;
`;

export const HeaderCont = styled.div`
  display: flex;
  flex-direction: column;
  padding: 10px;
`;

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

export const SendButton = styled(Button)`
  border-radius: 25px;
  &:disabled {
    background-color: #d3d3d3;
    cursor: not-allowed;
  }
`;

export const TdWrapper = styled.span`
  background-color: rgba(153, 153, 153, 0.1);
  padding: 3px 12px;
  border-radius: 4px;
`;

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

export const StyledTable = styled.table`
  border-spacing: 0 10px;
  width: 100%;
  /* min-width: 1600px; */
  thead {
    white-space: nowrap;
    position: sticky;
    top: 10px;
    z-index: 1;
    background: #fff;
    box-shadow: 0px 0px 1px #ffffff, 0px -10px 1px #ffffff;
    tr {
      border-radius: 40px;
      border-spacing: 0 10px;
      position: relative;
      font-family: 'lato', sans-serif;
      .emailInvoiceCheckbox {
        padding-right: 0px;
        width: 0;
        > div {
          width: fit-content;
        }
      }
      .custom-check {
        position: absloute;
      }
      .emailInvoiceNo {
        padding-left: 0px;
      }
      .emailInvoiceShare {
        width: 100px;
      }
      th {
        color: #3a3630;
        font-size: 14px;
        font-style: normal;
        font-weight: 600;
        line-height: normal;
        padding: 11px 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;
        &: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);
        }
        .sortIconClass {
          cursor: pointer;
          display: flex;
        }
      }
    }
  }
  tbody {
    max-height: 400px;
    overflow-y: auto;
    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;
        position: relative;
        .actionbox {
          display: flex;
          gap: 5px;
        }
        .shareIconContainer {
          display: flex;
          padding: 2px 12px;
          align-items: center;
          gap: 8px;
          border-radius: 20px;
          border: 1px solid var(--tonal-brown-101, #e2e0db);
          background: #fff;
          list-style-type: none;
          /* padding-left: 0; */
          /* fontWeight: 600,
          paddingLeft: 0, */
          cursor: pointer;
          position: relative;
        }
        .statusCancelled {
          color: #e95252;
          /* background: rgba(233, 82, 82, 0.15); */
          padding: 4px 8px;
          border-radius: 4px;
        }

        .statusOnHold {
          color: #f4a503;
          /* background: #fff1d6; */
          padding: 4px 8px;
          border-radius: 4px;
        }

        .statusSubContracted {
          color: #845adf;
          /* background: rgba(132, 90, 223, 0.15); */
          padding: 4px 8px;
          border-radius: 4px;
        }

        .statusAwaiting {
          color: #845adf;
          /* background: rgba(132, 90, 223, 0.15); */
          padding: 4px 8px;
          border-radius: 4px;
        }

        .statusCompleted {
          color: #1f9254;
          /* background: rgba(41, 204, 106, 0.15); */
          padding: 4px 8px;
          border-radius: 4px;
        }

        .statusOutstanding {
          color: #f4a503;
          /* background: #fff1d6; */
          padding: 4px 8px;
          border-radius: 4px;
        }

        .statusUnknown {
          color: #000;
          /* background: #fff; */
          padding: 4px 8px;
          border-radius: 4px;
        }
        .statustext {
          color: #1f9254;
          font-family: 'Open Sans';
          font-size: 12px;
          font-style: normal;
          font-weight: 600;
          line-height: normal;
        }
        .downloadcontainer {
          display: flex;
          padding: 2px 12px;
          align-items: center;

          width: 28px;
          height: 28px;
          flex-direction: column;

          border-radius: 14px;
          border: 1px solid #e2e0db;
          background: #fff;
        }
        .statuscontainer {
          display: flex;
          padding: 5px 30px 5px 30px;
          justify-content: center;
          align-items: center;
          gap: 5px;
          flex: 1 0 0;
          border-radius: 22px;
          background: rgba(41, 204, 106, 0.15);
        }
        .awaiting {
          display: flex;
          min-width: 85px;
          padding: 6px 10px;
          justify-content: center;
          align-items: center;
          gap: 5px;
          border-radius: 22px;
          background: rgba(233, 82, 82, 0.15);
          color: #e95252;
          font-family: 'Open Sans';
          font-size: 12px;
          font-weight: 600;
        }
        ul > li > a {
          text-decoration: none !important;
          color: #0099ff;
        }
      }
      &: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);
      }
      .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;
    }
  }
`;

// Styled components
export const StyledTableWrapper = styled.div`
  max-height: 60vh;
  overflow-x: auto;
  // min-height: 50vh;

  .fortables {
    max-height: 60vh;
    overflow-x: auto;
    min-height: 50vh;
  }
  /* height: 600px; */
  /* 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 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);
  }
`;
