$comment_margin_left: 30px;
$discussion_title_size: 1.6em;
$comment_title_size: 1.0em;
$comment_body_size: 0.9em;
$comment_info_size: 0.75em;
$discussion_input_width: 90%;

@mixin discussion-font {
  font-family: inherit;
}

@mixin discussion-clickable {
  color: black;
  &:hover {
    text-decoration: none;
  }
}

.course-content {
  .discussion {
    margin-left: flex-gutter();
    margin-top: flex-gutter();
  }
}

.discussion {
  .discussion-search-form {
    margin-bottom: flex-gutter(4);
    display: inline-block;
    width: flex-grid(12);
    .discussion-link {
      @include button;
      display: inline-block;
      margin-left: 1%;
      color: white;
      font-weight: bold;
      text-decoration: none;
      padding-top: 9px;
      font-size: inherit;
    }
    .discussion-search-text {
      @include discussion-font;
    }
    .search-input {
      font: inherit;
      font-style: normal;
      float: left;
      width: 72%;
    }
    .search-within {
      display: block;
      margin-top: flex-gutter();
    }
    .discussion-search-within-board {
      font-style: normal;
      font: inherit;
    }
  }
  .control-button {
    @include button;
    @include discussion-font;
    color: white;
    font-weight: bold;
    padding-top: 9px;
    font-size: inherit;
    width: inherit;
    text-decoration: none;
  }
  .discussion-title {
    @include discussion-font;
    @include discussion-clickable;
    font-size: $discussion_title_size;
    font-weight: bold;
    margin-bottom: flex-gutter(6);
    display: block;
  }
  .discussion-title-wrapper {
    .discussion-watch-discussion, .discussion-unwatch-discussion {
      display: none;
      @include discussion-font;
      margin-left: 5px;
      font-size: $comment_info_size;
    }
    .discussion-title {
      display: inline-block;
    }
    &:hover {
      .discussion-watch-discussion, .discussion-unwatch-discussion {
        display: inline-block;
      }
    }
  }
  .discussion-votes {
    margin-right: 2%;
    margin-top: 2%;
    text-align: center;
    height: flex-grid(3);
    float: left;
    margin-left: 2%;
    .discussion-vote-count {
      font-size: $comment_body_size;
      @include discussion-font;
    }
    a.discussion-vote {
      display: block;
      color: black;
      font-weight: bold;
      font-size: 15px;
      &.discussion-vote-up {
        margin-bottom: 3px;
      }
      &.discussion-vote-down {
        margin-top: 5px;
      }
      &.voted { 
        color: #1d9dd9;
      }
    }
  }
  .discussion-right-wrapper {
    min-height: 40px;
    float: left;
    width: 85%;
  }
  .new-post-form, .discussion-thread-edit{
    .title-input, .body-input {
      font-style: normal;
      font: inherit;
      display: block !important;
      width: $discussion_input_width !important;
    }
    .discussion-errors {
      display: block;
      color: #8F0E0E;
      margin-left: -5%;
    }
    .new-post-body {
      margin-top: flex-gutter();
    }
    .tagsinput {
      margin-top: flex-gutter();
      background: #FAFAFA;
      border: 1px solid #C8C8C8;
      -webkit-border-radius: 3px;
      -moz-border-radius: 3px;
      -ms-border-radius: 3px;
      -o-border-radius: 3px;
      border-radius: 3px;
      -webkit-box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.6), inset 0 0 3px 0 rgba(0, 0, 0, 0.1);
      -moz-box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.6), inset 0 0 3px 0 rgba(0, 0, 0, 0.1);
      box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.6), inset 0 0 3px 0 rgba(0, 0, 0, 0.1);
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
      vertical-align: top;
      -webkit-font-smoothing: antialiased;
    }
  }
  .discussion-content-edit, .discussion-reply-new, .new-post-form {
    .new-post-control, .edit-post-control {
      margin-left: 70.5%;
      margin-top: 1%;
    }
    .control-button {
      @include button;
      @include discussion-font;
      color: white;
      font-weight: bold;
      text-decoration: none;
      margin-left: 3%;
      display: inline-block;
      padding-top: 9px;
      font-size: inherit;
      width: inherit;
    }
    margin: 10px 0 10px 0;
  }
  .thread {
    //display: none;
    margin-top: 30px;
    margin-bottom: 30px;
    .thread-title {
      @include discussion-font;
      @include discussion-clickable;
      font-size: $comment_title_size;
      font-weight: bold;
      display: block;
    }
    .thread-body, .content-body {
      @include discussion-font;
      font-size: $comment_body_size;
      margin-top: 3px;
      margin-bottom: 4px;
      p {
        @include discussion-font;
        margin: 0;
      }
    }
    .thread-tags {
      display: inline-block;
      .thread-tag {
        @include discussion-font;
        border: 1px solid #A5D24A;
        -moz-border-radius: 2px;
        -webkit-border-radius: 2px;
        float: left;
        padding: 5px 7px;
        text-decoration: none;
        background: #CDE69C;
        color: #638421;
        margin-right: 7px;
        margin-bottom: 4px;
        font-size: 13px;
        &:hover {
          color: #1E4612;
          border-color: #1E4612;
        }
      }
    }
    .info {
      @include discussion-font;
      font-size: $comment_info_size;
      font-style: italic;
      color: gray;      
      .discussion-reply {
        margin-left: 4px;
      }
      .discussion-link {
        @include discussion-font;
        margin-left: 2px;
        display: inline-block;
        color: #1d9dd9;
        display: none;
      }
      
    }
    .discussion-content:hover {
      .discussion-link {
        display: inline-block;
      }
    }
    .discussion-content {
      margin-top: 10px;
      overflow: hidden;
      border-top: lightgray 1px solid;
      padding-top: 20px;
      .discussion-reply-new {
        margin-left: $comment_margin_left;
        .reply-body {
          @include discussion-font;
          width: $discussion_input_width !important;
          font-size: $comment_body_size;
          margin-top: 10px;
          display: block;
        }
      }
    }
    .comments {
      //display: none;
      margin-left: $comment_margin_left;
      overflow: hidden;
      .comment {
        .comment-body, .content-body {
          @include discussion-font;
          font-size: $comment_body_size;
          margin-top: 3px;
          display: block;
          color: black;
        }

        &.endorsed {
          > .discussion-content {
            background-color: lightyellow;
          }
        }
      }
    }
  }

}


