// utilities: developer
// ====================
// NOTE: use this area for any developer-needed or created styling that needs to be refactored into patterns or visually polished. Please list any template/view that your styles reference when definining them (example below):
// Views: New Prototype View
// --------------------
// .crazy-new-feature {
//   background: transparent;
// }
@import "mixins";

.chart-info {
  @extend .pull-left;
  padding-left: $padding-small-horizontal;
  padding-top: $padding-large-vertical;
  color: $edx-blue;
  font-size: $font-size-small;

  // controls in the chart info section are floated left, so push the menu
  // down a bit so it doesn't appear on top of the control
  .dropdown-menu {
    top: 20px;
  }
}

button.chart-info {
  padding-left: 0;
  padding-top: 0;
  border: none;
}

.chart-tooltip {
  float: right;
  padding-right: $padding-small-horizontal;
  padding-top: $padding-large-vertical;
}

.analytics-chart-container {
  background-color: white;
  border: $description-border-color 1px solid;

  .analytics-chart {
    height: 305px; // Update the height of the graph in trends-view.js to be this height minus 5px.
    padding-top: $padding-large-vertical;
  }

  // shorten the chart so just a message (e.g. error message) is displayed
  .message-only-chart {
    height: inherit; // allows container height to adjust for long messages
    min-height: 38px;
  }

  .nvd3 {
    .nv-axis {

      &.nv-y {
        fill: $edx-gray;

        .nv-axislabel {
          fill: $edx-blue;
        }
      }

      &.nv-x {
        text {
          fill: $edx-gray-l1;
          font-size: $font-size-small;
        }

        .x-axis-background {
          fill: $gray-d2;
        }
      }
    }
  }
}

%vertical-align {
  position: relative;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  transform: translateY(-50%);
}

.loading-container {
  @extend %vertical-align;
}

.chart-message-container {
  top: $padding-large-horizontal * 2;

  p {
    padding-bottom: $padding-large-horizontal;
  }
}

.alert-error-container {
  @include alert-container($alert-error-color);
}

.alert-info-container {
  @include alert-container($alert-info-color);
}

.white-background {
  background-color: white;
}

// Ensure that the map fits for different screens sizes
// --------------------
.world-map {
  position: relative;
  margin: 0 auto;

  width: 100%;
  height: 450px;

  background-color: white;
  border: $edx-gray 1px solid;

  .chart-tooltip {
    position: absolute;
    right: 0;
  }
}

@media (max-width: $screen-md) {
  .world-map {
    height: 250px;
  }
}

@media (max-width: $screen-sm) {
  .world-map {
    height: 300px;
  }
}

// --------------------

.dataTables_length {
  label {
    // this gives the length selection component of the data table some breathing room
    padding-top: $padding-large-vertical;
  }
}

.navbar-nav {

  .nav-section.active {
    color: $navbar-default-link-active-color;
    border-bottom: 6px solid $navbar-default-link-active-color;
  }

  .nav-section {
    @include a-background(transparent);
  }
}

// lens navigation consists of a drop down and the lens sections in a navigation
$lens-background-color: $gray-d2;
$lens-nav-text-color: $gray-l1;
$lens-nav-height: 55px;
$lens-box-model: border-box;

.lens-nav {
  background-color: $lens-background-color;
  min-height: $lens-nav-height;
  border: 0px;
  margin-bottom: 0px;
  -moz-box-sizing: $lens-box-model;
  -webkit-box-sizing: $lens-box-model;
  box-sizing: $lens-box-model;

  // aligns the navbar with the logo
  ul.navbar-nav {
    margin-left: 15px;
  }

  .navbar-nav {

    .dropdown {
      padding-right: 10px;

      a {
        text-transform: uppercase;
        color: $navbar-default-link-active-color;
      }

      // this prevents the drop down from overlapping with the menu
      .dropdown-menu {
        top: 100%;

        li > a {
          // the default size is a big large
          min-height: 20px;
        }
      }
    }

    // style the nav secondary items
    li > a {
      color: $lens-nav-text-color;
      min-height: $lens-nav-height;
      padding-top: 18px;
      padding-bottom: 0px;
    }

    .nav-section {
      @include a-background(transparent);
    }

  }
}

