$link-color: #1B7991;
$border-grey: #ddd;
$darker-grey: darken(#ddd, 10%);
$background-grey: lighten(whitesmoke, 2%);
$notification-info: darken(#00C2ED, 15%);

.nexdoc-mail-container {
  padding-top: 1.6em;
  &.reply {
    padding-top: 50px;
    margin-top: 1.6em;
    background-color: $background-grey;
  }
}

.nexdoc-mail {
  position: relative;
  background-color: $background-grey;
  padding: 20px;

  &.reply {
    border-top: 1px solid $darker-grey;
    .btn-archive, .btn-unarchive {
      top: 163px;
    }
  }

  span {
    max-width: none!important;
  }

  p {
    max-width: none!important;
    margin: 0!important;
  }

  .reply-area {
    height: 150px;
    border: 1px solid $border-grey;
    font-size: 90%;
    display: none;
    overflow: scroll;

    &.reply{
      display: block;
      background-color: white;
      padding: 10px;
      width: 97%;
      resize: none;
    }
  }
  .file-drop-zone {
    margin-top: 10px;
    background-color: white;
  }

  .mail-from, .mail-subject-container{
    padding: 1em;
    font-weight: normal;
    font-size: 90%;
  }

  .text-normal {
    font-weight: normal;
    div {
      display: inline-block;
    }
    .mail-attachment {
      margin-left: 5px;
    }
  }
  .mail-date {
    display: block;
    padding-top: 1em;
  }
  .mail-body-container {
   padding: 1em;
   padding-bottom: 0;
   font-size: 90%;
   margin-bottom: 1em;
   white-space: pre-line;
   .mail-body {
     p, span {
      margin-bottom: 1em;
     }
   }
  }

  .mail-icon {
    display: block;
    padding: 10px 15px;
    background-color: $background-grey;
    cursor: pointer;
    border: 0;
    &::before {
      display: inline-block;
      width: 20px;
      height: 20px;
      margin: 0 .4em -8px 0;
      background-repeat: no-repeat;
      background-size: auto 18px;
      pointer-events: none;
      content:'';
    }
    &:hover {
      color: #333;
      opacity: 0.7;
    }
  }

  .btn-archive, .btn-reply-action, .btn-unarchive{
    @extend .mail-icon;
    right: 0;
    position: absolute;
    top: 10px;
    display: inline-block;
    opacity: 0.8;
  }

  .btn-archive {
    right: 10px;
    top: -43px;
    background-color: white;
    &::before {
      background-image:url('../archive.svg');
    }
  }
  .btn-unarchive {
    right: 10px;
    top: -43px;
    background-color: white;
    &::before {
      background-image:url('../unarchive.svg');
    }
  }

  .btn-reply-action {
    &.reply{
      right: 10px;
      top: 28px;
      background-color: $background-grey;
      &::before {
        background-image:url('./reply.svg');
      }
    }
    &.send{
      right: 210px;
      top: -28px;
      &::before {
        background-image:url('./send.svg');
      }
    }
    &.discard{
      right: 10px;
      top: -28px;
    }
    &.attach {
      right: 90px;
      top: -28px;
      &::before {
        background-image:url('./attach.svg');
      }
    }
  }

  .btn-reply {
    @extend .mail-icon;
    padding-left: 0;
    opacity: 0.8;

    display: inline;

    &::before {
      background-image:url('./reply.svg');
    }
  }

  .btn-attach {
    @extend .mail-icon;

    display: inline;
    opacity: 0.8;

    &::before {
      background-image:url('./attach.svg');
    }
  }
  .action-history {
    @extend .mail-icon;
    display: block;
    opacity: 0.8;
    padding-left: 0;
    border-bottom: 1px solid $link-color;

    &::before {
      background-image:url('./caret-down.svg');
      margin: 0 .4em -6px 0!important;
    }
  }
}

.attach-files {
  ul {
    li{
      display: relative;
      &::after {
        content: '';
        background-image: url('close.svg');
        display: inline-block;
        width: 24px;
        height: 24px;
        margin: 0 .4em -8px 0;
        background-repeat: no-repeat;
        background-size: auto 20px;
        cursor: pointer;
        margin-left: 5px;
      }
    }
  }
}

.mail-attachment {
  cursor: pointer;
  border: 0;
  background-color: inherit;
  padding: 5px;
  margin-left: 1em;
  &::before {
    content: '';
    background-image: url('file.svg');
    display: inline-block;
    width: 24px;
    height: 18px;
    margin: 0 -5px -5px 0;
    background-repeat: no-repeat;
    background-size: auto 18px;
    cursor: pointer;
  }
  &:hover {
    background-color: white;
  }
}

.back-button {
	margin-top: 1em;
}

div[class^="reply-mail-"] {
  .mail-from {
    border-top: 1px solid #ddd;
    padding-bottom: 0;
    padding-top: 20px;
  }
  .mail-subject-container{
    border-bottom: none;
  }
}
.reply-mail-0 {
  .mail-from {
    border-top: none!important;
    font-weight: bold!important;
    border-bottom: 0!important;
  }
  .mail-subject-container{
    font-weight: bold!important;
  }
  .mail-date {
    font-weight: bold!important;
  }
}
