// xblock: elements - system feedback
// ====================

// NOTES:
// * General system feedback UI archetypes - messages, transitions, etc.

.wrapper--xblock {

  // --------------------
  // messages
  // --------------------
  .message {
    margin-bottom: $baseline-v;
    border-radius: ($baseline-v/10);
    padding: $baseline-v ($baseline-h/2);
    background: $color-decorative-quaternary;

    .message__title {
      @extend %t-heading;
      margin-bottom: ($baseline-v/4);
      border-bottom: ($baseline-v/10) solid $color-decorative-tertiary;
      padding-bottom: ($baseline-v/4);
    }

    .message__content {
      @extend %copy-3;
      color: $copy-secondary-color;

      p {
        margin-bottom: ($baseline-v/2);

        &:last-child {
          @extend %wipe-last-child;
        }
      }

      a {
        @extend %link-copy;
      }
    }
  }

  // TYPE: error
  .message--error {
    background: tint($color-error, 95%);

    .message__title {
      color: $color-error;
      border-bottom-color: $color-error;
    }
  }

  // TYPE: warning
  .message--warning {
    background: tint($color-warning, 95%);

    .message__title {
      color: $color-warning;
      border-bottom-color: $color-warning;
    }
  }

  // TYPE: confirmation
  .message--confirmation {
    background: tint($color-confirm, 95%);

    .message__title {
      color: $color-confirm;
      border-bottom-color: $color-confirm;
    }
  }

  // TYPE: complete
  .message--complete {
    background: tint($color-complete, 95%);

    .message__title {
      color: $color-complete;
      border-bottom-color: $color-complete;
    }
  }

  // TYPE: incomplete
  .message--incomplete {
    background: tint($color-incomplete, 95%);

    .message__title {
      color: $color-incomplete;
      border-bottom-color: $color-incomplete;
    }
  }

  // CASE: showing errors is shown
  .message--error {
    @extend %trans-opacity;
    display: none;
    opacity: 0.0;
  }

  .has--error {

    .message--error {
      display: block;
      opacity: 1.0;
    }
  }

  // TYPE: inline message
  .message--inline {
    padding: ($baseline-v/2) ($baseline-h/2);
    background: tint($color-confirm, 15%);

    .message__title {
      margin-bottom: 0;
      border: none;
      padding-bottom: 0;
      color: $white-t;
    }

    &.message--error {
      background: tint($color-error, 15%);

      .message__content {
        color: tint($color-error, 90%);
      }
    }

    &.message--warning {
      background: tint($color-warning, 15%);

      .message__content {
        color: tint($color-warning, 90%);
      }
    }

    &.message--confirm {
      background: tint($color-warning, 15%);

      .message__content {
        color: tint($color-confirm, 90%);
      }
    }
  }


  // --------------------
  // transitions
  // --------------------
  .is--transitioning {
    @extend %state-disabled;
    padding: ($baseline-v*2) ($baseline-h);
    background: $color-decorative-quaternary;

    .transition__status {
      @include alignVertically();
      text-align: center;

      .wrapper--anim {
        display: block;
        @include animation(pulse $tmg-s3 ease-in-out infinite);
      }

      .ico, .copy {
        display: block;
        color: $copy-secondary-color;
      }

      .ico {
        @extend %icon-0;
        margin-bottom: ($baseline-v/2);
      }

      .copy {
        @extend %hd-2;
        @extend %t-strong;
        @extend %t-titlecase;
      }
    }
  }
}
