// lms - xmodule - combinedopenended
// ====================

h2 {
  margin-top: 0;
  margin-bottom: ($baseline*0.75);

  &.problem-header {
    section.staff {
      margin-top: ($baseline*1.5);
      font-size: 80%;
    }
  }

  @media print {
    display: block;
    width: auto;
    border-right: 0;
  }
}

 // Problem Header
div.name{
  padding-bottom: ($baseline*0.75);

  h2 {
    display: inline;
  }

  .progress-container {
    display: inline;
    float: right;
    padding-top: 3px;
  }
}

.inline-error {
  color: darken($error-red, 10%);
}

section.combined-open-ended {
  @include clearfix();

  .written-feedback {
    position: relative;
    margin: 0;
    height: 150px;
    border: 1px solid lightgray;
    padding: ($baseline/4);
    resize: vertical;
    width: 99%;
    overflow: auto;

    .del {
      text-decoration: line-through;
      background-color: #ffc3c3;
    }
    .ins {
      background-color: #c3ffc3;
    }
  }
}


div.problemwrapper {
  border: 1px solid lightgray;
  border-radius: ($baseline/2);

  .status-bar {
    background-color: #eee;
    border-radius: ($baseline/2) ($baseline/2) 0 0;
    border-bottom: 1px solid lightgray;

    .statustable {
      width: 100%;
      padding: $baseline;
    }

    .status-container {
      display: table-cell;
      text-align: center;

      .status-elements {
        border-radius: ($baseline/4);
        border: 1px solid lightgray;
      }
    }

    .problemtype-container {
      padding: ($baseline/2);
      width: 60%;
    }

    .problemtype{
      padding: ($baseline/2);
    }

    .assessments-container {
      float: right;
      padding: ($baseline/2) $baseline ($baseline/2) ($baseline/2);

      .assessment-text {
        display: inline-block;
        display: table-cell;
        padding-right: ($baseline/2);
      }
    }
  }
  .item-container {
    padding-bottom: ($baseline/2);
    margin: 15px;
  }

  .result-container {
    float: left;
    width: 100%;
    position: relative;
  }
}

section.legend-container {
  margin: 15px;
  border-radius: ($baseline/4);

  .legenditem {
    display: inline;
    padding: ($baseline/2);
    width: 20%;
    background-color: #eee;
    font-size: .9em;
  }
}

section.combined-open-ended-status {
  vertical-align: center;

  .statusitem {
    display: table-cell;
    padding: ($baseline/2);
    width: 30px;
    border-right: 1px solid lightgray;
    background-color: #eee;
    color: #2c2c2c;
    font-size: .9em;

    &:first-child {
      border-radius: ($baseline/4) 0 0 ($baseline/4);
    }

    &:last-child {
      border-right: 0;
      border-radius: 0 ($baseline/4) ($baseline/4) 0;
    }

    &:only-child {
      border-radius: ($baseline/4);
    }

    .show-results {
      margin-top: .3em;
      text-align:right;
    }

    .show-results-button {
      font: 1em monospace;
    }
  }

 .statusitem-current {
    background-color: $white;
    color: #222;
 }

  span {
    &.unanswered {
      display: inline-block;
      position: relative;
      float: right;
      width: 14px;
      height: 14px;
      background: url('../images/unanswered-icon.png') center center no-repeat;
    }

    &.correct {
      display: inline-block;
      position: relative;
      float: right;
      width: 25px;
      height: 20px;
      background: url('../images/correct-icon.png') center center no-repeat;
    }

    &.incorrect {
      display: inline-block;
      position: relative;
      float: right;
      width: 20px;
      height: 20px;
      background: url('../images/incorrect-icon.png') center center no-repeat;
    }
  }

  .icon-caret-right {
    display: inline-block;
    margin-right: ($baseline/4);
    vertical-align: baseline;
  }
}

// Problem Section Controls

.visibility-control, .visibility-control-prompt {
  display: block;
  width: 100%;
  height: 40px;

  .inner {
    float: left;
    margin-top: $baseline;
    width: 85%;
    height: 5px;
    border-top: 1px dotted #ddd;
  }
}

.section-header {
  display: block;
  float: right;
  padding-top: ($baseline/2);
  width: 15%;
  text-align: center;
  font-size: .9em;
}

// Rubric Styling

.wrapper-score-selection {
  display: table-cell;
  padding: 0 ($baseline/2);
  width: 20px;
  vertical-align: middle;
}

.wrappable {
  display: table-cell;
  padding: ($baseline/4);
}

