import { Box, Typography } from "@mui/material";
import styled from "styled-components";
import { PrimaryButton } from "../Buttons/PrimaryButton/PrimaryButton";
import { TextField } from "../TextFields/TextField/TextField";
import { ReactComponent as Search } from "../../assets/images/svg/magnifying-glass.svg";
import selectedTheme from "../../themes";
import { Icon } from "../Icon/Icon";

export const SearchInput = styled(TextField)`
  background-color: #f4f4f4;
  width: 45%;
  flex: 3;
  max-width: 520px;
  margin-right: 30px;
  font-family: "Open Sans";
  @media (max-width: 1700px) {
    margin-left: 15%;
  }
  @media (max-width: 1550px) {
    margin-left: 15%;
  }
  @media (max-width: 1320px) {
    margin-left: 7%;
  }
  @media (max-width: 1100px) {
    width: 36%;
  }
  @media (max-width: 1000px) {
    width: 36%;
    margin-left: 5%;
    margin-right: 10px;
  }
  @media (max-width: 550px) {
    display: none;
    width: 0;
  }
`;
export const DrawerContainer = styled(Box)`
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 25px;
  & div {
    flex-direction: column;
  }
`;

export const LogoContainer = styled(Box)`
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
`;
export const ToolsButtonsContainer = styled(Box)`
  display: flex;
  flex: 4;
  justify-content: space-between;
  min-width: ${(props) => (props.mobile ? "40px" : "600px")};
  max-width: 600px;
  align-items: center;
  flex-wrap: nowrap;
  @media (max-width: 1400px) {
    min-width: 450px;
  }
  @media (max-width: 1200px) {
    min-width: 400px;
  }
  @media (max-width: 900px) {
    flex: 0.35;
    min-width: 0px;
    width: 60px;
    justify-content: right;
  }
`;
export const ToggleDrawerButton = styled(Box)`
  max-width: 40px;
`;
export const AddOfferButton = styled(PrimaryButton)`
  height: 49px;
  width: 180px;
  font-weight: 600;
`;
export const EndIcon = styled(Icon)``;
export const SearchIcon = styled(Search)`
  position: relative;
  top: 11px;
  left: 4px;
  cursor: pointer;
  color: ${selectedTheme.primaryPurple};
  & path {
    width: 18px;
    height: 18px;
  }
  @media (max-width: 600px) {
    height: 14px;
    width: 14px;
    left: 11px;
  }
`;
export const UserButton = styled(Box)`
  display: flex;
  flex-direction: row;
  cursor: pointer;
`;
export const UserName = styled(Typography)`
  color: ${selectedTheme.primaryPurple};
  padding-top: 5px;
  padding-right: 10px;
  font-family: "Open Sans";
  font-weight: 600;
  white-space: nowrap;
`;
export const ToolsContainer = styled(Box)`
  display: flex;
  flex-direction: row;
  justify-content: ${(props) => (props.mobile ? "center" : "space-between")};
  align-items: ${(props) => (props.mobile ? "start" : "center")};
  ${(props) => !props.mobile && `width: 100%;`}
  & div button {
    ${(props) => props.mobile && `width: auto;`}
  }
`;
export const RegisterButton = styled(PrimaryButton)`
  height: 49px;
  width: 180px;
  font-weight: 600;
  @media (max-width: 550px) {
    margin-bottom: 20px;
  }
`;
export const LoginButton = styled(PrimaryButton)`
  height: 49px;
  width: 180px;
  font-weight: 600;
  margin-right: 10px;
`;
export const AuthButtonsContainer = styled(Box)`
  display: flex;
  justify-content: flex-start;
  flex: 1;
  min-width: ${(props) => (props.mobile ? "40px" : "200px")};
  max-width: 600px;
  align-items: flex-start;
  flex-wrap: nowrap;
  margin-left: 40px;
  & div {
    margin-left: 20px;
  }
  @media (max-width: 1300px) {
    margin-left: 0;
  }
  @media (max-width: 1200px) {
    min-width: 400px;
  }
  @media (max-width: 900px) {
    min-width: 0px;
    width: 0px;
    justify-content: right;
  }
`;

export const AuthButtonsDrawerContainer = styled(Box)`
  position: relative;
  left: 10px;
  height: 200px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-around;
`;
export const SearchInputMobile = styled(SearchInput)`
  @media (max-width: 550px) {
    display: block;
    position: relative;
    width: 80%;
    top: 70px;
    height: 46px;
    left: -5px;
    font-family: "Open Sans";
    ${props => !props.shouldShow && `display: none;`}
    & div {
      background-color: white;
      height: 40px;
      overflow: visible;
      & input {
        font-size: 14px !important;
      }
    }
  }
  @media (min-width: 551px) {
    display: none;
    width: 0;
  }
`;
export const HeaderContainer = styled(Box)``;
