/*
 * Copyright (C) 2015 - present Instructure, Inc.
 *
 * This file is part of Canvas.
 *
 * Canvas is free software: you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License as published by the Free
 * Software Foundation, version 3 of the License.
 *
 * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
 * details.
 *
 * You should have received a copy of the GNU Affero General Public License along
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 */

// Shared between:
// - compiler-course_settings.scss
// - compiler-assignments.scss
// - compiler-grading_standards.sass
// must have @import base/environment loaded within compiler for this to work

#standards {
  .grading_standard {
    border-bottom: 1px dotted #ccc;
    margin-bottom: 25px;
    .links {
      opacity: 0.5;
    }
    &:hover {
      .links {
        opacity: 1;
      }
    }
    .standard_title {
      font-weight: bold;
      font-size: 1.2em;
    }
  }
  &.react_grading_standards {
    .cancel_button {
      margin-#{direction(right)}: 6px;
    }
  }
}

.grading_standard {
  .read_only {
    display: none;
  }
  .editing_box {
    display: none;
  }
  .editing_td {
    display: none;
  }
  .editing_tr {
    display: none;
  }
  .min_score, .max_score {
    width: 100px;
  }
  &.editing {
    .displaying {
      display: none;
    }
    .editing_box {
      display: block;
    }
    td.editing_box {
      display: table-cell;
    }
    tr.editing_box {
      display: table-row;
    }
    .standard_title div {
      float: direction(left);
    }
  }
  &.react_grading_standard {
    .alert-message:focus {
      outline: none;
    }
    .links {
      float: direction(right);
    }
    .disabled-buttons {
      float: direction(right);
      opacity: 0.5;
    }
    .cannot-manage-notification {
      font-weight: normal;
      margin-#{direction(left)}: 4px;
    }
    .icon-edit {
      margin-#{direction(right)}: 5px;
    }
    .form-actions {
      background-color: transparent;
      margin-bottom: 0px;
      padding-bottom: 0px;
    }
    table {
      width: 100%;
      &.grading_standard_data {
        margin-bottom: 20px;
      }
    }
  }
}

.grading_standard_headers {
  .icon_row_cell {
    width: 5%;
  }
  .name_row_cell {
    width: 30%;
    text-align: #{direction(left)};
  }
  .range_row_cell {
    width: 60%;
    text-align: #{direction(left)};
  }
}

.grading_standard_row {
  &.react_grading_standard_row {
    input {
      margin-top: 5px;
      margin-bottom: 5px;
    }
    .row_cell {
      padding: 2px;
      width: 30%;
      .range_to {
        padding-#{direction(right)}: 5px;
      }
    }
    .delete_row_button {
      float: #{direction(right)};
    }
    &.border_below {
      border-bottom: dashed;
      border-bottom-width: 2px;
      border-bottom-color: #999;
    }
  }
}

.standard_name {
  width: 100px;
}
.standard_value {
  width: 37px;
}

.add_standard_button {
  margin-bottom: 10px;
}