.rubric-list-item {
  margin-bottom: ($baseline/10);
  padding: ($baseline/2);

  &:hover, &:focus {
    background-color: #eee;
  }
  .rubric-label-selected{
    border-radius: ($baseline/4);
    background-color: #eee;
  }
}

span.rubric-category {
  display: block;
  margin-bottom: ($baseline/2);
  padding-top: ($baseline/2);
  width: 100%;
  border-bottom: 1px solid lightgray;
  font-size: 1.1em;
}

div.combined-rubric-container {
  margin: 15px;
  padding-top: ($baseline/2);
  padding-bottom: ($baseline/4);

  ul.rubric-list {
    margin: 0 $baseline ($baseline/2) $baseline;
    padding: 0;
    list-style-type: none;

    li {

      &.rubric-list-item {
        margin-bottom: ($baseline/10);
        padding: ($baseline/2);
      }
    }
  }

  h4 {
    padding-top: ($baseline/2);
  }

  span.rubric-category {
    display: block;
    width: 100%;
    border-bottom: 1px solid lightgray;
    font-weight: bold;
    font-size: .9em;
  }

  label.choicegroup_correct {
    &:before {
      margin-right: ($baseline*0.75);
      content: url('../images/correct-icon.png');
    }
  }

  label.choicegroup_partialcorrect {
    &:before {
      margin-right: ($baseline*0.75);
      content: url('../images/partially-correct-icon.png');
    }
  }

  label.choicegroup_incorrect {
    &:before {
      margin-right: ($baseline*0.75);
      content: url('../images/incorrect-icon.png');
    }
  }

  div.written-feedback {
      background: $gray-l6;
      padding: ($baseline/4);
    }
}

div.result-container {
  padding-top: ($baseline/2);
  padding-bottom: ($baseline/4);

  .evaluation {
    p {
      margin-bottom: 1px;
    }
  }

  .feedback-on-feedback {
    height: 100px;
    margin-right: 0;
  }

  .evaluation-response {
    margin-bottom: ($baseline/10);

    header {
      a {
        font-size: .85em;
      }
    }
  }

  .evaluation-scoring {
    .scoring-list {
      margin-left: 3px;
      list-style-type: none;

      li {
        display:inline;
        margin-left: 0;

        &:first-child {
          margin-left: 0;
        }

        label {
          font-size: .9em;
        }
      }
    }
  }

  .submit-message-container {
    margin: ($baseline/2) 0;
  }

  .external-grader-message {
    margin-bottom: ($baseline/4);

    section {
      padding-left: $baseline;
      background-color: #fafafa;
      color: #2c2c2c;
      font-family: monospace;
      font-size: 1em;
      padding-top: ($baseline/2);
      padding-bottom: 30px;

      header {
        font-size: 1.4em;
      }

      .shortform {
        font-weight: bold;
      }

      .longform {
        padding: 0;
        margin: 0;

        .result-errors {
          margin: ($baseline/4);
          padding: ($baseline/2) ($baseline/2) ($baseline/2) ($baseline*2);
          background: url('../images/incorrect-icon.png') center left no-repeat;

          li {
            color: #B00;
          }
        }

        .result-output {
          margin: ($baseline/4);
          padding: $baseline 0 ($baseline*0.75) ($baseline*2.5);
          border-top: 1px solid #ddd;
          border-left: 20px solid #fafafa;

          h4 {
            font-size: 1em;
            font-family: monospace;
          }

          dl {
            margin: 0;
          }

          dt {
            margin-top: $baseline;
          }

          dd {
            margin-left: 24pt;
          }
        }

        .markup-text{
          margin: ($baseline/4);
          padding: $baseline 0 ($baseline*0.75) ($baseline*2.5);
          border-top: 1px solid #ddd;
          border-left: 20px solid #fafafa;

          bs {
            color: #bb0000;
          }

          bg {
            color: #bda046;
          }
        }
      }
    }
  }

  .rubric-result-container {
    padding: ($baseline/10);
    margin: 0;
    display: inline;

    .rubric-result {
      font-size: .9em;
      padding: ($baseline/10);
      display: inline-table;
    }
  }
}

div.rubric {
  ul.rubric-list{
    margin: 0 $baseline ($baseline/2) $baseline;
    padding: 0;
    list-style: none;
    list-style-type: none;

    li {
      &.rubric-list-item {
        margin-bottom: ($baseline/10);
        padding: ($baseline/2);
        border-radius: ($baseline/4);

        &:hover, &:focus {
          background-color: #eee;
        }

        .wrapper-score-selection {
          display: table-cell;
          padding: 0 ($baseline/2);
          width: 20px;
          vertical-align: middle;
        }

        .wrappable {
          display: table-cell;
          padding: ($baseline/4);
        }
      }
    }
  }

  span.rubric-category {
    display: block;
    width: 100%;
    border-bottom: 1px solid lightgray;
    font-weight: bold;
    font-size: .9em;
  }
}


