$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: 100%;

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

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

.discussion {
  .discussion-non-content {
    margin-left: flex-gutter();
  }
  .search-wrapper-inline {
    width: 80%;
    display: inline-block;
    margin-top: 3%;
    margin-bottom: 6%;
  }
  .discussion-search-form {
    margin-bottom: 1%;
    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-bottom: 3%;
  }
  .discussion-search-within-board {
    font-style: normal;
    font: inherit;
    font-size: $comment_body_size;
  }
  .control-button {
    @include button;
    @include discussion-font;
    display: inline-block;
    margin-bottom: 3%;
    color: white;
    font-weight: bold;
    padding-top: 9px;
    font-size: inherit;
    width: inherit;
    text-decoration: none;
    border: 1px solid #6F6F6F;
    -webkit-box-shadow: inset 0 1px 0 #A2A2A2,0 0 3px #CCC;
    -moz-box-shadow: inset 0 1px 0 #a2a2a2,0 0 3px #ccc;
    box-shadow: inset 0 1px 0 #A2A2A2,0 0 3px #CCC;
    background-color: #959595;
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #959595),color-stop(100%, #7B7B7B));
    background-image: -webkit-linear-gradient(top, #959595,#7B7B7B);
    background-image: -moz-linear-gradient(top, #959595,#7B7B7B);
    background-image: -ms-linear-gradient(top, #959595,#7B7B7B);
    background-image: -o-linear-gradient(top, #959595,#7B7B7B);
    background-image: linear-gradient(top, #959595,#7B7B7B);
    text-shadow: none;
    &:hover {
      -webkit-box-shadow: inset 0 1px 0 #BBB,0 0 3px #CCC;
      -moz-box-shadow: inset 0 1px 0 #bbb,0 0 3px #ccc;
      box-shadow: inset 0 1px 0 #BBB,0 0 3px #CCC;
      background-color: #A2A2A2;
      background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #A2A2A2),color-stop(100%, #7B7B7B));
      background-image: -webkit-linear-gradient(top, #A2A2A2,#7B7B7B);
      background-image: -moz-linear-gradient(top, #A2A2A2,#7B7B7B);
      background-image: -ms-linear-gradient(top, #A2A2A2,#7B7B7B);
      background-image: -o-linear-gradient(top, #A2A2A2,#7B7B7B);
      background-image: linear-gradient(top, #A2A2A2,#7B7B7B);
      border: 1px solid #555;
    }
  }
  .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;
    }
  }
  .follow-wrapper {
    float: right;
    .discussion-link {
      display: inline-block;
      @include button;
      text-decoration: none;
      font-size: $comment_info_size;
      padding: 5px 8px;
      text-decoration: none;
      border: none;
      -webkit-box-shadow: none; 
      -moz-box-shadow: none; 
      box-shadow: none; 
      background-color: #AAA;
      background-image: none;
      text-shadow: none;
      &:hover {
        border: none;
        -webkit-box-shadow: none; 
        -moz-box-shadow: none; 
        box-shadow: none; 
        background-color: #BEBEBE;
        background-image: none; 
      }
    }
  }
  .discussion-votes {
    text-align: center;
    height: flex-grid(3);
    float: left;
    margin: 1% 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;
      &:hover {
        text-decoration: none;
        color: #1C71DD;
      }
      &.discussion-vote-up {
        margin-bottom: 3px;
      }
      &.discussion-vote-down {
        margin-top: 5px;
      }
      &.voted { 
        color: #1C71DD;
      }
    }
  }
  .discussion-right-wrapper {
    min-height: 40px;
    float: left;
    width: 90%;
  }
  .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-sort {
    font-size: $comment_body_size;
    float: right;
    margin-top: -2.5%;
    .discussion-sort-link {
      &:hover {
        text-decoration: none;
        color: #1C71DD;
      }
    }
    .discussion-sort-link.sorted {
      font-weight: bold;
      color: #1C71DD; 
    }
  }
  .discussion-content-edit, .discussion-reply-new, .new-post-form {
    .new-post-control {
      margin-left: 80%;
      margin-top: 1%;
    }
    .reply-post-control {
      margin-left: 73%;
    }
    .edit-post-control {
      margin-left: 79%;
      margin-top: 1%;
    }
    .control-button {
      @include button;
      @include discussion-font;
      color: white;
      font-weight: bold;
      text-decoration: none;
      margin-left: 5%;
      display: inline-block;
      padding-top: 9px;
      font-size: inherit;
      width: inherit;
    }
    margin: 10px 0 10px 0;
  }
  .new-post-form {
    margin: 10px 0 40px 0;
  }
  .discussion-reply-new {
    .discussion-auto-watch {
      margin-left: 2%;
    }
  }
  .thread {
    //display: none;
    .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;
        color: #1d9dd9;
        display: inline;
      }
    }
    .discussion-content {
      overflow: hidden;
      border-top: lightgray 1px solid;
      padding: 2% 0;
      .discussion-reply-new {
        @include discussion-font;
        margin-left: 5%;
        .reply-body {
          @include discussion-font;
          width: 95%;
          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;
          }
        }
      }
    }
  }
  .discussion-paginator {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: $comment_body_size;
    text-align: center;
    div {
      display: inline-block;
      font-weight: bold;
      margin: 0 5px;
      a {
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        -ms-border-radius: 3px;
        -o-border-radius: 3px;
        border-radius: 3px;
        padding: 4px 10px;
        background: #EEE;
        font-weight: normal;
        color: black;
        text-decoration: none;
        &:hover {
          background: #DDD;
        }
      }
    }
  }
}


.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;
}
