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

.online-board-search {
  // Results frame sits directly under the sticky DayTabs card, so
  // Angular rounds only the bottom corners and clears 3px at the top
  // for the tab underline. Mirror the board-search-result rule.
  section.frame {
    border-radius: 0 0 vars.$border-radius vars.$border-radius;
    padding-top: 3px;
  }

  &__status {
    padding: vars.$space-m vars.$space-xl;
  }

  &__calendar {
    display: flex;
    gap: vars.$space-s;
    padding: vars.$space-xl;
    overflow-x: auto;

    @include screen.mobile {
      flex-direction: column;
      padding: vars.$space-xl;
    }
  }

  &__error-card {
    background: colors.$white;
    border-radius: vars.$border-radius;
    padding: vars.$space-xl;
    text-align: center;
  }

  &__error-title {
    margin: 0 0 vars.$space-m;
    font-size: fonts.$font-size-xl;
    color: colors.$red;
  }

  &__error-message {
    margin: 0 0 vars.$space-xl;
    color: colors.$light-gray;
    font-size: fonts.$font-size-m;
  }

  // Matches the standard `.color.blue-light` button used across Angular
  // (see _buttons.scss) — $blue-light fill with $blue-light--hover on
  // hover. Replaces the prior `opacity: 0.9` hover which just darkened
  // the whole button.
  &__retry-btn {
    display: inline-block;
    padding: vars.$space-s2 vars.$space-xl;
    background-color: colors.$blue-light;
    color: colors.$white;
    border: none;
    border-radius: vars.$border-radius;
    cursor: pointer;
    font-size: fonts.$font-size-m;
    font-weight: fonts.$font-medium;
    transition: background-color 0.2s ease;

    &:hover {
      background-color: colors.$blue-light--hover;
    }
  }

  &__actions {
    display: none;
  }

  // §4.1.12 — loader bar with cancel button, shown while search is running
  &__loader-bar {
    display: flex;
    justify-content: center;
    padding: vars.$space-m vars.$space-xl;
  }

  &__cancel-btn {
    display: inline-block;
    padding: vars.$space-s2 vars.$space-xl;
    background-color: colors.$blue-light;
    color: colors.$white;
    border: none;
    border-radius: vars.$border-radius;
    cursor: pointer;
    font-size: fonts.$font-size-m;
    font-weight: fonts.$font-medium;
    transition: background-color 0.2s ease;

    &:hover {
      background-color: colors.$blue-light--hover;
    }
  }

  // §4.1.10 — while search is running, block interactions with filter,
  // tabs, and breadcrumbs so the user cannot start a conflicting search.
  &[data-searching="true"] {
    .page-layout__left,
    .page-layout__sticky,
    .page-layout__breadcrumbs {
      pointer-events: none;
      opacity: 0.6;
    }
  }

  // Mirrors Angular `page-footer-notes` under `pages/schedule/home.scss`:
  // a blue-extra-light card attached to the bottom of the flight-list
  // frame, with a small `*` sort-note aligned to an inner line holding
  // the system-time note copy.
  .page-footer-note {
    padding: vars.$space-xl;
    background-color: colors.$blue-extra-light;
    border-top: 1px solid colors.$border;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 vars.$border-radius vars.$border-radius;
  }

  .page-footer-note--container {
    max-width: 700px;
    @include fonts.font-small();
    line-height: 16px;

    b {
      font-weight: fonts.$font-bold;
    }

    .line:not(:last-child) {
      margin-bottom: vars.$space-m;
    }

    .line1 {
      display: flex;
      align-items: flex-start;

      .sort-note {
        font-size: fonts.$font-size-xs;
        margin-right: 3px;
        margin-top: -1px;
      }
    }
  }
}

.board-day-selector {
  @include screen.mobile {
    display: flex;
    flex-direction: column;
    padding: vars.$space-xl;
  }
}

.calendar-day {
  padding: vars.$space-s2 vars.$space-m;
  border: 1px solid colors.$border;
  border-radius: vars.$border-radius;
  background: colors.$white;
  cursor: pointer;
  white-space: nowrap;

  &:hover {
    border-color: colors.$blue-light;
  }

  &--active {
    background-color: colors.$blue;
    color: colors.$white;
    border-color: colors.$blue;
  }
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px vars.$space-s2;
  border-radius: vars.$border-radius;
  font-size: fonts.$font-size-s;
  font-weight: fonts.$font-medium;

  &--live {
    background-color: colors.$green;
    color: colors.$white;
  }

  &--reconnecting {
    background-color: colors.$orange;
    color: colors.$white;
  }

  &--offline {
    background-color: colors.$light-gray;
    color: colors.$white;
  }
}