.tertiary-nav {

  padding-left: $padding-large-horizontal;

  li > a {
    color: $lens-nav-text-color;
    padding-top: 0px;
    padding-bottom: $padding-small-vertical;

    // use darkest gray when hovering over sub-lens nav (e.g. age, education, gender)
    &:hover {
      color: $edx-gray-d2
    }
  }

  li.active > a {
    color: $navbar-default-link-active-color;
  }

  .section-heading {
    margin-top: 0;
    margin-bottom: 0;

    .section-heading-note {
      margin-top: 0;
    }
  }
}

.course-list {
  margin-top: 10px;
  margin-bottom: 15px;
  background: white;
  border: 1px solid $edx-gray;
  border-width: 0 0 1px 1px;

  .course {
    padding: 15px;
    border: 1px solid $edx-gray;
    border-width: 1px 1px 0 0;

    .course-name {
      font-size: $font-size-large;
    }

    .course-key {
      color: $edx-gray;
    }
  }
}

body.view-course-list {
  #content {
    margin-top: 25px;

    .view-head {
      color: $edx-gray-d2;
      margin-bottom: 0;
    }

    .intro-text {
      color: $edx-gray-d1;
    }

    .view-intro {
      .lead {
        font-size: $font-size-base;
      }
    }

    .info-text {
      color: $edx-gray;
      font-size: $font-size-small;
    }

    .help-msg {
      font-size: $font-size-small;
      margin-bottom: 50px;
    }
  }
}

// DataTables
// align the headings with the text in the rows
table.dataTable thead > tr > th {
  padding-left: 6px;
  padding-right: 6px;
}

// Icon spacing and position the arrows next to the header labels
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
  position: relative;
  top: 0px;
  right: 0px;
  display: inline;
  padding-left: 8px;
  font-family: FontAwesome;
  color: $edx-gray;
}

//Sort Icon Color
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
  color: $edx-blue;
}

.page-title-outer {
  .page-subtitle {
    @extend .text-muted;
    font-size: ($font-size-h1 * 0.5);

    @media (min-width: $screen-md-min) {
      text-align: right;
      margin-top: ($line-height-computed * 1.5);
    }
  }
}

.data-information-message {
  @extend .small;
  padding-top: $padding-base-vertical;
  margin-top: $padding-large-vertical;
}

.data-update-message {
  @extend .data-information-message;
  border-top: $edx-gray-l1 1px solid;
}

.announcement-container {
  background-color: $gray-d2;
  border-bottom: solid 1px $edx-blue;
  padding-bottom: $padding-large-vertical * 1.5;
  padding-top: $padding-large-vertical;
  color: $gray;
  font-size: $font-size-small;

  .dismiss {
    float: right;
    margin-right: $padding-small-horizontal;
    cursor: pointer;
    font-size: $font-size-large;
  }

  .icon {
    color: $edx-blue;
    text-align: right;
    font-size: $font-size-h2;
  }

  h1 {
    color: $white;
    font-size: $font-size-large;
    padding-bottom: $padding-small-vertical;
  }
}

.table.course-overview {
  th, td {
    border-top: none;
  }

  th {
    font-weight: normal;
    white-space: nowrap;
  }

  td {
    width: 99%; // Expand as much as possible
  }
}

.course-external-tools {
  list-style: none;
  padding: 0;

  li {
    padding: 8px 10px;
  }

  .ico { margin-right: 6px; }
}

.course-home-table-outer {
  header.heading-outer {
    display: table;
    height: $font-size-large * 4;
    padding-bottom: $padding-large-vertical;
    width: 100%;
    @extend .text-center;

    .heading {
      display: table-cell;
      vertical-align: bottom;
      font-size: $font-size-large;
      color: $edx-blue;

      // increase line height for med-small screens so headers are same level for long lines
      @media (max-width: $screen-md-max) and (min-width: $screen-sm-min) {
        min-height: $font-size-large * 3.5;
      }
    }
  }

  .course-home-table {
    border: 1px solid $edx-gray-l1;
    border-width: 0 0 1px 1px;
    margin-bottom: $padding-large-vertical;

    .item {
      background: white;
      padding: $padding-large-vertical;
      border: 1px solid $edx-gray-l1;
      border-width: 1px 1px 0 0;

      &.name {
        color: $edx-gray;
        font-size: $font-size-large;
      }

      .title {
        margin-bottom: $padding-base-vertical;
      }

      .breadcrumbs {
        color: $edx-gray;
        font-size: $font-size-small;
      }
    }
  }
}

