@import '../../_variables.scss';

.Notifications {
  &:not(.minimal) {
    // a bit of a hack to allow scrolling below notifications
    padding-block-end: 15em;
  }

  .loadmore-error {
    color: $fallback--text;
    color: var(--text, $fallback--text);
  }

  .notification {
    position: relative;

    .notification-overlay {
      position: absolute;
      inset-block-start: 0;
      inset-inline-end: 0;
      inset-inline-start: 0;
      inset-block-end: 0;
      pointer-events: none;
    }

    &.unseen {
      .notification-overlay {
        background-image: linear-gradient(135deg, var(--badgeNotification, $fallback--cRed) 4px, transparent 10px)
      }
    }
  }
}

.notification {
  box-sizing: border-box;

  &:hover .animated.Avatar {
    canvas {
      display: none;
    }
    img {
      visibility: visible;
    }
  }

  &:last-child .Notification {
    border-block-end: none;
  }

  .non-mention {
    display: flex;
    flex: 1;
    flex-wrap: nowrap;
    padding: 0.6em;
    min-inline-size: 0;

    .avatar-container {
      inline-size: 32px;
      block-size: 32px;
    }

    --link: var(--faintLink);
    --text: var(--faint);
  }

  .follow-request-accept {
    &:hover {
      color: $fallback--text;
      color: var(--text, $fallback--text);
    }
  }

  .follow-request-reject {
    &:hover {
      color: $fallback--cRed;
      color: var(--cRed, $fallback--cRed);
    }
  }

  .follow-text, .move-text {
    padding-block: 0.5em;
    padding-inline: 0;
    overflow-wrap: break-word;
    display: flex;
    justify-content: space-between;

    .follow-name {
      display: block;
      max-inline-size: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  /* TODO cleanup this */
  .Status {
    flex: 1;
  }

  time {
    white-space: nowrap;
  }

  .notification-right {
    flex: 1;
    padding-inline-start: 0.8em;
    min-inline-size: 0;

    .timeago {
      min-inline-size: 3em;
      text-align: end;
    }
  }

  .emoji-reaction-emoji {
    font-size: 1.3em;
  }

  .notification-details {
    min-inline-size: 0;
    word-wrap: break-word;
    line-height: var(--post-line-height);
    position: relative;
    overflow: hidden;
    inline-size: 100%;
    flex: 1 1 0;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;

    .name-and-action {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .username {
      font-weight: bolder;
      max-inline-size: 100%;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .timeago {
      margin-inline-end: 0.2em;
    }

    .status-content {
      margin: 0;
      max-block-size: 300px;
    }

    h1 {
      word-break: break-all;
      margin-block: 0 0.3em;
      margin-inline: 0;
      padding: 0;
      font-size: 1em;
      line-height: 1.5;

      small {
        font-weight: lighter;
      }
    }

    p {
      margin: 0;
      margin-block-start: 0;
      margin-block-end: 0.3em;
    }
  }
}