.wmd-panel
{
  width: 100%;
  min-width: 500px;
}

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

.wmd-input 
{ 
  height: 150px;
  width: 100%;
  background-color: Gainsboro;
  border: 1px solid DarkGray;
  font: inherit;
}

.wmd-preview 
{ 
  background-color: #c0e0ff;
}

.wmd-button-row 
{
  position: relative; 
  margin-left: 5px;
  margin-right: 5px;
  margin-bottom: 5px;
  margin-top: 10px;
  padding: 0px;  
  height: 20px;
}

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

.wmd-button {
  width: 20px;
  height: 20px;
  padding-left: 2px;
  padding-right: 3px;
  position: absolute;
  display: inline-block;
  list-style: none;
  cursor: pointer;
}

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

.wmd-spacer1
{
  left: 50px;
}
.wmd-spacer2
{
  left: 175px;
}
.wmd-spacer3
{
  left: 300px;
}

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

.wmd-prompt-dialog
{
  border: 1px solid #999999;
  background-color: #F5F5F5;
}

.wmd-prompt-dialog > div {
  font-size: 0.8em;
  font-family: arial, helvetica, sans-serif;
}


.wmd-prompt-dialog > form > input[type="text"] {
  border: 1px solid #999999;
  color: black;
}

.wmd-prompt-dialog > form > input[type="button"]{
  border: 1px solid #888888;
  font-family: trebuchet MS, helvetica, sans-serif;
  font-size: 0.8em;
  font-weight: bold;
}