.masthead {

  .cover-container {
    width: 100%;
    display: block;
    position: relative;
    overflow: hidden;
    border-top: 4px solid $edx-blue-s1;
    height: 100%;

    .cover {
      // center cover image
      display: block;
      margin-left: auto;
      margin-right: auto;
      height: 400px;

      // cover image will be smaller on smaller displays
      @media (max-width: $screen-md-min) {
        height: 200px;
      }

    }
  }

  .masthead-heading {
    @include dark-background;
    text-align: center;
    font-size: $font-size-large * 1.25;
    font-weight: 300;
    padding-top: $padding-large-vertical + 9px;
    padding-bottom: $padding-large-vertical;
  }

  // default margins cause the masthead to be vertically scrollable
  &.row {
    margin-left: -1px;
    margin-right: -1px;
  }

}

.landing {

  p {
    color: $gray-l2;
  }

  // match the login button style to that of the LMS
  button {
    text-transform: uppercase;
    color: $navbar-default-link-active-color;
    padding: 4px 45px;
    font-weight: 600;
    font-size: $font-size-large;
    border-radius: 5px;
    border: 3px solid #e6e6e6;

    &:hover {
      border-color: $navbar-default-link-active-color;
      color: $gray-d2;
      background: white;
      @include transition(color 0.25s 0 ease);
    }
  }

  .login-button-container {
    padding-top: 25px;
  }

  // into tagline section directly below the cover image
  .intro-block {
    padding-top: $padding-large-horizontal * 3;
    margin-bottom: $padding-large-horizontal * 2 + 5px;
  }

  .lens-question {
    font-size: $font-size-large;
    color: $edx-blue-s1;
    min-height: 60px;
    text-align: center;
    vertical-align: bottom;

    // adjust the display when the screen is small so that the lens questions are
    // displayed stacked
    @media (max-width: $screen-md-min) {
      min-height: inherit;
      padding-top: $padding-large-horizontal * 1.5;
      padding-bottom: $padding-large-horizontal;
    }
  }

  .lens-summary {
    @extend %ui-box;
    h1 {
      font-size: $font-size-large;
      text-align: center;
      font-weight: 300;
      color: $edx-gray;
    }

    p {
      color: $edx-gray;
    }
  }

  .audience-message {
    margin-bottom: $padding-large-horizontal * 2;

    p {
      color: $gray;
    }
  }

  .audience-message-module {
    h1 {
      font-size: $font-size-base;
      font-weight: bold;
    }

  }

}