section.open-ended-child {
  @media print {
    display: block;
    padding: 0;
    width: auto;

    canvas, img {
      page-break-inside: avoid;
    }
  }

  .inline {
    display: inline;
  }

  ol.enumerate {
    li {
      &:before {
        display: block;
        visibility: hidden;
        height: 0;
        content: " ";
      }
    }
  }

  .solution-span {
    > span {
      position: relative;
      display: block;
      margin: $baseline 0;
      padding: 9px 15px $baseline;
      border: 1px solid #ddd;
      border-radius: 3px;
      background: $white;
      box-shadow: inset 0 0 0 1px #eee;

      &:empty {
        display: none;
      }
    }
  }

  p {
    &.answer {
      margin-top: -2px;
    }
    &.status {
      margin: 8px 0 0 ($baseline/2);
      text-indent: -9999px;
    }
  }

  div.unanswered {
    p.status {
      display: inline-block;
      width: 14px;
      height: 14px;
      background: url('../images/unanswered-icon.png') center center no-repeat;
    }
  }

  div.correct, div.ui-icon-check {
    p.status {
      display: inline-block;
      width: 25px;
      height: 20px;
      background: url('../images/correct-icon.png') center center no-repeat;
    }

    input {
      border-color: green;
    }
  }

  div.processing {
    p.status {
      display: inline-block;
      width: 20px;
      height: 20px;
      background: url('../images/spinner.gif') center center no-repeat;
    }

    input {
      border-color: #aaa;
    }
  }

  div.incorrect, div.ui-icon-close {
    p.status {
      display: inline-block;
      width: 20px;
      height: 20px;
      background: url('../images/incorrect-icon.png') center center no-repeat;
      text-indent: -9999px;
    }

    input {
      border-color: red;
    }
  }

  > span {
    display: block;
    margin-bottom: lh(0.5);
  }

  p.answer {
    display: inline-block;
    margin-bottom: 0;
    margin-left: ($baseline/2);

    &:before {
      content: "Answer: ";
      font-weight: bold;
      display: inline;

    }
    &:empty {
      &:before {
        display: none;
      }
    }
  }

  span {
    &.unanswered, &.ui-icon-bullet {
      display: inline-block;
      position: relative;
      top: 4px;
      width: 14px;
      height: 14px;
      background: url('../images/unanswered-icon.png') center center no-repeat;
    }

    &.processing, &.ui-icon-processing {
      display: inline-block;
      position: relative;
      top: 6px;
      width: 25px;
      height: 20px;
      background: url('../images/spinner.gif') center center no-repeat;
    }

    &.correct, &.ui-icon-check {
      display: inline-block;
      position: relative;
      top: 6px;
      width: 25px;
      height: 20px;
      background: url('../images/correct-icon.png') center center no-repeat;
    }

    &.incorrect, &.ui-icon-close {
      display: inline-block;
      position: relative;
      top: 6px;
      width: 20px;
      height: 20px;
      background: url('../images/incorrect-icon.png') center center no-repeat;
    }
  }

  .reload {
    float:right;
    margin: ($baseline/2);
  }

  div.short-form-response {
    @include clearfix();
    overflow-y: auto;
    margin-bottom: 0;
    padding: ($baseline/2);
    min-height: 20px;
    height: auto;
    border: 1px solid #ddd;
    background: $gray-l6;
  }

  .grader-status {
    @include clearfix();
    margin: ($baseline/2) 0;
    padding: ($baseline/2);
    border-radius: 5px;
    background: $gray-l6;

    span {
      display: block;
      float: left;
      overflow: hidden;
      margin: -7px 7px 0 0;
      text-indent: -9999px;
    }

    .grading {
      margin: 0 7px 0 0;
      padding-left: 25px;
      background: url('../images/info-icon.png') left center no-repeat;
      text-indent: 0;
    }

    p {
      float: left;
      margin-bottom: 0;
      line-height: 20px;
    }

    &.file {
      margin-top: $baseline;
      padding: $baseline 0 0 0;
      border: 0;
      border-top: 1px solid #eee;
      background: $white;

      p.debug {
        display: none;
      }

      input {
        float: left;
      }
    }
  }

  form.option-input {
    margin: -($baseline/2) 0 $baseline;
    padding-bottom: $baseline;

    select {
      margin-right: flex-gutter();
    }
  }

  ul {
    margin-bottom: lh();
    margin-left: 0.75em;
    margin-left: 0.75rem;
  }

  ul.rubric-list{
    margin: 0;
    padding: 0;
    list-style-type: none;
    list-style: none;

    li {
      &.rubric-list-item {
        margin-bottom: 0;
        padding: 0;
        border-radius: ($baseline/4);
      }
    }
  }

  ol {
    margin-bottom: lh();
    margin-left: .75em;
    margin-left: .75rem;
    list-style: decimal outside none;
  }

  dl {
    line-height: 1.4em;
  }

  dl dt {
    font-weight: bold;
  }

  dl dd {
    margin-bottom: 0;
  }

  dd {
    margin-left: .5em;
    margin-left: .5rem;
  }

  li {
    margin-bottom: 0;
    padding: 0;

    &:last-child {
      margin-bottom: 0;
    }
  }

  p {
    margin-bottom: lh();
  }

  hr {
    float: none;
    clear: both;
    margin: 0 0 .75rem;
    width: 100%;
    height: 1px;
    border: none;
    background: #ddd;
    color: #ddd;
  }

  .hidden {
    display: none;
    visibility: hidden;
  }

  #{$all-text-inputs} {
    display: inline;
    width: auto;
  }

  div.action {
    margin-top: $baseline;

    input.save {
      @extend .blue-button !optional;
    }

    .submission_feedback {
      display: inline-block;
      margin: 8px 0 0 ($baseline/2);
      color: #666;
      font-style: italic;
      -webkit-font-smoothing: antialiased;
    }
  }

  .detailed-solution {
    > p:first-child {
      color: #aaa;
      text-transform: uppercase;
      font-weight: bold;
      font-style: normal;
      font-size: 0.9em;
    }

    p:last-child {
      margin-bottom: 0;
    }
  }

  div.open-ended-alert,
  .save_message {
    margin-top: ($baseline/2);
    margin-bottom: ($baseline/4);
    padding: 8px 12px;
    border: 1px solid #ebe8bf;
    border-radius: 3px;
    background: #fffcdd;
    font-size: 0.9em;
  }

  div.capa_reset {
    margin-top: ($baseline/2);
    margin-bottom: ($baseline/2);
    padding: 25px;
    border: 1px solid $error-red;
    border-radius: 3px;
    background-color: lighten($error-red, 25%);
    font-size: 1em;
  }

  .capa_reset > h2 {
    color: #aa0000;
  }

  .capa_reset li {
    font-size: 0.9em;
  }

  .assessment-container {
    margin: ($baseline*2) 0 ($baseline*1.5) 0;

    .scoring-container {
      p {
        margin-bottom: 1em;
      }

      label {
        display: inline-block;
        margin: ($baseline/2);
        padding: ($baseline/4);
        min-width: 50px;
        background-color: $gray-l3;
        text-size: 1.5em;
      }

      input[type=radio]:checked + label {
        background: #666;
        color: white;
      }

      input[class='grade-selection'] {
        display: none;
      }
    }
  }

  div.prompt {
    background-color: white;
  }

  h4 {
    padding: $baseline/2 0;
  }
}

