@use '@vizality' as vz;

.vz-updater {
  &-top-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    &-header {
      background: var(--background-secondary);
      padding: 16px;
      border-radius: 8px 8px 0 0;
      display: flex;
    }
    &-form-notice {
      margin: 0 0 20px;
    }
    &-title {
      font-size: 18px;
      font-weight: 600;
    }
    &-subtitle {
      color: var(--header-secondary);
      font-size: 14px;
      margin-top: 4px;
    }
    &-footer {
      background: var(--background-secondary-alt);
      padding: 16px;
      border-radius: 0 0 8px 8px;
      display: flex;
      justify-content: flex-end;
      button + button {
        margin-left: 10px;
      }
    }
    &-icon {
      @include vz.size(50px);
      margin-right: 15px;
    }
    .animated path + path {
      transform-origin: 50% 50%;
      animation: rotate360 1.2s infinite;
    }
    &-status {
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    &-about {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      flex: 1;
      font-size: 14px;
      margin-right: 10px;
      &-column {
        display: flex;
        flex-direction: column;
        & + & {
          margin-left: 20px;
        }
      }
      &-title {
        color: var(--header-secondary);
        & + & {
          margin-top: 4px;
        }
      }
      &-value {
        font-weight: 600;
        & + & {
          margin-top: 4px;
        }
      }
    }
  }
  &-options {
    margin-top: 20px;
  }
  &-updates {
    margin: 20px 0;
  }
  &-update {
    background: var(--deprecated-card-bg);
    padding: 16px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    // &::before {
    //   @include vz.size(300%);
    //   content: '';
    //   display: block;
    //   position: absolute;
    //   top: -100%;
    //   left: -100%;
    //   transform: rotate(-4deg);
    //   z-index: 0;
    //   opacity: .5;
    // }
    // &[vz-type='plugin'] {
    //   &::before {
    //     @include vz.mask(vz.icon('plugin'), var(--deprecated-card-bg), 70px, repeat center);
    //   }
    // }
    // &[vz-type='theme'] {
    //   &::before {
    //     @include vz.mask(vz.icon('theme'), var(--deprecated-card-bg), 70px, repeat center);
    //   }
    // }
    & + & {
      margin-top: 16px;
    }
    &-inner {
      display: flex;
      align-items: flex-start;
      position: relative;
      z-index: 1;
    }
    &-icon {
      &-img {
        @include vz.size(100%);
        border-radius: 4px;
        &-wrapper {
          @include vz.size(100%);
        }
      }
      &-wrapper {
        @include vz.size(80px);
        margin-right: 12px;
        border-radius: 4px;
        flex: 0 0 auto;
        position: relative;
      }
      &-badge {
        background: var(--background-secondary-alt);
        border-radius: 50%;
        z-index: 1;
        padding: 6px;
        color: var(--header-primary);
        &-wrapper {
          position: absolute;
          bottom: -5px;
          right: -5px;
        }
      }
    }
    &-metadata {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      margin-right: 30px;
      flex: 1;
    }
    &-name {
      @include vz.ellipsis(100%);
      font-size: 18px;
      margin-right: 7px;
      font-weight: 500;
      color: var(--header-primary);
      width: fit-content;
      margin-top: 4px;
      &:hover {
        text-decoration: underline;
      }
    }
    &-author {
      @include vz.ellipsis(100%);
      width: fit-content;
      font-size: 14px;
      margin-top: 2px;
      color: var(--interactive-normal);
      line-height: 1.5;
      &[vz-user-id] {
        cursor: pointer;
        &:hover {
          color: var(--header-primary);
        }
      }
    }
    &-description {
      @include vz.ellipsis(100%);
      font-size: 14px;
      color: var(--text-normal);
      line-height: 1.5;
    }
    &-summary {
      margin-top: 10px;
      font-size: 14px;
      color: var(--text-normal);
      &-inner {
        display: flex;
        align-items: center;
        line-height: 1.5;
      }
      &-commit {
        margin-right: 4px;
        code {
          background: var(--background-tertiary);
          padding: 2px 5px;
          font-size: 12px;
          border-radius: 3px;
        }
      }
      &-message {
        @include vz.ellipsis;
        flex: 0 1 auto;
      }
      &-author {
        opacity: .7;
        margin-left: 7px;
        flex: 1 0 auto;
      }
    }
    &-actions {
      display: flex;
      flex-direction: column;
      button {
        + button {
          margin-left: 8px;
        }
      }
    }
  }
  &-debug-info {
    display: flex;
    color: var(--interactive-normal);
    user-select: text;
    cursor: text;
    &.copied b {
      color: #3ca374;
    }
    code {
      white-space: pre-wrap;
      font-family: inherit;
      font-size: 12px;
      width: 100%;
    }
    b {
      align-items: center;
      color: vz.color('blurple');
      text-transform: uppercase;
      display: flex;
      &::after {
        content: "";
        margin-left: 4px;
        border: thin dashed;
        opacity: .6;
        flex: 1;
      }
      transition: color 0.2s ease;
    }
    .row {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      margin: 8px 0 8px 20px;
    }
    .column {
      flex-basis: 25%;
      &:nth-child(n+5) {
        margin-top: 8px;
      }
    }
    .full-column {
      flex-basis: 100%;
      &:nth-child(n+2) {
        margin-top: 8px;
      }
    }
    &:hover {
      button {
        opacity: 1;
      }
      :last-child:not(button) > :last-child {
        flex-basis: 85%;
      }
    }
    button {
      opacity: 0;
      align-self: flex-end;
      transition: opacity .2s ease;
      position: absolute;
      right: 20px;
    }
  }
}
