/* Message List */
// a.k.a. notifications in the menu

// main list
.message-list {
  width: 31.5em;
  padding: 0;
  border: solid $borders_color;

  // padding and margins to account for scrollbar
  &:ltr { margin-left: 0; margin-right: $base_margin; padding-right: $base_padding; border-right-width: 1px; }
  &:rtl { margin-right: 0; margin-left: $base_margin; padding-left: $base_padding; border-left-width: 1px; }

  .message-list-placeholder {
    spacing: $base_spacing * 2;

    // icon size and color
    > StIcon {
      icon-size: $base_icon_size * 3; // 48px
      margin-bottom: $base_margin * 3;
      -st-icon-style: symbolic;
    }
  }
}

.message-list-sections {
  spacing: $base_padding;
  margin: 0;
  padding: 0 2px $base_padding;

  // to account for scrollbar
  &:ltr { margin-right: $base_margin; }
  &:rtl { margin-left: $base_margin; }
}

.message-list-section,
.message-list-section-list {
  spacing: $base_spacing;
}

// do-not-disturb + clear button
.message-list-controls {
  margin: ($base_margin * 2) ($base_margin * 4) 0;
  // NOTE: remove the padding if notification_bubble could remove margin for drop shadow
  padding: $base_margin;
  spacing: $base_spacing * 2;
}

// message bubbles
.message {
  @include notification_bubble;

  .popup-menu & { box-shadow: none; }

  // icon container
  .message-icon-bin {
    padding: $base_padding * 3;

    &:ltr { padding-right: $base_padding; }
    &:rtl { padding-left: $base_padding; }

    // icon size and color
    > StIcon {
      icon-size: $base_icon_size * 2; // 32px
      -st-icon-style: symbolic;
    }

    // fallback
    > .fallback-app-icon {
      width: $base_icon_size;
      height: $base_icon_size;
    }
  }

  // content
  .message-content {
    spacing: 4px;
    padding: $base_padding * 1.5;
    margin-bottom: $base_margin * 2;
  }

  // title
  .message-title {
    font-weight: bold;
    padding-top: 0.57em;
    color: $alt_fg_color;
  }

  // secondary container in title box
  .message-secondary-bin {
    padding: 0 $base_margin * 2;

    // notification time stamp
    > .event-time {
      color: transparentize($fg_color, 0.5);
      @include fontsize($base_font_size - 2);
      /* HACK: the label should be baseline-aligned with a 1em label, fake this with some bottom padding */
      padding-bottom: 0.13em;

      &:ltr { text-align: right; }
      &:rtl { text-align: left; }
    }
  }

  // close button
  .message-close-button {
    color: $alt_fg_color;
    border-radius: $circular_radius;
    width: 24px;
    height: 24px;
    padding: 0;

    &:hover {
      color: $fg_color;
      background-color: rgba($fg_color, 0.1);
    }

    &:active {
      color: $fg_color;
      background-color: rgba($fg_color, 0.15);
    }
  }

  // body
  .message-body {
    color: $alt_fg_color;
  }
}

// URLs in messages
.url-highlighter {
  link-color: $link_color;
}

/* Media Controls */
.message-media-control {
  padding: 0 $base_padding * 3;
  margin: $base_padding * 3 + 4px 0;
  border-radius: $circular_radius;
  color: $alt_fg_color;
  border: none;

  // uses $hover_bg_color since the media controls are in a notification_bubble
  &:hover {
    background-color: rgba($fg_color, 0.1);
    color: $fg_color;
  }

  &:active {
    background-color: rgba($fg_color, 0.2);
    color: $fg_color;
  }

  &:insensitive { color: mix($alt_fg_color, $bg_color, 35%);; }

  // fix border-radius for last button
  &:last-child:ltr { margin-right: $base_margin * 3; }
  &:last-child:rtl { margin-left: $base_margin * 3; }
}

// album-art
.media-message-cover-icon {
  icon-size: $base_icon_size * 3 !important; // 48px
  border-radius: $base_border_radius;

  // when there is no artwork
  &.fallback {
    color: $alt_fg_color;
    background-color: rgba($fg_color, 0.1);
    border: 1px solid transparent;
    border-radius: $base_border_radius;
    icon-size: $base_icon_size * 2 !important;
    padding: $base_padding * 2;
  }
}
