/**
  These override the styles for the JQuery UI calendar component.
  Dependencies:
    JQuery 3.2.1
    JQuery-UI 1.12.1

  Note:
    Be sure to import the JQuery-UI styles before the common styles
    Example:
      @import "./jquery-ui-dist/1.12.1/jquery-ui";
      @import "common";
 */
.ui-datepicker {
  background: white;
  width: 30rem;
  padding: 2rem;
  border: none !important;
  box-shadow: $mm-boxshadow;
  z-index: 1050 !important;

  font-family: $font-stack-sans-serif;
  font-size: 1.6rem;
  font-weight: normal;

  .ui-datepicker-header {
    height: 2rem;
    background: none;
    border: none;
    margin-bottom: 2rem;

    .ui-datepicker-prev {
      line-height: 1.8em;
      background: none;
      border: none;
      &:hover {
        top: 2px;
        left: 2px;
      }
      .ui-icon {
        font-size: 3rem;
        text-indent: 0;
        width: 3rem;
        height: 3rem;
        top: -0.5rem;
        left: 0;
        margin: 0;
      }
      .ui-icon::before {
        background-image: none;
        display: inline-block;
        font-weight: normal;
        font-variant: normal;
        font-style: normal;
        font-family: FontAwesome, sans-serif;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        content: '\f104';
        color: $mm-core-digital-blue-70;
      }
    }

    .ui-datepicker-next {
      line-height: 1.8em;
      background: none;
      border: none;
      &:hover {
        top: 2px;
        right: 2px;
      }
      .ui-icon {
        font-size: 3rem;
        text-indent: 0;
        width: 3rem;
        height: 3rem;
        top: -0.5rem;
        right: 0;
        margin: 0;
      }
      .ui-icon::before {
        background-image: none;
        display: inline-block;
        font-weight: normal;
        font-variant: normal;
        font-style: normal;
        font-family: FontAwesome, sans-serif;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        content: '\f105';
        color: $mm-core-digital-blue-70;
      }
    }

    .ui-datepicker-title {
      .ui-datepicker-month {
        font-family: $font-stack-sans-serif;
        font-size: 2.4rem;
        font-weight: normal;
        color: $mm-neutral-gray-80;
      }
      .ui-datepicker-year {
        font-family: $font-stack-sans-serif;
        font-size: 2.4rem;
        font-weight: normal;
        color: $mm-neutral-gray-80;
      }
    }
  }

  table.ui-datepicker-calendar {
    font-family: $font-stack-sans-serif;
    font-size: 1.6rem;
    font-weight: normal;

    thead {
      color: black;
      font-weight: normal;
    }

    tbody {
      tr {
        td {
          a {
            background: none;
            border: none;
            color: $mm-neutral-gray-80;
            text-align: center;
          }
          .ui-state-hover {
            background: $mm-neutral-gray-30;
          }
        }
      }
    }

    // Unused for now.
    // .ui-datepicker-week-end{ }

    .ui-datepicker-other-month {
      color: $mm-neutral-gray-40;
    }
    .ui-datepicker-unselectable {
      color: $mm-neutral-gray-40;
    }
    .ui-datepicker-current-day {
      background: $mm-core-digital-blue-70;
      a {
        color: white;
      }
    }
    .ui-datepicker-today {
      background: $mm-neutral-gray-40;
    }
  }

  .ui-datepicker-buttonpane {
    padding-top: 0.5rem;
    .ui-datepicker-current {
      background: none;
      color: $mm-core-digital-blue-70;
      border: none;
      opacity: 1;
      font-weight: normal;
    }
    .ui-datepicker-close {
      background: none;
      color: $mm-core-digital-blue-70;
      border: none;
      font-weight: normal;
    }
  }
}

/**
  These are the styles for the filter inputs

  Example:
  <div class="mmui-custom-select mmui-calendar-input-group">
    <div class="mmui-dropdown-toggle"></div>
    <i class="fa fa-calendar"></i>
    <input id="end_date"
      class="custom-select mmui-calendar-input"
      name=""
      placeholder=""
      autocomplete="off"
      type="text"/>
  </div>
 */
.mmui-calendar-input-group {
  background: $mm-neutral-white;
  
  i {
    position: absolute;
    left: 0;
    margin: 8px 0 0 20px;
    pointer-events: none;
    font-size: 2.2rem;
  }

  .mmui-calendar-input {
    color: $mm-neutral-gray-80;

    height: 4rem;

    padding-left: 5rem;
    padding-right: 5rem;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    background-image: none;
    background-color: $mm-neutral-white;

    border: 0.1rem solid;
    border-radius: 0;
    border-color: $mm-neutral-gray-80;

    text-overflow: ellipsis;
    overflow: hidden;

    &:focus {
      border-color: $mm-core-digital-blue-70;
      box-shadow: none;
    }

    &:disabled {
      border-color: $mm-neutral-gray-10;
      background: $mm-neutral-gray-10;
      color: $mm-seq-gray-50;
    }
  }
}


fieldset[readonly] {

  .mmui-calendar-input-group .mmui-calendar-input {
    border-color: $mm-neutral-gray-10 !important;
    background: $mm-neutral-gray-10 !important;
    color: $mm-sem-neutral-50 !important;
    pointer-events: none;
  }

  .mmui-calendar-input-group {
    color: $mm-neutral-gray-30;

    .mmui-dropdown-toggle {
      opacity: $mm-opacity-02;
    }
  }

}

fieldset:disabled {
  pointer-events: none;

  .mmui-drop-select-title,
  .mmui-calendar-input,
  .mmui-calendar-input-group {
    color: $mm-neutral-gray-30;
  }

  .mmui-dropdown-toggle {
    opacity: $mm-opacity-02;
  }
}
