.notification {
  width: auto;
  height: auto;
  padding: 7px;
  margin-bottom: 25px;
  background: $white;

  &.checked {
    background-color: $primary-light !important;
  }

  article {
    background: transparent;
    box-shadow: none;
    margin: 0;
    padding: 0;
    height: auto;

    label.wrapping-checkbox {
      i18n {
        position: absolute;
        bottom: -2px;
        right: 7px;
      }
      &:hover {
        img {
          border-color: $white;
          box-shadow: 4px 4px 5px $shadow-light;
        }
      }
    }
    .avatar {
      position: relative;
      align-self: center;
      width: auto;
      height: auto;
      //width 72 for mailtools check-col
      margin: 0;
      padding: 5px;

      img,
      i.system-avatar {
        width: 60px;
        height: 60px;
        background-color: $white;
        max-width: none;
        display: block;
        border-radius: 50%;
        border: 1px solid $light-grey;
        object-fit: cover;
        @include run-transition(all);
      }
    }
    .states {
      width: 80px;
      text-align: center;
      display: flex;
      justify-content: center;
      i {
        padding: 0 4px;
      }
    }

    .flex-all-remains {
      i {
        @include run-transition(all);
        &:before {
          font-size: 12px;
          vertical-align: top;
        }
      }
    }

    .notification-date {
      position: absolute;
      top: 8px;
      right: 15px;
      text-align: right;
      em {
        font-style: normal;
        color: $grey;
      }
    }
  }
}

////CONVERSATION SPECIFIC

.mailbox .notification {
  -webkit-transition: -webkit-filter 250ms ease;
  -moz-transition: -moz-filter 250ms ease;
  -ms-transition: -ms-filter 250ms ease;
  transition: filter 250ms ease;

  .undo:before {
    @include run-transition(color);
    color: #555;
  }
  .mail:before {
    @include run-transition(color);
    color: $primary-dark;
  }

  &.new-element {
    background-color: $primary-lighter;
    span {
      font-weight: bold;
    }
  }

  &.checked {
    .mail:before,
    .undo:before {
      color: $white;
      text-shadow: 1px 1px 1px $primary-dark;
    }
    .flex-all-remains {
      i {
        color: $white !important;
      }
    }
  }
  &:hover {
    filter: invert(0.05);
  }

  .flex-all-remains {
    i {
      margin-right: 0.5em;
      &.draft {
        color: #999;
      }
      &.mail-in {
        color: $primary-dark;
      }
      &.mail-out {
        color: $primary-darkest;
      }
    }
  }

  .notification-attachment {
    position: absolute;
    right: 15px;
    bottom: 8px;
  }
}

////TIMELINE SPECIFIC

div:not(.simple-notifications) > .notification {
  article {
    width: calc(100% - 30px);

    > .row {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      &:after {
        width: auto;
      }
    }
    .avatar {
      margin: 15px 20px 15px 10px;
      padding: 0;
    }
    img,
    i.system-avatar {
      height: 75px;
      width: 75px;
    }
    .notification-date {
      right: 35px;
    }
  }
  .content {
    float: none;
    width: 100%;
    padding: 0;
    margin: 20px 0;
    display: flex;
    align-items: center;
    a[href*="annuaire"] {
      font-size: 18px;
      font-weight: bold;
    }
  }
  i.sticker.app {
    position: absolute;
    bottom: -5px;
    left: 50px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    box-shadow: 1px 1px 0 0 $shadow-darker;
    &::before {
      color: $white !important;
      text-shadow: 1px 1px 0 $shadow-dark;
    }
  }
  i.type {
    float: left;
  }
  hr.underlined {
    border-top: 1px solid $light-grey;
    margin-left: 20px;
    width: 95%;
    padding: 0;
  }
}

//// ACTIONS OPENER SPECIFIC

.notification div.notification-actions {
  position: absolute;
  overflow: hidden;
  top: 0;
  right: 0;
  height: 100%;
  background-color: white;
  box-shadow: -5px 0 10px rgba(0, 0, 0, 0.05);
  @include run-transition(width, 0.3s);

  .report a[disabled] {
    color: $warning-color;
  }
}
.notification div.notification-actions:not(.opened) {
  width: 0;
}
.notification:hover div.notification-actions {
  display: block;
  width: 30px;
}
.notification div.notification-actions > .opener {
  position: relative;
  height: 100%;
  display: table;
  text-align: center;
  width: 30px;
  float: left;
  border-left: 1px solid $shadow-light;
  border-right: 1px solid $shadow-light;
  color: $accent;
  background-color: $white;
  @include run-transition(all);
}
.notification div.notification-actions > .opener:hover {
  background-color: $accent;
  color: $white;
}
.notification div.notification-actions > .opener > .left-open {
  font-size: 13px;
  display: table-cell;
  vertical-align: middle;
}
.notification div.notification-actions > .actions {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  i {
    margin-right: 10px;
    color: $darkest-grey;
  }
}
.notification div.notification-actions > .actions > .action {
  margin: 5px auto 5px 15%;
  width: 90%;
}
.notification div.notification-actions.opened > .opener > .left-open {
  transform: rotate(180deg);
}
.notification div.notification-actions.opened {
  width: 55%;
}

/////MOBILE

@media screen and (max-width: $tablette) {
  body {
    //SPECIFIC TIMELINE
    div:not(.simple-notifications) > .notification {
      article .notification-date {
        right: 10px;
        top: 8px;
      }
      div.notification-date {
        margin-right: 30px;
      }
    }
    .notification div.notification-actions:not(.opened) {
      width: 30px;
    }
  }
  .notification div.notification-actions {
    box-shadow: none;
  }
}

@media screen and (max-width: $fat-mobile) {
  body {
    .notification article {
      .avatar {
        i.system-avatar,
        img {
          width: 50px;
          height: 50px;
        }
      }
      .states {
        width: 45px;
        font-size: 12px;
      }
      .flex-all-remains {
        line-height: 16px;
        .strong {
          font-size: 13px;
        }
        .small-text {
          font-size: 12px !important;
        }
      }
      .notification-date em {
        font-size: 10px !important;
        line-height: 7px;
      }
    }

    ////TIMELINE SPECIFIC
    div:not(.simple-notifications) > .notification article {
      min-height: 95px;
      .avatar {
        width: 50px;
        height: 50px;
        margin: 10px 10px 20px 5px;

        i.sticker.app {
          top: auto;
          bottom: -10px;
          left: 30px;
          width: 25px !important;
          height: 25px !important;
          line-height: 25px;
          font-size: 10px;
        }
      }
      .content {
        margin: 15px 10px 5px;
      }
    }

    //// ACTIONS OPENER SPECIFIC
    .notification div.notification-actions > .actions > .action {
      margin-left: 15px;
      width: auto;
      font-size: 12px;
    }
  }
}

@media screen and (max-width: $small-mobile) {
  //// ACTIONS OPENER SPECIFIC
  .notification div.notification-actions.opened {
    width: 80%;
  }
}
