@use 'mixins';

.⁂-account-layout {
  @include mixins.card($size: lg);
}

.⁂-account-card {
  display: block;
  width: 100%;
  flex-shrink: 0;

  > div {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
  }

  &--action-top {
    > div {
      align-items: flex-start;
    }
  }
}

.⁂-avatar {
  display: block;
  border-radius: 0.5rem;
  line-height: 0;

  img,
  canvas {
    border-radius: inherit;
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  // Adapted from Iceshrimp which I guess took it from Misskey
  // https://iceshrimp.dev/iceshrimp/iceshrimp/src/branch/dev/packages/client/src/components/global/MkAvatar.vue
  &--cat {
    background: rgb(var(--color-gray-200));

    &:is(.dark *) {
      background: rgb(var(--color-gray-900));
    }

    img {
      position: absolute;
      inset: 0;
      z-index: 1;
    }

    &::before,
    &::after {
      background: #ebbcba;
      border: solid 0.05em currentcolor;
      box-sizing: border-box;
      content: '';
      display: inline-block;
      height: 50%;
      width: 50%;
    }

    &::before {
      border-radius: 0 75% 75%;
      transform: rotate(37.5deg) skew(30deg);
    }

    &::after {
      border-radius: 75% 0 75% 75%;
      transform: rotate(-37.5deg) skew(-30deg);
    }

    &:hover {
      &::before {
        animation: earwiggleleft 1s infinite;
      }

      &::after {
        animation: earwiggleright 1s infinite;
      }
    }
  }
}

@keyframes earwiggleleft {
  0% {
    transform: rotate(37.6deg) skew(30deg);
  }

  25% {
    transform: rotate(10deg) skew(30deg);
  }

  50% {
    transform: rotate(20deg) skew(30deg);
  }

  75% {
    transform: rotate(0deg) skew(30deg);
  }

  100% {
    transform: rotate(37.6deg) skew(30deg);
  }
}

@keyframes earwiggleright {
  0% {
    transform: rotate(-37.6deg) skew(-30deg);
  }

  30% {
    transform: rotate(-10deg) skew(-30deg);
  }

  55% {
    transform: rotate(-20deg) skew(-30deg);
  }

  75% {
    transform: rotate(0deg) skew(-30deg);
  }

  100% {
    transform: rotate(-37.6deg) skew(-30deg);
  }
}

.⁂-media-panel {
  .⁂-widget__body {
    width: 100%;
  }

  &__attachments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.125rem;
    overflow: hidden;
    border-radius: 0.375rem;
  }

  &__empty {
    @include mixins.text($size: sm, $theme: muted);
  }
}

.⁂-profile-field {
  span[data-markup] {
    word-break: break-word;
  }

  dt span[data-markup] {
    @include mixins.text($weight: bold);
  }

  &--verified dd {
    color: rgb(var(--color-success-500));
  }

  &__content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}

.⁂-profile-fields-panel {
  .⁂-widget__body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  span[data-markup] {
    @include mixins.text;
    overflow: hidden;
    word-break: break-word;
  }
}
