// Place all the styles related to the Steps controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// scss-lint:disable SelectorDepth
// scss-lint:disable NestingDepth
// scss-lint:disable SelectorFormat
// scss-lint:disable ImportantRule
// scss-lint:disable Unknown

@import "constants";
@import "mixins";

:root {
  --attachment-column-width: 16em;
  --attachment-row-height: 3em;
}


#new_step,
.panel-step-attachment {
  ul {
    list-style: none;

    li {
      > div > span.pull-left {
        margin-top: 10px;
      }
    }
  }

  .checklist-name-container,
  .table-name-container {
    align-items: center;
    display: flex;

    .remove-container {
      padding-top: 10px;
    }
  }
}

#steps {
  // hack only for firefox
  @-moz-document url-prefix() {
    ul > li {
      padding-top: 1px;

      a > p:first-child {
        margin-top: -17px;
      }
    }
  }

  .step {
    .panel {
      margin-left: 0;

      .panel-body {
        padding: 15px 5px;
      }
    }
  }

  .step-panel-collapse-link {
    padding-left: 5px;

    &:not(.collapsed) .fas {
      @include rotate(90deg);
    }
  }

  .step-heading {
    align-items: center;
    border: 0;
    display: flex;
    min-height: 46px;
    padding: 0 17px;

    .panel-options {
      bottom: 0;
      flex-grow: 1;
      flex-shrink: 0;
      line-height: 46px;
      text-align: right;
    }

    span.step-number {
      flex-shrink: 0;
      font-size: 16px;
      font-weight: bold;
      margin: 0 5px 0 10px;
      min-width: fit-content;
    }

    .left-floats {
      align-items: center;
      display: flex;
      max-width: 100%;
      min-height: inherit;
      overflow: hidden;
      padding-left: .1em;
      padding-right: 15px;

      .toggle-step-complete {
        @include font-h1;
        padding: 5px;

        .fas {
          color: $brand-success;
        }

        .far {
          color: $color-alto;
        }
      }

      .step-name-link {
        display: flex;
        flex-shrink: 1;
        overflow: hidden;

        .name-block {
          display: flex;
          flex-shrink: 1;
          height: 100%;
          overflow: hidden;

          @media (max-width: 1188px) {
            min-width: 100px;
          }

          strong {
            font-size: 16px;
            white-space: nowrap;
          }
        }

        .delimiter {
          padding: 0 5px;
        }

        .author-block {
          display: inline-block;
          flex-shrink: 0;
          font-size: 16px;
          overflow: hidden;
          white-space: nowrap;
        }
      }
    }
  }
}

.attachments {
  display: grid;
  grid-auto-rows: var(--attachment-row-height);
  grid-column-gap: 1em;
  grid-row-gap: 1em;
  grid-template-columns: repeat(auto-fill, minmax(var(--attachment-column-width), 1fr));
  margin: 1em 0;

  .nested_fields {
    display: contents;
  }

  &[data-preview="true"] {
    .asset-context-menu {
      display: none;
    }
  }
}



.attachments-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;

  .title {
    flex-grow: 1;
    flex-shrink: 0;
  }

  .dropdown-attachment-options {
    @include font-button;
    min-width: 200px;

    .divider-label {
      @include font-small;
      color: $color-silver-chalice;
      padding-left: 1em;
    }

    a {
      border-radius: unset;
      cursor: pointer;
      padding: .5em 1em;

      &:hover {
        background: $color-concrete;
      }
    }

    .change-order {
      padding-left: 2.75em;

      &.selected::after {
        @include font-awesome;
        content: $font-fas-check;
        margin-left: auto;
        position: absolute;
        right: 1em;
      }
    }

    .attachments-view-mode {
      .fas {
        width: 1.5em;
      }

      &.selected::after {
        @include font-awesome;
        content: $font-fas-check;
        margin-left: auto;
        position: absolute;
        right: 1em;
      }
    }
  }
}

.step .textarea-sm {
  border-radius: 0;
}

.comments-title {
  color: $color-emperor;
}

.expand-all-steps {
  margin: 0 0 15px 15px;
}
