@import '../../../scss/styles.scss';

.account {
  width: 100%;

  &__form {
    height: 100%;
  }

  &__main {
    width: calc(100% - #{base(15)});
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }

  &__header {
    h1 {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  &__collection-actions {
    list-style: none;
    margin: 0;
    padding: base(1.5) 0 base(.5);
    display: flex;

    li {
      margin-right: base(.75);
    }
  }

  &__edit {
    padding: base(1) 0 base(2);
    flex-grow: 1;
  }

  &__sidebar-wrap {
    position: fixed;
    width: base(15);
    height: 100%;
    top: 0;
    right: 0;
    overflow: visible;
    border-left: 1px solid var(--theme-elevation-100);
  }

  &__sidebar {
    width: 100%;
    height: 100%;
    overflow-y: auto;
  }

  &__sidebar-sticky-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }

  &__collection-actions,
  &__document-actions,
  &__meta,
  &__sidebar-fields {
    padding-left: base(1.5);
  }

  &__document-actions {
    @include blur-bg;
    position: sticky;
    top: 0;
    z-index: 2;
    padding-right: $baseline;

    >* {
      position: relative;
      z-index: 1;
    }
  }

  &__document-actions--with-preview {
    display: flex;

    >* {
      width: calc(50% - #{base(.5)});
    }

    >*:first-child {
      margin-right: base(.5);
    }

    >*:last-child {
      margin-left: base(.5);
    }

    .form-submit {
      .btn {
        width: 100%;
        padding-left: base(2);
        padding-right: base(2);
      }
    }
  }

  &__api-url {
    margin-bottom: base(1.5);
    padding-right: base(1.5);

    a {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  &__meta {
    margin: auto 0 $baseline;
    padding-top: $baseline;
    list-style: none;

    li {
      margin-bottom: base(.5);
    }
  }

  &__label {
    color: var(--theme-elevation-400);
  }

  &__collection-actions,
  &__api-url {

    a,
    button {
      cursor: pointer;
      font-weight: 600;
      text-decoration: none;

      &:hover {
        text-decoration: underline;
      }
    }
  }

  &__payload-settings {
    margin-top: base(4);
    padding-top: base(3);
    border-top: 1px solid var(--theme-elevation-100);
  }

  @include mid-break {
    &__main {
      width: 100%;
      min-height: initial;
    }

    &__sidebar-wrap {
      position: static;
      width: 100%;
      height: initial;
    }

    &__form {
      display: block;
    }

    &__edit {
      padding: 0;
    }

    &__document-actions {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      top: auto;
    }

    &__meta {
      padding: base(2) 0 base(1.5);
      margin: 0;
    }

    &__collection-actions,
    &__document-actions,
    &__meta,
    &__sidebar-fields {
      padding-left: var(--gutter-h);
    }

    &__api-url {
      margin-bottom: base(.5);
    }

    &__collection-actions {
      border-top: 1px solid var(--theme-elevation-100);
      padding: base(1) 0 0 base(1);
      order: 1;

      li {
        margin: 0 base(.5) 0 0;
      }
    }

    &__sidebar {
      padding-bottom: base(4);
      height: auto;
    }

    &__payload-settings {
      margin-top: base(2);
      padding-top: base(2);
      padding-bottom: base(.5);
      border-top: 1px solid var(--theme-elevation-100);
      border-bottom: 1px solid var(--theme-elevation-100);
    }
  }
}
