import styled from "styled-components";

export const DateInputContainer = styled.div`
  position: relative;
  display: flex;
  align-items: center;
  width: ${({ size }) => {
    switch (size) {
      case "sm":
        return "120px";
      case "md":
        return "140px";
      case "lg":
        return "270px";
      default:
        return "120px";
    }
  }};
`;

export const DateInput = styled.input`
  font-size: ${({ size }) => {
    switch (size) {
      case "sm":
        return "11px";
      case "md":
        return "16px";
      case "lg":
        return "18px";
      default:
        return "11px";
    }
  }};
  color: rgba(202, 201, 201, 0.335);
  padding: 10px;
  border: 3px solid
    ${({ active }) =>
      active ? "rgba(59, 59, 59, 0.282)" : "rgba(202, 201, 201, 0.335)"};
  border-radius: 8px;
  background-color: transparent;
  outline: none;
  width: 100%;
  &:focus {
    border: 2px solid rgba(59, 59, 59, 0.282);
  }
`;

export const CalendarIcon = styled.span`
  position: absolute;
  right: 10px;
  top: 55%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #000;
  cursor: pointer;
`;

export const CalendarContainer = styled.div`
  position: absolute;
  top: 110%;
  left: 0;
  z-index: 1;
  background-color: rgb(255, 255, 255);
  border: 1px solid grey;
  border-radius: 10px;
  padding: 20px;

  .buttons {
    display: flex;
    gap: 2px;
    button {
      background: rgba(204, 204, 204, 0.342);
      border: 1px solid rgba(204, 204, 204, 0.342);
      outline: none;
      border-radius: 4px;
      width: 20px;
      height: 20px;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
`;

export const CalendarHeader = styled.div`
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 18px;

`;

export const CalendarBody = styled.div`
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 30px;
  padding-top: 10px;
`;

export const CalendarDayCell = styled.div`
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: ${({ selected }) => (selected ? '13px' : "12px")};
  font-weight: ${({ selected }) => (selected ? '700' : "500")};
  gap: 3px;
  border-radius: 5px;
  padding: 7px 10px;
  cursor: pointer;
  color: ${({ selected }) => (selected ? '#fff' : "black")};
  background-color: ${({ selected, color }) =>
    selected ? "#00C2C2": "white"};

    &.weekdays {
        font-weight: 700;
        font-size: 13px;

    }

  &:hover {
    color: #0094BA;
    background-color: rgba(0, 148, 186, 0.04);
  }

  
`;
