@import '../../styles/vars';

.wrap {
  position: fixed;
  z-index: 2010;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  visibility: hidden;
}

.overlay {
  display: none;
  background: rgba(0, 0, 0, 0.5);
}

.close-btn {
  @extend %button-base;

  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--black54);

  &:hover,
  &:active {
    color: var(--black87);
  }
}

.menu {
  position: absolute;
  transition: all 0.15s cubic-bezier(0.25, 1, 0.8, 1);
  transform: translate(-100%, 0);
  width: 100%;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  overflow: auto;
  background: #fff;
}

.close-button {
  @extend %button-base;

  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 21px;
  width: 26px;
  height: 26px;
  color: var(--gray);

  &:hover {
    color: var(--gray-dark);
  }
}

.date {
  color: var(--black54);
}

.section-head {
  text-transform: uppercase;
  color: var(--black54);
}

.control {
  display: flex;
  position: relative;
  margin: 8px 0;
  align-items: center;
}

.control-label {
  display: inline-block;
  flex-grow: 1;
  font-family: var(--font-family--regular);
  font-size: 13px;
  vertical-align: top;
  line-height: 24px;

  &.with-icon {
    margin-left: 12px;
  }
}

.control-group {
  margin-bottom: 10px;
}

.toggle-icon-passed {
  color: var(--green500);
}

.toggle-icon-failed {
  color: var(--red500);
}

.toggle-icon-pending {
  color: var(--ltblue500);
}

.toggle-icon-skipped {
  color: var(--grey500);
}

.wrap.open {
  visibility: visible;

  & .overlay {
    opacity: 1;
  }

  & .menu {
    transform: translate(0, 0);
  }
}

.section {
  padding: 0 16px;
  border-bottom: 1px solid var(--grey300);
}

.list {
  @extend %list-unstyled;
}

.main {
  margin: 8px 0;
}

.no-tests > .item:not(.has-tests) {
  /* stylelint-disable-next-line selector-max-compound-selectors */
  & > div > .sub {
    padding-left: 0;
  }

  &:not(:only-child) {
    padding-left: 22px;
  }
}

.sub {
  padding-left: 24px;
  margin: 0 0 2px 0;
}

.link {
  display: flex;
  position: relative;
  align-items: center;
  padding: 3px 0;
  color: var(--gray);

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

  &:active,
  &:focus {
    box-shadow: 0 0 2px 0 var(--ltblue500);
    outline: none;
    text-decoration: none;
  }

  & span {
    transition: var(--link-transition);
    @extend %text-overflow;
  }
}

.link-icon {
  margin-right: 2px;

  &.pass {
    color: var(--green500);
  }

  &.fail {
    color: var(--red500);
  }

  &.pending {
    color: var(--ltblue500);
  }

  &.skipped {
    color: var(--grey500);
  }
}

.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* Tablet 768 and up */
@media (--screen-sm) {
  .menu {
    width: 320px;
    left: auto;
  }

  .overlay {
    display: block;
    position: fixed;
    transition: all 0.2s ease-out;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    cursor: pointer;
    opacity: 0;
  }
}
