$annotation-yellow: rgba(255,255,10,0.3);

h2 {
  margin-top: 0;
  margin-bottom: 15px;

  &.problem-header {
    display: inline-block;
    section.staff {
      margin-top: 30px;
      font-size: 80%;
    }
  }

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


iframe[seamless]{
  overflow: hidden;
  padding: 0px;
  border: 0px none transparent;
  background-color: transparent;
}

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

div.problem-progress {
  display: inline-block;
  padding-left: 5px;
  color: #666;
  font-weight: 100;
  font-size: em(16);
}

div.problem {
  @media print {
    display: block;
    padding: 0;
    width: auto;

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

  .inline {
    display: inline;
  }

  .choicegroup {
    @include clearfix;
    min-width: 100px;
    width: auto !important;
    width: 100px;

    label {
      float: left;
      clear: both;
      margin-bottom: 5px;

      &.choicegroup_correct {
        &:after {
          margin-left: 15px;
          content: url('../images/correct-icon.png');
        }
      }

      &.choicegroup_incorrect {
        &:after {
          margin-left: 15px;
          content: url('../images/incorrect-icon.png');
        }
      }
    }

    .indicator_container {
      float: left;
      width: 25px;
      height: 1px;
      margin-right: 15px;
    }

    fieldset {
      @include box-sizing(border-box);
      margin: 0px 0px $baseline;
      padding-left: $baseline;
      border-left: 1px solid #ddd;
    }

    input[type="radio"],
    input[type="checkbox"] {
      float: left;
      margin: 4px 8px 0 0;
    }

    text {
      display: inline;
      margin-left: 25px;
    }
  }

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

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

      &:empty {
        display: none;
      }
    }
  }

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

      &:empty {
        display: none;
      }
    }
  }

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

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

    &.correct, &.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;
      }
    }

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

      input {
        border-color: #aaa;
      }
    }

    &.incorrect, &.incomplete, &.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(.5);
    }

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

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

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

    div.equation {
      clear: both;
      margin-top: 3px;

      .MathJax_Display {
        display: inline-block;
        width: auto;
      }

      img.loading {
        display: inline-block;
        padding-left: 10px;
      }

      span {
        margin-bottom: 0;

        &.math {
          display: inline-block;
          padding: 6px;
          min-width: 30px;
          border: 1px solid #e3e3e3;
          border-radius: 4px;
          background: #f1f1f1;
        }
      }
    }

    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: 3px;
        width: 25px;
        height: 20px;
        background: url('../images/correct-icon.png') center center no-repeat;
      }

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

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

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


    .grader-status {
      @include clearfix;
      margin: $baseline/2 0;
      padding: $baseline/2;
      border-radius: 5px;
      background: #F6F6F6;

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

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

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

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

        p.debug {
          display: none;
        }

        input {
          float: left;
        }
      }

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


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

    .evaluation-response {
      header {
        text-align: right;
        a {
          font-size: .85em;
        }
      }
    }

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

        li {
          display:inline;
          margin-left: 50px;

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

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

    .submit-message-container {
      margin: $baseline 0px ;
    }
  }

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

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

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

  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: lh(.5);
    line-height: 1.4em;

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

  p {
    margin-bottom: lh();
  }

  table {
    margin: lh() 0;
    border-collapse: collapse;
    table-layout: auto;

    td, th {

      &.cont-justified-left {
        text-align: left !important; // nasty, but needed to override the bad specificity of the xmodule css selectors
      }

      &.cont-justified-right {
        text-align: right !important; // nasty, but needed to override the bad specificity of the xmodule css selectors
      }

      &.cont-justified-center {
        text-align: center !important; // nasty, but needed to override the bad specificity of the xmodule css selectorsstyles
      }
    }

    th {
      text-align: left;
      font-weight: bold;
    }

    td {
      text-align: left;
    }

    caption, th, td {
      padding: .25em .75em .25em 0;
      padding: .25rem .75rem .25rem 0;
    }

    caption {
      margin-bottom: .75em;
      margin-bottom: .75rem;
      padding: .75em 0;
      padding: .75rem 0;
      background: #f1f1f1;
    }

    tr, td, th {
      vertical-align: middle;
    }
  }

  code {
    margin: 0 2px;
    padding: 0px 5px;
    border: 1px solid #eaeaea;
    border-radius: 3px;
    background-color: #f8f8f8;
    white-space: nowrap;
    font-size: .9em;
  }

  pre {
    overflow: auto;
    padding: 6px $baseline/2;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #f8f8f8;
    font-size: .9em;
    line-height: 1.4;

    > code {
      margin: 0;
      padding: 0;
      border: none;
      background: transparent;
      white-space: pre;
    }
  }

  .CodeMirror {
    border: 1px solid black;
    font-size: 14px;
    line-height: 18px;
    resize: none;

    .cm-tab {
        background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);
        background-position: right;
        background-repeat: no-repeat;
    }

    pre {
      overflow: hidden;
      margin: 0;
      padding: 0;
      border-width: 0;
      border-radius: 0;
      background: transparent;
      white-space: pre;
      word-wrap: normal;
      font-size: inherit;
      font-family: inherit;
      resize: none;

      &.CodeMirror-cursor {
        position: absolute;
        z-index: 10;
        visibility: hidden;
        width: 0;
        border-right: none;
        border-left: 1px solid black;
      }
    }
  }

  .CodeMirror-focused pre.CodeMirror-cursor {
    visibility: visible;
  }

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

  // this supports a deprecated element and should be removed once the center tag is removed
  center {
    display: block;
    margin: lh() 0;
    padding: lh();
    border: 1px solid #ccc;
  }

  div.action {
    margin-top: $baseline;

    .save, .check, .show, .reset {
      height: ($baseline*2);
      vertical-align: middle;
      font-weight: 600;
    }

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

    .show {

      .show-label {
        font-weight: 600;
        font-size: 1.0em;
      }
    }

    .submission_feedback {
      // background: #F3F3F3;
      // border: 1px solid #ddd;
      // border-radius: 3px;
      // padding: 8px 12px;
      // margin-top: 10px;
      display: inline-block;
      margin: 8px 0 0 $baseline/2;
      color: #777;
      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;
    }
  }

  .detailed-targeted-feedback {
    > p:first-child {
      color: red;
      text-transform: uppercase;
      font-weight: bold;
      font-style: normal;
      font-size: 0.9em;
    }

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

  .detailed-targeted-feedback-correct {
    > p:first-child {
      color: green;
      text-transform: uppercase;
      font-weight: bold;
      font-style: normal;
      font-size: 0.9em;
    }

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

  div.capa_alert {
    margin-top: $baseline;
    padding: 8px 12px;
    border: 1px solid #ebe8bf;
    border-radius: 3px;
    background: #fffcdd;
    font-size: 0.9em;
  }

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

  .capa_reset>h2 {
    color: #aa0000;
  }

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

  .hints {
    border: 1px solid #ccc;

    h3 {
      padding: 9px;
      border-bottom: 1px solid #e3e3e3;
      background: #eee;
      text-shadow: 0 1px 0 #fff;
      font-weight: bold;
      font-size: em(16);
    }

    div {
      border-bottom: 1px solid #ddd;

      &:last-child {
        border-bottom: none;
      }

      p {
        margin-bottom: 0;
      }

      header {
        a {
          display: block;
          padding: 9px;
          background: #f6f6f6;
          box-shadow: inset 0 0 0 1px #fff;
        }
      }

      > section {
        padding: 9px;
      }
    }
  }

  .test {
    padding-top: 18px;

    header {
      margin-bottom: 12px;

      h3 {
        color: #aaa;
        text-transform: uppercase;
        font-weight: bold;
        font-style: normal;
        font-size: 0.9em;
      }
    }

    > section {
      position: relative;
      margin-bottom: $baseline/2;
      padding: 9px 9px $baseline;
      border: 1px solid #ddd;
      border-radius: 3px;
      background: #fff;
      box-shadow: inset 0 0 0 1px #eee;

      p:last-of-type {
        margin-bottom: 0;
      }

      .shortform {
        margin-bottom: .6em;
      }

      a.full {
        @include position(absolute, 0 0px 1px 0px);
        @include box-sizing(border-box);
        display: block;
        padding: 4px;
        background: #f3f3f3;
        text-align: right;
        font-size: 1em;

        &.full-top {
          @include position(absolute, 1px 0px auto 0px);
        }

        &.full-bottom {
          @include position(absolute, auto 0px 1px 0px);
        }
      }
    }
  }

  .external-grader-message {
    section {
      padding-top: ($baseline*1.5);
      padding-left: $baseline;
      background-color: #fafafa;
      color: #2c2c2c;
      font-size: 1em;
      font-family: monospace;

      header {
        font-size: 1.4em;
      }

      .shortform {
        font-weight: bold;
      }

      .longform {
        margin: 0;
        padding: 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 15px 50px;
          border-top: 1px solid #ddd;
          border-left: $baseline solid #fafafa;

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

          dl {
            margin: 0;
          }

          dt {
            margin-top: $baseline;
          }

          dd {
            margin-left: 24pt;
          }
        }

        .result-correct {
          background: url('../images/correct-icon.png') left 20px no-repeat;

          .result-actual-output {
            color: #090;
          }
        }

        .result-incorrect {
          background: url('../images/incorrect-icon.png') left 20px no-repeat;

          .result-actual-output {
            color: #B00;
          }
        }

        .markup-text{
          margin: 5px;
          padding: $baseline 0 15px 50px;
          border-top: 1px solid #ddd;
          border-left: 20px solid #fafafa;

          bs {
            color: #bb0000;
          }

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

  .rubric {
    tr {
      margin: $baseline/2 0;
      height: 100%;
    }

    td {
      margin: $baseline/2 0;
      padding: $baseline 0;
      height: 100%;
    }

    th {
      margin: $baseline/4;
      padding: $baseline/4;
    }

    label,
    .view-only {
      position: relative;
      display: inline-block;
      margin: 3px;
      padding: 15px;
      min-width: 50px;
      min-height: 50px;
      width: 150px;
      height: 100%;
      background-color: #ccc;
      font-size: .9em;
    }

    .grade {
      position: absolute;
      right: 0;
      bottom: 0;
      margin: $baseline/2;
    }

    .selected-grade {
      background: #666;
      color: white;
    }

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

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

  .annotation-input {
    margin: 0 0 1em 0;
    border: 1px solid #ccc;
    border-radius: 1em;

    .annotation-header {
      padding: .5em 1em;
      border-bottom: 1px solid #ccc;
      font-weight: bold;
    }

    .annotation-body { padding: .5em 1em; }

    a.annotation-return {
      float: right;
      font: inherit;
      font-weight: normal;
    }

    a.annotation-return:after { content: " \2191" }

    .block, ul.tags {
      margin: .5em 0;
      padding: 0;
    }

    .block-highlight {
      padding: .5em;
      border: 1px solid darken($annotation-yellow, 10%);
      background-color: $annotation-yellow;
      color:  #333;
      font-style: normal;
    }

    .block-comment { font-style: italic; }

    ul.tags {
      display: block;
      margin-left: 1em;
      list-style-type: none;

      li {
        position: relative;
        display: block;
        margin: 1em 0 0 0;

        .tag {
          display: inline-block;
          margin-left: $baseline*2;
          border: 1px solid rgb(102,102,102);
          cursor: pointer;

          &.selected {
            background-color: $annotation-yellow;
          }
        }
        .tag-status {
          position: absolute;
          left: 0;
        }
        .tag-status, .tag { padding: .25em .5em; }
      }
    }

    textarea.comment {
      $num-lines-to-show: 5;
      $line-height: 1.4em;
      $padding: .2em;
      padding: $padding (2 * $padding);
      width: 100%;
      height: ($num-lines-to-show * $line-height) + (2*$padding) - (($line-height - 1)/2);
      line-height: $line-height;
    }

    .answer-annotation { display: block; margin: 0; }

    /* for debugging the input value field. enable the debug flag on the inputtype */
    .debug-value {
      margin: 1em 0;
      padding: 1em;
      border: 1px solid #000;
      background-color: #999;
      color: #fff;

      input[type="text"] { width: 100%; }

      pre { background-color: #CCC; color: #000; }

      &:before {
        display: block;
        content: "debug input value";
        text-transform: uppercase;
        font-weight: bold;
        font-size: 1.5em;
      }
    }
  }

  .choicetextgroup{
    @extend .choicegroup;

    input[type="text"]{
      margin-bottom: 0.5em;
    }

    label.choicetextgroup_correct, section.choicetextgroup_correct {
      @extend label.choicegroup_correct;

      input[type="text"] {
        border-color: green;
      }
    }

    label.choicetextgroup_incorrect, section.choicetextgroup_incorrect {
      @extend label.choicegroup_incorrect;
    }

    label.choicetextgroup_show_correct, section.choicetextgroup_show_correct {
      &:after {
        margin-left:15px;
        content: url('../images/correct-icon.png');
      }
    }

    span.mock_label {
      cursor : default;
    }
  }
}