// cap the size of the dropdown menus (useful for long question/problem names)
.dropdown-menu {
  .truncate {
    max-width: 450px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

// ensures tooltips won't span the width of the screen and wraps tooltip title
.nv-pointer-events-none {
  max-width: 500px;
  text-align: left;
  white-space: normal;
}

// description and controls at the top and bottom of the chart
.chart-marginals {
  border: $description-border;
  padding: $padding-small-horizontal 0;
  background-color: $white;

  p {
    // shifts it down so that it's even with the adjacent button
    padding-top: 8px;
  }

  a.disabled {
    @extend disabled-link;
  }
}

.module-meta {
  @extend .chart-marginals;
  border-bottom: none;
}

// for the next/previous buttons that sit at the bottom of the chart
.module-controls {
  @extend .chart-marginals;
  border-top: none;
}

.module-preview-disclosure {
  // the video preview height can be variable, so use media queries to mimic height changes
  .video-preview {
    width: 100%;
    height: 700px;
    border: 0;

    @media screen and (min-width: $screen-sm-min) {
      height: 670px;
    }

    @media screen and (min-width: $screen-md-min) {
      height: 770px;
    }
  }

  .disclosure-toggle {
    // moving the text down just a tad so that it's in line with the next/previous buttons
    padding-top: 8px;
  }

  .disclosure-target {
    // initially collapsed
    display: none;
  }

  #module-loading {
    padding-top: $padding-large-vertical;
  }
}

.grading-policy {
  a {
    color: inherit;
  }

  .tooltip-container {
    text-align: right;

    .chart-tooltip {
      float: none;
      padding: 0 0 $padding-large-vertical;
    }
  }

  .policy-item {
    @extend .text-center;
    // float the policy item so that it's all on one line
    @extend .pull-left;

    // adds padding to the inside so that the policy items don't touch
    padding: 5px;

    .policy-item-box {
      background-color: $edx-blue-l1;
      margin-bottom: $padding-base-vertical;
      height: 50px;
      line-height: 50px;

      .weight {
        display: inline-block;
        vertical-align: middle;
        font-weight: bold;
      }
    }

    .type {
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }
  }
}

.static-legend {
  .nvd3 .nv-legend .nv-series {
    cursor: default;
  }
}

.graded-content-nav {
  @extend .tertiary-nav;

  margin-bottom: -$padding-base-vertical;

  .navbar-nav {

    .nav-section.active {
      border-bottom: none;
    }

    .active .dropdown {
      color: $navbar-default-link-active-color;

      &:hover {
        color: inherit;
      }
    }

    .dropdown, .separator {
      padding: $nav-link-padding;
      color: $edx-gray;
    }

    .dropdown {
      cursor: pointer;

      &:hover {
        color: $edx-gray-d2
      }

      .dropdown-menu {
        margin-top: -1px;
        margin-left: -1px;

        li > a {
          color: $dropdown-link-color;
          padding-bottom: $padding-small-vertical;

          &:hover {
            // Override the transparent background set by the .navbar-nav selector.
            background: $dropdown-link-hover-bg;
          }
        }

        > .disabled > a {
          @include disabled-link;
        }
      }
    }
  }
}

// Learner App
.learners-app-container {
  margin-bottom: $padding-large-horizontal;
}

.learner-roster {

  .learners-active-filters {
    .active-filters {
      display: inline-block;
    }
  }

  th {

    font-weight: 600;

    a {
      // update header colors
      color: $text-color;
    }

    i {
      // makes the sort icons gray
      color: $gray;
      display: inline;
    }

  }

  .learner-engagement-cell {
    text-align: right;
  }

  .learners-table-controls {
    padding-bottom: 20px;

    .learners-search {
      .wrapper-search-input {
        position: relative;

        .clear {
          position: absolute;
          right: 0px;
          top: 0px;
          z-index: 99;
          color: $edx-gray;

          &:hover {
            color: $edx-gray-d2;
          }
        }
      }

      .search {
        margin-left: 5px;
      }
    }
  }

  .learner-engagement-cell {
    // gives the numbers in the engagement table a bit more weight
    font-weight: 600;
  }

  // color-blind safe colors for differentiating engagement categories
  $rank-bottom-color: rgb(217,95,2);
  $rank-top-color: rgb(27,158,119);
  .learner-cell-rank-bottom {
    color: $rank-bottom-color;
  }

  .learner-cell-rank-top {
    color: $rank-top-color;
  }

  .backgrid-paginator {

    ul {
      // remove default padding around the paging controls
      padding: 0;
    }

  }

  .activity-date-range {
    color: $edx-gray-d2;

    // padding keeps the element from shifting when active filters are selected
    padding-top: $padding-large-vertical * 1.5;
    padding-bottom: $padding-large-vertical * 1.5;

    @media (min-width: $screen-sm-min) {
      float: right;
    }

  }

}

// styles for the learner details summary
.learner-summary-container {

  .learner-username {
    font-size: $font-size-large;
  }

  .learner-name {
    font-size: $font-size-large * 1.5;
  }

  // e.g. "enrollment" or "cohort"
  .learner-summary-field {
    color: $gray-l1;
  }

}

.learner-detail-container {
  // this heading will be replaced with a tab in the future
  .bordered.fake-tab {
    border-bottom-width: 3px;
  }
}
