import styled from 'styled-components';
import { ThemeDefault } from '../../types/theme.interface';

const css = styled.div;

export default css<any>`
   user-select: none;
   margin-bottom: 15px;
   position: relative;
   transform: translate3d(0, 0, 0);
   z-index: 100;

   .text-primary {
      color: ${(props) =>
         props.theme?.datePicker?.defaultColor || props.theme?.primary || ThemeDefault.primary} !important;
   }

   .input {
      font-size: 14px;
      opacity: 0.4;
   }

   .calendar-icon {
      font-size: 16px !important;
   }

   .calendar-input {
      padding: 7px 10px;
      display: flex;

      .date {
         font-size: 14px;
         font-weight: 500;
         line-height: 1.2;
      }

      .calendar-icon {
         display: flex;
         align-content: center;
         align-items: center;
         font-size: 16px;
      }

      .time {
         font-size: 0.85rem;
         //font-family: 'Poppins';
         font-weight: 600;
         color: #777;
         line-height: 1.2;
      }
   }

   .datepicker-popup {
      box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.2);
      display: table;
      padding: 10px;
      border-radius: 5px;
      position: absolute;
      z-index: 100;
      background: white;
      height: 0px;

      .month {
         .month-name {
            text-align: center;
            font-weight: 600;
            color: #6e7b8a;
            padding-top: 3px;
            padding-bottom: 10px;
         }

         .left {
            cursor: pointer;
            float: left;
            padding: 5px 8px;
         }

         .right {
            cursor: pointer;
            float: right;
            padding: 5px 8px;
         }
      }

      .weekName {
         width: 31px;
         display: inline-block;
         text-align: center;
         font-weight: 700;
         font-size: 12px;
         border-bottom: 1px solid #eee;
         padding-bottom: 8px;
         margin-bottom: 8px;
         color: #888;
      }

      .week {
         width: 100%;

         .day {
            width: 30px;
            height: 30px;
            line-height: 30px;
            margin: 1px;
            display: inline-block;
            text-align: center;
            font-size: 13px;
            font-weight: 600;
            color: #222;
            //font-family: 'Poppins';
            border-radius: 100%;
            transition: 0.15s all;

            &.today {
               color: ${(props) =>
                  props.theme?.datePicker?.defaultColor || props.theme?.primary || ThemeDefault.primary};
               line-height: 26px;
               border: 2px solid
                  ${(props) => props.theme?.datePicker?.defaultColor || props.theme?.primary || ThemeDefault.primary};
               font-weight: 600;
            }

            &.future {
               color: red !important;
            }

            &.other-month {
               opacity: 0.6;
            }

            &.disable-past {
               opacity: 0.3;
               cursor: not-allowed !important;
            }

            &:hover {
               background: #eee;
               cursor: pointer;
               transition: 0.15s all;
            }

            &.select {
               background: ${(props) =>
                  props.theme?.datePicker?.defaultColor || props.theme?.primary || ThemeDefault.primary};
               color: white;
               opacity: 1;
            }
         }
      }
   }

   .timepicker {
      display: flex;
      flex-direction: row;
      vertical-align: middle;

      .input-border {
         margin: auto;
      }

      .division {
         padding: 5px;
         align-self: center;
         font-weight: 600;
      }

      input {
         padding: 6px 10px;
         width: 0px;
         border: none;
         flex: 1;
         text-align: center;
         //font-family: 'Poppins';
         font-size: 14px;
         font-weight: 500;
      }
   }

   .prefix {
      color: ${(props) => props.theme?.datePicker?.defaultColor ?? props.theme.primary ?? ThemeDefault.primary};
   }

   .plus {
      padding: 0px 5px;
      cursor: pointer;
      color: ${(props) => props.theme?.datePicker?.defaultColor ?? props.theme.primary ?? ThemeDefault.primary};
   }

   .input-time {
      width: 40px;
      display: flex;
   }

   .input-border {
      position: relative;

      .date-input-container {
         justify-content: center;
         display: flex;
         flex-direction: column;
      }

      .container-cursor {
         position: absolute;
         z-index: 1;
         width: 100%;
         height: 100%;
         cursor: pointer;
      }

      .remove-date {
         position: relative;
         z-index: 2;
         height: 40px;
         display: flex;
         justify-content: center;
         width: 20px;
         align-items: center;
         cursor: pointer;

         &:hover {
            svg {
               color: ${(props) => props.theme.danger ?? ThemeDefault.danger};
            }
         }
      }
   }

   .actions {
      padding-top: 10px;
      .btn-cancel,
      .btn-apply {
         padding: 5px;
         font-weight: 600;
         display: inline-block;
         width: 50%;
         text-align: center;
         cursor: pointer;
      }

      .btn-cancel {
         color: #444;
      }

      .btn-apply {
         color: ${(props) => props.theme?.datePicker?.defaultColor || props.theme?.primary || ThemeDefault.primary};
      }
   }
`;
