// forums - main app styling
// ====================
// NOTE: this file is deprecated, and we should not continue to add to this file. Use other partials as appropriate.

body.discussion {

  .edit-post-form {
    @include clearfix();
    box-sizing: border-box;
    width: 100%;
    padding-top: 0;

    h1 {
      font-size: $forum-x-large-font-size;
    }

    .form-row {
      margin-top: $baseline;
    }

    .post-cancel {
      @include float(left);
      @include margin($baseline/2, 0, 0, $baseline*0.75);
    }

    .post-update {
      @include float(left);
      margin-top: ($baseline/2);

      &:hover, &:focus {
        border-color: #222;
      }
    }

    .edit-post-title {
      box-sizing: border-box;
      border: 1px solid $forum-color-border;
      border-radius: $forum-border-radius;
      padding: 0 ($baseline/2);
      width: 100%;
      height: 40px;
      box-shadow: 0 1px 3px $shadow-l1 inset;
      color: $dark-gray;
      font-size: $forum-large-font-size;
      font-family: $sans-serif;
    }
  }

  .comments .edit-post-form h1 {
    font-size: $forum-large-font-size;
  }

  .thread-title {
    display: block;
    margin-bottom: $baseline;
    color: $gray-d3;
    font-weight: 700;
    font-size: $forum-x-large-font-size;
  }

  .wmd-panel {
    width: 100%;
  }

  .wmd-button-bar  {
    width: 100%;
    background-color: Silver;
  }

  .wmd-input {
    @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
    border: 1px solid $forum-color-border;
    width: 100%;
    height: 150px;
    background-color: $gray-l4;
    font-style: normal;
    font-size: $forum-base-font-size;
    font-family: $f-sans-serif;
    line-height: 1.6em;

    &::-webkit-input-placeholder {
      color: #888;
    }
  }

  .wmd-button-row {
    @include transition(all .2s ease-out 0s);
    @include margin(($baseline/2), ($baseline/4), ($baseline/4), ($baseline/4));
    position: relative;
    overflow: hidden;
    padding: 0;
    height: 20px;
  }

  .wmd-spacer {
    @include margin-left(14px);
    position: absolute;
    display: inline-block;
    width: 1px;
    height: 20px;
    background-color: Silver;
    list-style: none;
  }

  .wmd-button {
    position: absolute;
    display: inline-block;
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    list-style: none;
    cursor: pointer;
    padding: 0;
  }

  .wmd-button > span {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('#{$static-path}/images/wmd-buttons-transparent.png');
    background-repeat: no-repeat;
  }

  .wmd-spacer1 {
    // Note: the WMD toolbar does not support RTL so this is hard-coded to the left
    left: 50px;
  }

  .wmd-spacer2 {
    // Note: the WMD toolbar does not support RTL so this is hard-coded to the left
    left: 175px;
  }

  .wmd-spacer3 {
    // Note: the WMD toolbar does not support RTL so this is hard-coded to the left
    left: 300px;
  }

  .wmd-prompt-background {
    background-color: Black;
  }

  .wmd-prompt-dialog {
    @extend .modal;
    background: $forum-color-background;
  }

  .wmd-prompt-dialog {
    padding: $baseline;

    > div {
      font-size: $forum-base-font-size;
      font-family: $sans-serif;
    }

    b {
      font-size: $forum-large-font-size;
    }

    > form > input[type="text"] {
      border-radius: $forum-border-radius;
      color: $gray-d3;
    }

    > form > input[type="button"] {
      border: 1px solid #888;
      font-size: $forum-base-font-size;
      font-family: $sans-serif;
    }

    > form > input[type="file"] {
      margin-bottom: 18px;
    }
  }
}

