.react-google-flight-datepicker {
  font-size: 1rem;

  & > * {
    box-sizing: border-box;
  }

  .date-picker-input-container {
    display: flex;
    align-items: center;
    flex: 1 1 0;
  }

  .btn-outline {
    background-color: transparent;
    background-repeat: no-repeat;
    border: none;
    cursor: pointer;
    overflow: hidden;
  }

  .date-picker {
    position: relative;
    border-radius: 4px;
    background: white;
    padding: 8px 8px 8px 0;

    &.disabled {
      opacity: 0.6;
      cursor: default;
    }
  }

  .date-picker-input {
    width: 390px;
    display: flex;
    justify-content: space-between;
    border: 1px solid #dadce0;
    border-radius: 4px;
    color: #3c4043;
    height: 56px;
    letter-spacing: 0.2px;
    font-size: 1rem;
    align-items: center;
    overflow: visible;


    svg {
      min-width: 24px;
      min-height: 24px;
    }
  }

  .date-picker-date-group {
    position: relative;
    display: flex;
    justify-content: space-between;
    height: 100%;
    flex-grow: 1;
  }

  .date {
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
    border-radius: 2px 0 0 2px;
    padding: 0 13px;
    flex-grow: 1;
    width: 50%;
    background: white;
    border-radius: 4px;

    &.is-single::before {
      display: none;
    }
  }

  .date:first-child::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(0, -50%);
    width: 1px;
    height: 70%;
    background: #dadce0;
  }

  .selected-date {
    border: none;
    outline: none;
    height: 100%;
    box-sizing: border-box;
    background: none;
    width: 0;
    display: flex;
    flex: 1 1 0px;
    align-items: center;
    font-size: 0.9rem;
    line-height: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .date-placeholder {
    color: rgba(0, 0, 0, 0.56);
  }

  .change-date-group {
    width: 48px;
    display: flex;
  }

  .change-date-group .change-date-button {
    height: 40px;
    color: #5f6368;
    cursor: pointer;
    padding: 8px 0;
    flex-grow: 1;

    &:disabled {
      cursor: default;

      .icon-arrow {
        fill: #93989e;
      }
    }
  }

  .icon-calendar {
    width: 24px;
    height: 24px;
    fill: #4e6ce4;
    margin-right: 12px;

    &.mobile {
      display: none;
    }
  }

  .icon-arrow {
    width: 24px;
    height: 24px;
    fill: #5f6368;
  }

  @keyframes showPopup {
    0% {
      transform: scale(0.7);
      opacity: 0;
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }

  @keyframes hidePopup {
    0% {
      transform: scale(1);
      opacity: 1;
    }

    100% {
      transform: scale(0.7);
      opacity: 0;
      visibility: hidden;
    }
  }

  .dialog-date-picker {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3),
      0 4px 8px 3px rgba(60, 64, 67, 0.15);
    min-width: 200px;
    height: max-content;
    width: 770px;
    margin-bottom: 50px;
    transform-origin: top left;
    opacity: 0;
    transform: scale(0);

    &.open {
      animation: showPopup 0.2s forwards;
    }

    &.hide {
      animation: hidePopup 0.2s forwards;
    }
  }

  .dialog-header {
    padding: 8px 8px 8px 24px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
  }

  .dialog-header .date-picker-input {
    height: 56px;
    width: 390px;
  }

  .date.is-focus {
    background-color: #f4f8ff;

    &::after {
      content: '';
      margin: -1px;
      border: 2px solid #4e6ce4;
      border-radius: 4px;
      position: absolute;
      pointer-events: none;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 5;
    }
  }

  .date.is-error {
    background-color: #fde8e8;

    &::after {
      content: '';
      margin: -1px;
      border: 2px solid #f05252;
      border-radius: 4px;
      position: absolute;
      pointer-events: none;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 5;
    }
  }

  .back-button {
    display: none;
  }

  .dialog-content {
    border-bottom: 1px solid #dadce0;
    border-top: 1px solid #dadce0;
    position: relative;
  }

  .reset-button {
    font-size: 0.9rem;
    padding: 0 8px;
    height: 36px;
    border-radius: 4px;
    border: none;
    color: #5f6368;
    min-width: 64px;
    margin-left: auto;

    &:hover {
      background-color: #fafafa;
    }

    &.mobile {
      display: none;
    }
  }

  .calendar-wrapper {
    margin: 12px 38px 8px;
    overflow: hidden;
    min-height: 353px;
  }

  .calendar-content {
    display: flex;
    padding: 0 2px;
    position: relative;
    overflow: hidden;

    &.isAnimating {
      transition: transform 0.2s ease;
      overflow: initial;
    }
  }

  .month-calendar {
    width: 308px;
    color: #3c4043;
    margin-right: 70px;

    &.hidden {
      position: absolute;
      visibility: hidden;
      z-index: -1;
      opacity: 0;
    }

    &.isAnimating {
      position: absolute;
      left: -378px;
    }
  }

  .month-name {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .weekdays {
    width: 100%;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.54);
    display: flex;

    .weekday {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 36px;
      margin: 0;
      flex-grow: 1;
    }
  }

  .week {
    display: flex;
    justify-content: flex-start;

    &.first {
      justify-content: flex-end;
    }
  }

  .day {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    height: 44px;
    margin: 2px 0;
    text-align: center;
    width: 44px;
    vertical-align: top;
    position: relative;
    border-radius: 50%;

    .background-day {
      bottom: 0;
      opacity: 0;
      pointer-events: none;
      position: absolute;
      top: 0;
      width: 10px;
      z-index: 1;

      &.first-day {
        background: linear-gradient(to right, #fff, #eef0f2);
        left: -10px;
      }

      &.last-day {
        background: linear-gradient(to left, #fff, #eef0f2);
        right: -10px;
      }
    }

    &::after {
      border-radius: 100%;
      bottom: 0;
      content: '';
      height: 44px;
      left: 0;
      margin: auto;
      position: absolute;
      right: 0;
      top: 0;
      width: 44px;
      z-index: 2;
    }

    &:hover::after {
      background-color: #fff;
      border: 2px solid #4766e3;
      bottom: -2px;
      left: -2px;
      right: -2px;
      top: -2px;
    }

    &.selected {
      color: white;

      &:hover {
        color: #000;
      }

      &::after {
        background-color: #4766e3;
        border-radius: 100%;
      }

      &:hover::after {
        background-color: #fff;
      }
    }

    &.highlight::before {
      content: '';
      width: 44px;
      height: 44px;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      background-color: #f7ed7ad1;
      border-radius: 50%;
    }

    &.hovered {
      background-color: #eef0f2;
      border-radius: unset;

      .background-day {
        opacity: 1;
      }

      &.end {
        background: linear-gradient(90deg, #eef0f2 50%, #fff 50%);
      }

      &:hover {
        background-color: #eef0f2;

        &::after {
          border-radius: 100%;
          background-color: #fff;
        }
      }
    }

    &.selected.hovered {
      background: linear-gradient(90deg, #fff 50%, #eef0f2 50%);
      color: #fff;

      &.end {
        background: linear-gradient(90deg, #eef0f2 50%, #fff 50%);
      }

      &:hover {
        color: #000;
      }

      &::after {
        border-radius: 100%;
        background-color: #4766e3;
      }

      &:hover::after {
        background-color: #fff;
      }
    }

    &.disabled {
      pointer-events: none;
      color: rgba(0, 0, 0, 0.26);

      &.selected {
        color: #fff;
      }
    }

    .text-day {
      position: relative;
      z-index: 3;
    }
  }

  .calendar-flippers {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
  }

  .flipper-button {
    background-color: #fff;
    border-radius: 100%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.12), 0 4px 4px rgba(0, 0, 0, 0.24);
    cursor: pointer;
    height: 40px;
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 -20px;
    pointer-events: all;

    svg {
      width: 24px;
      height: 24px;
    }

    &.disabled {
      cursor: default;

      svg {
        fill: #93989e
      }
    }
  }

  .dialog-footer {
    align-items: center;
    display: flex;
    flex-direction: row-reverse;
    padding: 8px;

    .submit-button {
      border-radius: 8px;
      padding: 10px 8px;
      border: none;
      line-height: 16px;
      text-transform: uppercase;
      color: #fff;
      background: #4766e3;
      height: 36px;
      min-width: 88px;
      font-weight: 500;
      font-size: 0.9rem;
      cursor: pointer;
    }
  }

  /** RESPONSIVE MOBILE */
  @media screen and (max-width: 500px) {
    .date-picker-demo {
      width: 100%;
    }

    .date-picker-input {
      height: 40px;
      border: none;
      border-radius: 0;
      position: relative;
    }

    .date {
      border: 1px solid #dadce0;
      border-radius: 5px;
      padding: 0 10px;
      flex-grow: 1;

      &:nth-child(2) {
        margin-left: 10px;
      }

      &.is-focus {
        height: 40px;
      }
    }

    .date:first-child::before {
      display: none;
    }

    .icon-calendar {
      display: none;

      &.mobile {
        display: block;
      }
    }

    .reset-button {
      display: none;

      &.mobile {
        display: block;
        color: rgba(0, 0, 0, 0.87);
        min-width: 88px;
        font-weight: 500;
      }
    }

    .change-date-group,
    .divider,
    .calendar-flippers,
    .weekdays {
      display: none;
    }

    .back-button {
      display: block;
      width: 56px;
      height: 100%;
      margin-right: 16px;
      padding: 0;

      svg {
        width: 20px;
        height: 20px;
        fill: rgba(0, 0, 0, 0.7);
      }
    }

    .dialog-date-picker {
      border-radius: 0;
      width: 100%;
      height: 100%;
      max-height: 100%;
      position: fixed;
      left: 0;
      right: 0;
      bottom: 10px;
      top: 100%;
      display: flex;
      flex-direction: column;
      opacity: 1;
      transform: none;
      z-index: 999999999;

      &.open {
        transition: all 0.2s ease-out;
        transform: translate(0, -100%);
        animation: none;
      }

      &.hide {
        transition: all 0.2s ease-in;
        transform: translate(0, 0);
        animation: none;
      }
    }

    .dialog-header {
      padding: 8px;
      box-shadow: 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 2px rgba(0, 0, 0, 0.24);
      z-index: 50;

      .date-picker-input {
        height: 40px;
        width: 100%;
      }
    }

    .dialog-content {
      border: none;
      overflow: hidden;
      height: 100%;
    }

    .calendar-wrapper {
      margin: 0;
      height: 100%;
      display: flex;
    }

    .calendar-content {
      padding: 0;
      width: 100%;
      height: 100%;
      flex-direction: column;
      flex-grow: 1;

    }

    .weekdays.mobile {
      display: flex;
      background-color: #f3f3f3;
    }

    .month-calendar {
      width: 100%;
      display: flex;
      flex-direction: column;
    }

    .day {
      width: (100% / 7);
      max-width: (100% / 7);

      &.selected:hover,
      &.hovered:hover {
        color: #fff !important;

        &::after {
          background-color: #4766e3 !important;
        }
      }
    }

    .month-name {
      text-align: left;
      margin-left: 10px;
      margin-bottom: 0px;
      margin-top: 25px;
      font-weight: bold;
    }

    .dialog-footer {
      box-shadow: 0 0 4px rgba(0, 0, 0, 0.12), 0 4px 4px rgba(0, 0, 0, 0.24);
      padding: 15px 8px;
    }
  }
}
