@use 'sass:color';
@use 'variables' as *;

.card {
  & > a {
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    border-radius: 4px;

    &:hover,
    &:active,
    &:focus {
      .card__bar {
        background: var(--color-bg-brand-softest);
      }
    }
  }

  &__img {
    height: 130px;
    position: relative;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-primary);
    border-bottom: none;

    img {
      display: block;
      width: 100%;
      height: 100%;
      margin: 0;
      object-fit: cover;
    }

    @media screen and (width <= 600px) {
      height: 200px;
    }
  }

  &__bar {
    position: relative;
    padding: 15px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border-primary);
    border-top: none;

    .avatar {
      flex: 0 0 auto;
      width: 48px;
      height: 48px;
      padding-top: 2px;

      img {
        width: 100%;
        height: 100%;
        display: block;
        margin: 0;
        border-radius: 4px;
        background: var(--color-bg-secondary);
        object-fit: cover;
      }
    }

    .display-name {
      margin-inline-start: 15px;
      text-align: start;

      svg[data-hidden] {
        display: none;
      }

      strong {
        font-size: 15px;
        color: var(--color-text-primary);
        font-weight: 500;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      span {
        display: block;
        font-size: 14px;
        color: var(--color-text-secondary);
        font-weight: 400;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
}

.pagination {
  padding: 30px 0;
  text-align: center;
  overflow: hidden;

  a,
  .current,
  .newer,
  .older,
  .page,
  .gap {
    font-size: 14px;
    color: var(--color-text-primary);
    font-weight: 500;
    display: inline-block;
    padding: 6px 10px;
    text-decoration: none;
  }

  .current {
    color: var(--color-bg-primary);
    background: var(--color-text-primary);
    border-radius: 100px;
    cursor: default;
    margin: 0 10px;
  }

  .gap {
    cursor: default;
  }

  .older,
  .newer {
    text-transform: uppercase;
    color: var(--color-text-primary);
  }

  .older {
    float: left;
    padding-inline-start: 0;
  }

  .newer {
    float: right;
    padding-inline-end: 0;
  }

  .disabled {
    cursor: default;
    color: var(--color-text-disabled);
  }

  @media screen and (width <= 700px) {
    padding: 30px 20px;

    .page {
      display: none;
    }

    .newer,
    .older {
      display: inline-block;
    }
  }
}

.nothing-here {
  color: var(--color-text-secondary);
  background: var(--color-bg-primary);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: default;
  border-radius: 4px;
  padding: 20px;
  min-height: 30vh;
  border: 1px solid var(--color-border-primary);

  @media screen and (min-width: ($no-gap-breakpoint - 1)) {
    border-top: 0;
  }

  &--no-toolbar {
    border-top: 1px solid var(--color-border-primary);
  }

  &--under-tabs {
    border-radius: 0 0 4px 4px;
  }

  &--flexible {
    box-sizing: border-box;
    min-height: 100%;
  }
}

.information-badge,
.simple_form .overridden,
.simple_form .recommended,
.simple_form .not_recommended {
  display: inline-block;
  padding: 4px 6px;
  cursor: default;
  border-radius: 4px;
  font-size: 12px;
  line-height: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.information-badge,
.simple_form .overridden,
.simple_form .recommended,
.simple_form .not_recommended {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border-primary);
}

.information-badge {
  &.superapp {
    color: var(--color-text-success);
    background-color: var(--color-bg-success-softest);
    border-color: var(--color-border-success-soft);
  }
}

.simple_form .not_recommended {
  color: var(--color-text-error);
  background-color: var(--color-bg-error-softest);
  border-color: var(--color-border-error-soft);
}

.directory__tag .trends__item__current {
  width: auto;
}

.pending-account {
  &__header {
    color: var(--color-text-secondary);

    a {
      color: var(--color-text-primary);
      text-decoration: none;

      &:hover,
      &:active,
      &:focus {
        text-decoration: underline;
      }
    }

    strong {
      color: var(--color-text-primary);
      font-weight: 700;
    }

    .warning-hint {
      font-weight: normal !important;
    }
  }

  &__body {
    margin-top: 10px;
  }
}

.batch-table__row--muted {
  color: var(--color-text-tertiary);
}

.batch-table__row--muted .pending-account__header,
.batch-table__row--muted .accounts-table,
.batch-table__row--muted .name-tag {
  &,
  a,
  strong {
    color: var(--color-text-tertiary);
  }
}

.batch-table__row--muted .name-tag .avatar {
  opacity: 0.5;
}

.batch-table__row--muted .accounts-table {
  tbody td.accounts-table__extra,
  &__count,
  &__count small {
    color: var(--color-text-tertiary);
  }
}

.batch-table__row--attention {
  color: var(--color-text-warning);
}

.batch-table__row--attention .pending-account__header,
.batch-table__row--attention .accounts-table,
.batch-table__row--attention .name-tag {
  &,
  a,
  strong {
    color: var(--color-text-warning);
  }
}

.batch-table__row--attention .accounts-table {
  tbody td.accounts-table__extra,
  &__count,
  &__count small {
    color: var(--color-text-warning);
  }
}