.container .discussion-body {
  @include clearfix();
  display: block;
  border: none;
  background: transparent;
  box-shadow: none;
  line-height: 1.4;

  .bottom-post-status {
    padding: 30px;
    font-size: $forum-x-large-font-size;
    font-weight: 700;
    color: $gray-l3;
    text-align: center;
  }

  .discussion-article {
    position: relative;

    a {
      word-wrap: break-word;
    }

    p + p {
      margin-top: $baseline;
    }
  }

  .responses li header {
    margin-bottom: $baseline;
  }

  blockquote {
    background: $gray-l5;
    border-radius: $forum-border-radius;
    padding: ($baseline/4) ($baseline/2);
    font-size: $forum-base-font-size;
  }

  .comment-form {
    padding: ($baseline/2) 0;

    .wmd-input {
      @include transition(all .2s linear 0s);
    }

    .wmd-button {
      background: transparent;

      span {
        background-image: url('#{$static-path}/images/wmd-buttons-transparent.png');
      }
    }
  }

  .comment-form-input {
    width: 100%;
    height: 31px;
    padding: 0 ($baseline/2);
    box-sizing: border-box;
    border: 1px solid $forum-color-border;
    border-radius: $forum-border-radius;
    box-shadow: 0 1px 3px $shadow-l1 inset;
    @include transition(border-color .1s linear 0s);

    &:focus {
      border-color: #4697c1;
    }
  }

  .main-article.new {
    display: none;
    padding: ($baseline*2.5);
  }

  .discussion-reply-new {
    @include clearfix();
    @include transition(opacity .2s linear 0s);
    padding: 0 ($baseline/2);

    h4 {
      font-size: $forum-large-font-size;
      font-weight: 700;
    }
  }

  .wmd-button-bar {
    border: none;
  }

  .wmd-input {
    @include discussion-wmd-input;
  }

  .wmd-preview-container {
    @include discussion-wmd-preview-container;
  }

  .wmd-preview-label {
    @include discussion-wmd-preview-label;
  }

  .wmd-preview {
    @include discussion-wmd-preview;
  }

  .reply-post-control {
    margin-top: $baseline;
  }

  .discussion-submit-post {
    @include float(left);
  }
}

// ====================

// inline discussion module
.discussion-module {
  @extend .discussion-body;

  position: relative;
  margin: $baseline 0;
  padding: $baseline;
  background: #f6f6f6 !important;
  border-radius: $forum-border-radius;

  header {
    .anonymous{
      font-size: $forum-base-font-size;
    }
  }

  .new-post-btn {
    @include float(right);
    @include margin-right(4px);
  }

  div.add-response.post-extended-content {
    margin-top: $baseline;
    margin-bottom: $baseline;
  }

  .loading-animation {
    background-image: url('#{$static-path}/images/spinner.gif');
  }
}

.discussion-show {
  position: relative;
  top: 3px;
  font-size: $forum-base-font-size;
  text-align: center;

  &.shown {
    .show-hide-discussion-icon {
      background-position: 0 0;
    }
  }

  .show-hide-discussion-icon {
    display: inline-block;
    position: relative;
    top: 5px;
    @include margin-right(6px);
    width: 21px;
    height: 19px;
    background: url('#{$static-path}/images/show-hide-discussion-icon.png') no-repeat;
    background-position: -21px 0;
  }
}

section.discussion {
  @include clearfix();
}

.new-post-article {
  display: none;

  .inner-wrapper {
    max-width: 1180px;
    min-width: 760px;
    margin: auto;
  }

  .thread-title {
    display: block;
    margin-bottom: $baseline;
    font-size: $forum-x-large-font-size;
    color: $gray-d3;
    font-weight: 700;
  }
}

.edit-post-form {
  @include clearfix();
  width: 100%;
  margin-bottom: $baseline;
  box-sizing: border-box;

  .form-row {
    margin-top: $baseline;
  }

  .edit-post-title {
    width: 100%;
    height: 40px;
    padding: 0 ($baseline/2);
    box-sizing: border-box;
    border-radius: $forum-border-radius;
    border: 1px solid $forum-color-border;
    font-size: $forum-large-font-size;
    font-family: $sans-serif;
    color: $gray-d3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
  }
}

.xblock-student_view-discussion {
  @extend %ui-print-excluded;
}

// ====================

// post pagination
section.discussion-pagination {
  margin-top: ($baseline*1.5);

  nav.discussion-paginator {
    @include float(right);

    ol {
      li {
        @include padding-right($baseline/2);
        list-style: none;
        display: inline-block;

        &.current-page span {
          display: inline-block;
          height: 35px;
          padding: 0 ($baseline*0.75);
          border: 1px solid $forum-color-border;
          border-radius: $forum-border-radius;
          font-size: $forum-base-font-size;
          font-weight: 700;
          line-height: 32px;
          color: $gray-d3;
          text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
        }
      }
    }
  }
}

.response-count {
  @include float(right);
}

.response-pagination {
  visibility: visible;
  padding: 0 ($baseline/2);

  &:empty {
    visibility: hidden;
  }

  .response-display-count {
    display: block;
    padding: ($baseline/2) 0;
    color: $forum-color-response-count;
    font-size: $forum-base-font-size;
  }

  .load-response-button {
    @include text-align(left);
    position: relative;
    margin: ($baseline/2) 0;
    width: 100%;
  }
}
