@use "../../theme.scss" as *;

html[dir="rtl"] {
  .drp-calendar {
    direction: ltr;
  }
}
.drp-root {
  position: relative;
}

.drp-trigger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;

  span.drp-triggerTitle {
    color: inherit;
    background-color: rgba(225, 225, 225);
    display: block;
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 6px;
    width: 90px;
    text-align: center;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  span.drp-triggerText {
    color: inherit;
    display: block;
    font-size: inherit;
    font-weight: inherit;
    text-align: center;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .drp-icon {
    position: absolute;
    bottom: 31px;
    right: 0;
    svg {
      height: 12px;
      width: 12px;
    }
  }

  .drp-triggerButton {
    all: unset;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0 0.8rem;
    height: 42px;
    font-size: 14px;
    font-weight: 500;
    width: 300px;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.3s;
    background-color: rgba(245, 245, 245);
    color: $text-primary;
    position: relative;

    &:hover {
      background-color: rgba(240, 240, 240);
    }

    &:disabled {
      cursor: not-allowed;
      color: $text-disabled;

      span.drp-triggerTitle {
        color: $text-disabled;
      }
    }
  }
}

.drp-dropdownContent {
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-sizing: border-box;

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

.drp-datePicker {
  display: flex;
  align-items: stretch;
}

.drp-calendar {
  padding: 10px;
}

.drp-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid $border-default;

  button {
    font-size: 14px;
  }
}

ul.drp-defaultDatesList {
  margin: 0;
  min-width: 160px;
  max-width: 240px;
  border-inline-end: 1px solid $border-default;
  padding: 10px;
}

@mixin define-color($title, $color) {
  --#{$title}: #{$color};
}

.rdp {
  @include define-color("rdp-accent-color", rgba($secondary, 0.8));
  @include define-color("rdp-background-color", rgba($secondary, 0.1));
  @include define-color("rdp-selected-color", #fff);
  @include define-color("rdp-outline", 1px solid rgba($secondary, 0.8));
  @include define-color("rdp-caption-font-size", 14px);
}

.rdp-day_range_middle {
  background-color: rgba($color: $secondary, $alpha: 0.1);
}

.rdp-day_range_middle.rdp-day_selected {
  color: $text-primary;

  &:hover {
    color: var(--rdp-selected-color);
  }
}

.rdp-caption_label {
  color: $text-primary;
  font-weight: 600;
}

.rdp-nav_button {
  width: 36px;
  height: 36px;

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