import styled from '@emotion/styled';
import { Box } from '@mui/material';

export const CalendarContainer = styled(Box)`
  background: var(--White, rgba(255, 255, 255, 1));
  border: 0.06rem solid var(--Stroke, rgba(0, 0, 0, 0.1));
  border-radius: 1rem;
  box-shadow:
    0rem 2rem 4rem -2rem rgba(0, 0, 0, 0.1),
    0rem 4rem 6rem -1rem rgba(0, 0, 0, 0.1);
  min-width: 20rem;
  padding: 1.875rem 1.5rem 1.5rem 1.5rem;
`;

export const CalendarHeader = styled(Box)`
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  margin-top: 0.7rem;
  margin-bottom: 1rem;
`;

export const CalendarGrid = styled(Box)`
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
`;

export const CalendarWeekday = styled(Box)`
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  font-size: 0.75rem;
  color: #b5bec6;
`;

export const CalendarDay = styled(Box, {
  shouldForwardProp: (prop) =>
    prop !== 'isToday' && prop !== 'isSelected' && prop !== 'isDisabled',
})`
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  width: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--GreyDark, rgba(74, 85, 101, 1));
  transition: all 0.2s ease;

  &:hover {
    background: #dcfce7;
  }

  ${(props) =>
    props.isToday &&
    `
    background: var(--GreyLight, rgba(243, 243, 245, 1));
  `}

  ${(props) =>
    props.isSelected &&
    `
    background: #258141;
    color: white;
    
    &:hover {
      background: #258141;
    }
  `}

  ${(props) =>
    props.isDisabled &&
    `
    color: #d1d5db;
    cursor: not-allowed;
    pointer-events: none;

    &:hover {
      background: transparent;
    }
  `}
`;
