@import 'banners/successful';
@import 'banners/conflicts';
@import 'banners/update-available';
@import 'banners/open_thank_you_card';
@import 'banners/os-not-supported';

.banner {
  $banner-height: 30px;
  height: $banner-height;
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  align-content: center;
  align-items: center;
  justify-content: space-between;
  padding-left: var(--spacing);

  // Prevents the notification banner from decreasing its height
  // when a large diff is rendered.
  flex: none;

  .contents {
    display: flex;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: left;
    align-items: center;
  }
  .close {
    display: flex;
    flex-shrink: 0;
    flex-grow: 0;

    margin-right: var(--spacing);
    margin-left: var(--spacing);

    &:focus {
      outline: 0;
    }

    button {
      width: 16px;
      height: 16px;
      border: 0;
      padding: 0;
      color: var(--text-secondary-color);
      background: transparent;

      &:hover {
        color: var(--text-color);
      }
    }
  }

  // animations for entering and leaving
  &.banner-enter {
    height: 0px;
    opacity: 0;

    &.banner-enter-active {
      height: $banner-height;
      opacity: 1;
      transition: height 300ms ease-in-out, opacity 200ms ease-in 300ms;
    }
  }

  &.banner-exit {
    height: $banner-height;
    opacity: 1;

    &.banner-exit-active {
      height: 0px;
      opacity: 0;
      transition: height 225ms ease-in-out 175ms, opacity 175ms ease-in;
    }
  }

  // When zooming, give the banner more space to display.
  @media (max-width: 960px) {
    height: auto;
    padding-top: var(--spacing-half);
    padding-bottom: var(--spacing-half);
  }
}
