@use "../../../../styles/colors" as colors;
@use "../../../../styles/variables" as vars;
@use "../../../../styles/fonts" as fonts;

// Matches Angular's date-tabs row. Single flat row, 48px tall, 7 tabs per
// page flanked by 50px carousel arrows. Active tab has white bg + dark
// text; siblings have light-blue bg + brand link-blue label.

.day-tabs-wrap {
  // Angular keeps day-tabs flush against the flight list; the sticky
  // card and the results frame touch.
  margin-bottom: 0;
}

.day-tabs {
  display: flex;
  align-items: stretch;
  height: 48px;
  // Angular rounds the outer arrow buttons by `$border-radius` (3px)
  // so the whole strip ends with 3px top corners rather than React's
  // previous 8px card-style rounding.
  border-radius: vars.$border-radius vars.$border-radius 0 0;
  overflow: hidden;
  background: colors.$white;

  &__arrow {
    width: 50px;
    flex-shrink: 0;
    background: colors.$white;
    border: none;
    cursor: pointer;
    color: colors.$light-gray;
    font-size: fonts.$font-size-xl1;
    line-height: 1;
    padding: 0;

    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
  }

  &__list {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-width: 0;
  }

  @media (max-width: 640px) {
    display: none;
  }
}

.day-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 15px;
  background: colors.$blue-extra-light;
  color: colors.$blue;
  font-size: fonts.$font-size-s;
  font-weight: fonts.$font-medium;
  border: 0;
  border-right: 1px solid colors.$border;
  border-bottom: 1px solid colors.$border;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;

  &__label {
    display: inline-block;
  }

  &:last-child {
    border-right: none;
  }

  &--active {
    background: colors.$white;
    color: colors.$text-color;
    border-bottom-color: colors.$white;
    cursor: default;
  }

  &--disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
}

.day-select-wrap {
  display: none;

  @media (max-width: 640px) {
    display: block;
    background: colors.$white;
    padding: vars.$space-m2 16px;
    border-radius: vars.$border-radius;
  }

  &__caption {
    display: block;
    font-size: fonts.$font-size-s;
    color: colors.$light-gray;
    margin-bottom: 4px;
  }
}

.day-select {
  display: none;

  @media (max-width: 640px) {
    display: block;
    width: 100%;
    padding: vars.$space-m2;
    border-radius: vars.$border-radius;
    background: colors.$white;
    border: 1px solid colors.$border;
    font-size: fonts.$font-size-m;
  }
}
