@import "../../styles/index.scss";

.impact-portal-container {
  position: absolute;
  z-index: 9999;
}

.ia-select-container-v3-blanket {
  bottom: 0;
  left: 0;
  top: 0;
  right: 0;
  position: fixed;
  z-index: 9998;
}

.impact-singleMonthPicker-main-container {
  display: flex;
  font-family: $fontFamily;

  &.single-month-label-flex-column {
    flex-direction: column;

    .singleMonthPicker-label {
      margin-bottom: 6px;
    }
  }

  .singleMonthPicker-label {
    font-family: $fontFamily;
    color: $textButtonFontColor;
    font-size: $smallFontSize;
    line-height: 16px;
    font-weight: $normalFontWeight;
  }

  .singleMonthPicker-container {
    position: relative;
    width: 282px;
  }

  .singleMonthPicker-input-container {
    box-sizing: border-box;
    display: flex;
    width: 100%;
    height: 32px;

    &:hover .singleMonthPicker-input-field {
      border: 1px solid $primaryColor;
    }

    .singleMonthPicker-input-field {
      font-family: $fontFamily;
      font-weight: $normalFontWeight;
      color: $mainFontColor;
      font-size: $normalFontSize;
      width: 100%;
      box-sizing: border-box;
      padding-left: 12px;
      border: 1px solid $deactivateColor;
      border-radius: 8px;
      background: url("../../assets/calendar.svg") no-repeat;
      background-color: $whiteColor;
      background-size: 14px;
      background-position: center right 12px;
      @media screen and (max-width: 1399px) and (min-width: 1200px) {
        padding-left: 10px;
        background-position: center right 10px;
        background-size: 13px;
      }
      &.active {
        width: 100%;
      }
      &.error {
        border: 1px solid $errorColor;
      }
      &::placeholder {
        color: $lightGrayColor;
      }
      &:focus {
        outline: none;
        border: 1px solid $primaryColor;
      }
      &:focus:not(:placeholder-shown) {
        color: $primaryColor;
      }

      &:focus::placeholder {
        color: $primaryColor;
      }
    }

    .mp-close-icon {
      position: absolute;
      right: 36px;
      top: 16px;
      transform: translateY(-50%);
      cursor: pointer;
      @include focus-visible-ring;
    }
  }
  &.disabled {
    pointer-events: none;
    & .singleMonthPicker-label {
      color: $lightGrayColor;
    }
    .singleMonthPicker-input-field {
      border-color: $disabledSecondaryBorder;
      background-color: $disabledSecondaryBg;
      color: $lightGrayColor;
      background-image: url("../../assets/calendarDisable.svg");
      background-repeat: no-repeat;
      background-position: center right 12px;
      background-size: 14px;
    }
    .mp-close-icon {
      & path {
        fill: $lightGrayColor;
      }
    }
  }
}

.mp-single-month-picker-container {
  width: 300px;
  height: 264px;
  border: 1px solid $menuBorderColor;
  border-radius: 12px;
  padding: 16px;
  position: absolute;
  top: 40px;
  left: 0;
  background-color: $whiteColor;
  box-shadow: 0px 0px 4px 0px $boxShadowColor;
  z-index: 1200;
}

.month-picker-year-select-container {
  margin-inline: 6px;
  .ia-select-button-text-full-width {
    flex: 0 0 auto;
  }

  .ia-select-styled-dropdown-main-button {
    padding: 6px;
    border: none;
  }

  .ia-select-button-clear-icon {
    display: none;
  }

  .ia-select-chevron-icon {
    margin-left: -110px;
    margin-right: 0px;
    background: url("../../assets/arrowDownMonthRange.svg") no-repeat;
    background-size: 10px;
    background-position: center;
  }
}

.month-picker-year-select-dropdown {
  z-index: 9999;
  min-width: 115px !important;
  width: 115px !important;
}

.mp-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-inline: 8px;

  & .Mui-focusVisible {
    @include focus-visible-ring;
  }
}

.mp-render-month-container {
  display: flex;
  justify-content: space-between;
}

.mp-render-month {
  display: flex;
  gap: 36px;
  row-gap: 10px;
  flex-wrap: wrap;
  width: 252px;
  height: 128px;
  margin-top: 4px;
}

.mp-month {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  height: 36px;
  width: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  &:hover {
    background-color: $lightBlueColor;
    border: 1px solid $accordionBgBackground;
    border-radius: 8px;
    color: $secondaryColor;
  }
  &.current-month {
    border: 1px solid $lightBlueColor;
    border-radius: 8px;
  }
  @include focus-visible-ring;
  @include focus-visible-disabled;
}

.mp-selected-year {
  font-family: $fontFamily;
  font-size: $normalFontSize;
  font-weight: $normalFontWeight;
  color: $mainFontColor;
  line-height: 16px;
}
.mp-calendar-month {
  font-family: $fontFamily;
  font-size: $smallFontSize;
  font-weight: $normalFontWeight;
  line-height: 15px;
  text-align: left;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
}

.mp-month.start,
.mp-month.end {
  background-color: $primaryColor;
  color: $whiteColor;
  border-radius: 8px;
  position: relative;
}

/* Style for selected months */
.mp-month.selected {
  background-color: $primaryColor;
  color: $whiteColor;
  border-radius: 8px;
}

/* Style for disabled months */
.mp-month.disabled,
.mp-month:disabled {
  color: $lightGrayColor;
  pointer-events: none;
  cursor: default;
}

.mp-vertical-line {
  margin-block: 16px 0px;
  border: 0.5px solid $disabledSecondaryBorder;
}

.mp-calendar-button {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 16px;
}