//OE Tool Area Styling

.oe-tools {
  display: inline-block;
  width: 100%;
  border-radius: 5px;

  .oe-tools-label, .oe-tools-scores-label {
    display: inline-block;
    padding: $baseline/2;
    vertical-align: middle;
    font-size: 0.8em;
  }

  .rubric-button {
    padding: 8px $baseline/4;
  }

  .rubric-previous-button {
    margin-right: $baseline/4;
  }

  .rubric-next-button {
    margin-left: $baseline/4;
  }

  .next-step-button {
    margin: $baseline/2;
  }
  .reset-button {
    vertical-align: middle;
  }
}

// Staff Grading
.problem-list-container {
  margin: $baseline/2;

  .instructions {
    padding-bottom: $baseline/2;
  }
}

.staff-grading {

  .breadcrumbs {
    padding: ($baseline/10);
    background-color: $gray-l6;
    border-radius: 5px;
    margin-bottom: ($baseline/2);
  }

  .prompt-wrapper {
    padding-top: ($baseline/2);

    .meta-info-wrapper {
      padding: ($baseline/2);
      border-radius: 5px;
    }
  }
}

section.peer-grading-container{
    div.peer-grading{
        section.calibration-feedback {
            padding: $baseline;
        }
    }
}

div.staff-info{
    background-color: #eee;
    border-radius: 10px;
    border-bottom: 1px solid lightgray;
    padding: ($baseline/2);
    margin: ($baseline/2) 0 ($baseline/2) 0;
}
