@use "@tencentcloud/uikit-base-component-react/dist/styles/theme/util" as *;
.SearchDateRangePicker {
  @include theme() {
    background: get(bg-color-dialog);
    box-shadow: 0 2px 8px get(shadow-color);
  }
  border-radius: 8px;
  padding: 16px;
}

.SearchDateRangePicker__calendars {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.SearchDateRangePicker__calendar {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.SearchDateRangePicker__calendar-header {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.SearchDateRangePicker__current-month-year {
  font-size: 14px;
  @include theme() {
    color: get(text-color-primary);
  }
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 100px;
  text-align: center;
  &:hover {
    @include theme() {
      background-color: get(bg-color-operate);
    }
  }
}

.SearchDateRangePicker__nav-button {
  background: transparent;
  border: none;
  font-size: 14px;
  @include theme() {
    color: get(text-color-disabled);
  }
  cursor: pointer;
  padding: 4px;
  transition: all 0.3s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    @include theme() {
      color: get(text-color-link);
    }
  }
}

.SearchDateRangePicker__picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  @include theme() {
    background: get(bg-color-dialog);
    box-shadow: 0 2px 8px get(shadow-color);
  }
  border-radius: 8px;
  padding: 8px;
  z-index: 10;
  width: 260px;
}

.SearchDateRangePicker__picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.SearchDateRangePicker__picker-nav-button {
  background: transparent;
  border: none;
  font-size: 16px;
  @include theme() {
    color: get(text-color-disabled);
  }
  cursor: pointer;
  padding: 4px;
  &:hover {
    @include theme() {
      color: get(text-color-link);
    }
  }
}

.SearchDateRangePicker__picker-year-text {
  font-size: 14px;
  font-weight: 500;
  @include theme() {
    color: get(text-color-primary);
  }
}

.SearchDateRangePicker__picker-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.SearchDateRangePicker__picker-month-button {
  background: transparent;
  @include theme() {
    border: 1px solid transparent;
    color: get(text-color-primary);
  }
  border-radius: 4px;
  padding: 8px 4px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s;

  &:hover {
    @include theme() {
      background-color: get(bg-color-operate);
      border-color: get(stroke-color-primary);
    }
  }
}

.SearchDateRangePicker__week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 8px;
}

.SearchDateRangePicker__week-day {
  font-size: 14px;
  @include theme() {
    color: get(text-color-disabled);
  }
  padding: 8px 0;
}

.SearchDateRangePicker__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.SearchDateRangePicker__day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  @include theme() {
    color: get(text-color-primary);
  }
  cursor: pointer;
  border-radius: 50%;
  position: relative;
  transition: all 0.1s ease-in-out;

  &:hover {
    @include theme() {
      background-color: get(bg-color-operate);
    }
  }

  &.SearchDateRangePicker__day--today {
    font-weight: bold;
    @include theme() {
      border: 1px solid get(text-color-link);
    }
  }

  &.SearchDateRangePicker__day--other-month {
    @include theme() {
      color: get(text-color-disabled);
    }
    cursor: default;
    &:hover {
        background-color: transparent;
    }
  }

  &.SearchDateRangePicker__day--selected {
    border-radius: 0;
    @include theme() {
      background-color: get(list-color-focused);
      color: get(text-color-primary);
    }
  }

  &.SearchDateRangePicker__day--start,
  &.SearchDateRangePicker__day--end {
    border-radius: 50%;
    z-index: 1;
    @include theme() {
      background-color: get(text-color-link);
      color: get(text-color-button);
    }
  }

  &.SearchDateRangePicker__day--selected:not(.SearchDateRangePicker__day--start):not(.SearchDateRangePicker__day--end) {
    border-radius: 0;
    @include theme() {
      background-color: get(list-color-focused);
      color: get(text-color-primary);
    }
  }

  &.SearchDateRangePicker__day--start:not(.SearchDateRangePicker__day--end)::after {
      content: '';
      position: absolute;
      right: 0;
      top: 0;
      bottom: 0;
      width: 50%;
      @include theme() {
        background-color: get(list-color-focused);
        color: get(text-color-primary);
      }
      z-index: 0;
  }

  &.SearchDateRangePicker__day--end:not(.SearchDateRangePicker__day--start)::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 50%;
      @include theme() {
        background-color: get(list-color-focused);
        color: get(text-color-primary);
      }
      z-index: 0;
  }
}

.SearchDateRangePicker__h5-mask {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  @include theme() {
    background: get(bg-color-mask);
  }
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.SearchDateRangePicker__h5-panel {
  width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
  @include theme() {
    background: get(bg-color-dialog);
    box-shadow: 0 -2px 8px get(shadow-color);
  }
  border-radius: 16px 16px 0 0;
  animation: slideUp .2s;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.SearchDateRangePicker__h5-header {
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  padding: 16px 0 8px 0;
  @include theme() {
    border-bottom: 1px solid get(stroke-color-secondary);
  }
}

.SearchDateRangePicker__h5-footer {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  @include theme() {
    border-top: 1px solid get(stroke-color-secondary);
    background: get(bg-color-dialog);
  }
}

.SearchDateRangePicker__h5-cancel {
  flex: 1;
  margin-right: 8px;
  padding: 12px 0;
  @include theme() {
    background: get(button-color-secondary-default);
    color: get(text-color-secondary);
  }
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

.SearchDateRangePicker__h5-confirm {
  flex: 1;
  margin-left: 8px;
  padding: 12px 0;
  @include theme() {
    background: get(button-color-primary-default);
    color: get(text-color-button);
  }
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.SearchDateRangePicker__h5-quick-options {
  display: flex;
  gap: 8px;
  margin: 12px 0 8px 0;
  justify-content: center;
}

.SearchDateRangePicker__h5-quick-option {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  font-size: 16px;
  border-radius: 16px;
  @include theme() {
    border: 1px solid get(stroke-color-primary);
    background: get(button-color-secondary-default);
    color: get(text-color-primary);
  }
  cursor: pointer;
  transition: all 0.2s;
  &.SearchDateRangePicker__h5-quick-option--active {
    @include theme() {
      background: get(button-color-primary-default);
      color: get(text-color-button);
      border-color: get(button-color-primary-default);
    }
  }
}
