import { breakpoints } from '../../utils/styledBreakpoints';
import styled from 'styled-components';

export const Container = styled.div`
  background-color: #fff;
`;

export const Table = styled.table`
  display: table;
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 650px;
  border: none;
`;

const StickyStyles = (top: number) => `
  position: sticky;
  top: ${top}px;
  z-index: 1;
  background: #fff;
`;

export const Thead = styled.thead<{ $sticky?: boolean, $stickyTopP?: number}>`
  display: table-header-group;
  ${props => props.$sticky && StickyStyles(props.$stickyTopP || 0)};
`;

export const TableRow = styled.tr`
  color: inherit;
  display: table-row;
  vertical-align: middle;
  outline: 0;
`;

export const Th = styled.th`
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.5rem;
  letter-spacing: 0.01071em;
  display: table-cell;
  vertical-align: inherit;
  border-bottom: 1px solid rgba(224, 224, 224, 1);
  text-align: left;
  padding: 16px;
  ${breakpoints({
    cssProp: 'padding',
    cssPropUnits: 'px',
    values: [{ 1440: 8 }],
    mediaQueryType: 'max-width',
  })};
  color: rgba(0, 0, 0, 0.87);
  color: #666666;
  font-size: 0.875rem;
  font-weight: 700;
`;

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

export const TextColumn = styled.span``;

export const IconFilterDialog = styled.div`
  height: 20px;
  width: 20px;
`;

export const FilterDialog = styled.div`
  position: absolute;
  padding: 10px 0;
  margin: 6px 0px 0 0;
  width: max-content;
  background: #fff;
  box-shadow: 0px 3px 6px #00000029;
  border: 1px solid #e0e0e0;
  z-index: 99;
`;

export const ListFilterDialog = styled.div`
  display: flex;
  flex-direction: column;
  .label {
    margin: 0 0 8px 0;
    color: #666666;
    font-size: 14px;
    font-weight: 400;
    text-align: left;
  }
  .select {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
  }
`;

export const OptionFilterDialog = styled.div`
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 6px 15px;
  cursor: pointer;
  &:hover {
    background: rgba(0, 0, 0, 0.04);
  }
  .icon {
    color: #666;
  }
  .rotate {
    rotate: 180deg;
  }
  div {
    width: 20px;
    height: 20px;
  }
  p {
    margin: 0;
    color: #666666;
    font-size: 16px;
    font-weight: 400;
  }
`;
