import styled from "styled-components";

const LearnWrapper = styled.div`
  display: flex;
  background-color: ${(p) => p.theme.color.uiBackground02};
  flex-direction: column;
  flex-shrink: 0;
`;

const ItemsWrapper = styled.div`
  display: flex;
  gap: ${(p) => p.theme.spacing.xs};
  width: 100%;
`;

const LearnItem = styled.div`
  display: flex;
  flex-direction: column;
  background-color: ${(p) => p.theme.color.uiBackground02};
  border-radius: ${(p) => p.theme.radii.s};
  border: 1px solid ${(p) => p.theme.color.uiLine};
  padding: ${(p) => p.theme.spacing.s};
`;

const Actions = styled.div`
  display: flex;
  padding-top: ${(p) => p.theme.spacing.s};
`;

const SitesContent = styled.div``;

const Wrapper = styled.div<{ isRow: boolean }>`
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: ${(p) => (p.isRow ? "row" : "column")};

  ${LearnWrapper} {
    width: ${(p) => (p.isRow ? "344px" : "100%")};
    height: ${(p) => (p.isRow ? "100%" : "273px")};
    padding: ${(p) => (p.isRow ? p.theme.spacing.m : `${p.theme.spacing.m} 40px 0 40px`)};
  }

  ${ItemsWrapper} {
    flex-direction: ${(p) => (p.isRow ? "column" : "row")};
  }

  ${LearnItem} {
    width: ${(p) => (p.isRow ? "100%" : "33%")};
  }

  ${Actions} {
    justify-content: ${(p) => (p.isRow ? "space-between" : "flex-end")};
    gap: ${(p) => (p.isRow ? 0 : p.theme.spacing.s)};
    margin-top: ${(p) => (p.isRow ? "auto" : 0)};
  }

  ${SitesContent} {
    padding-top: ${(p) => (p.isRow ? p.theme.spacing.m : 0)};
  }
`;

const LearnTitle = styled.div`
  ${(p) => p.theme.textStyle.headingM};
  margin-bottom: ${(p) => p.theme.spacing.s};
`;

const LearnHeader = styled.div`
  display: flex;
  align-items: center;
  margin-bottom: ${(p) => p.theme.spacing.xs};
`;

const ItemTitle = styled.div`
  ${(p) => p.theme.textStyle.uiM};
  font-weight: 600;
  margin-left: ${(p) => p.theme.spacing.xxs};
`;

const IconWrapper = styled.div`
  width: ${(p) => p.theme.spacing.m};
  height: ${(p) => p.theme.spacing.m};
`;

const Description = styled.div`
  ${(p) => p.theme.textStyle.uiXS};
  margin-bottom: ${(p) => p.theme.spacing.xs};
  flex: 1;
`;

const RolesWrapper = styled.div`
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: ${(p) => `32px 40px ${p.theme.spacing.s} 40px`};

  &::-webkit-scrollbar {
      -webkit-appearance: none;
      width: 4px;
      height: 100%;
    }

  &::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: ${(p) => p.theme.color.iconNonActive};
  }
`;

const SectionTitle = styled.div`
  font-size: 28px;
  line-height: 25px;
  font-weight: 700;
  margin-bottom: ${(p) => p.theme.spacing.s};
`;

const Text = styled.div`
  ${(p) => p.theme.textStyle.uiL};
  font-weight: 400;
  p {
    margin-bottom: ${(p) => p.theme.spacing.s};
  }
  strong {
    font-weight: 600;
  }
`;

export {
	Wrapper,
	Actions,
	LearnWrapper,
	RolesWrapper,
	LearnTitle,
	LearnItem,
	LearnHeader,
	IconWrapper,
	Description,
	ItemTitle,
	ItemsWrapper,
	SectionTitle,
	Text,
};
