.course-index {
  @extend .sidebar;
  @extend .tran;
  @include border-right(1px solid $border-color-2);
  @include border-radius(3px, 0, 0, 3px);

  #open_close_accordion {
    display: none;
  }

  header {
    max-height: 47px;

    h2 {
      white-space: nowrap;
    }
  }

  div#accordion {
    width: auto;
    font-size: 14px;

    h3 {
      border-radius: 0;
      margin: 0;
      overflow: visible;
      font-size: 16px;

      &:first-child {
        border: none;
      }

      &:hover, &:focus {
        color: #666;
      }

      &.ui-state-hover, &.ui-state-focus {
        a {
          color: #666;
        }
      }

      &.ui-accordion-header {
        border-bottom: none;
        color: #000;

        a {
          border-radius: 0;
          box-shadow: none;
          @include padding-left(19px);
          color: $link-color;
        }

        &.ui-state-active {
          @extend .active;
          border-bottom: none;

          &:hover, &:focus {
            background: none;
          }
        }

        span.ui-icon {
          @include left(0);
          opacity: 0.3;
          background-image: url("/static/images/ui-icons_222222_256x240.png");  // jQuery UI sprite

          &.ui-icon-triangle-1-e {

            // CASE: left to right layout
            @include ltr {
              background-position: -32px -16px; // jQuery UI east arrow position
            }

           // CASE: right to left layout
           @include rtl {
              background-position: -96px -16px; // jQuery UI west arrow position
            }
          }
        }
      }
    }

    .chapter {
      width: 100% !important;
      @include box-sizing(border-box);
      padding: 11px 14px;
      @include linear-gradient(top, $sidebar-chapter-bg-top, $sidebar-chapter-bg-bottom);
      background-color: $sidebar-chapter-bg;
      box-shadow: 0 1px 0 #fff inset, 0 -1px 0 rgba(0, 0, 0, .1) inset;
      @include transition(background-color .1s linear 0s);

      &.is-open {
        background: #fff;
      }

      &:first-child {
        border-radius: 3px 0 0 0;
      }

      &:last-child {
        border-radius: 0 0 0 3px;
        box-shadow: 0 1px 0 #fff inset;
      }

      &:hover, &:focus {
        background-color: #fff
      }
    }

    ul.ui-accordion-content {
      background: transparent;
      border: none;
      border-radius: 0;
      margin: 0;
      padding: 9px 0 9px 9px;
      overflow: auto;
      width: 100%;

      li {
        border-bottom: 0;
        border-radius: 0;
        margin-bottom: 4px;

        a {
          background: transparent;
          border-radius: 4px;
          display: block;
          padding: 5px 36px 5px 10px;
          position: relative;
          text-decoration: none;

          p {
            font-weight: bold;
            font-family: $sans-serif;
            margin-bottom: 0;
            line-height: 1.3;

            &.subtitle {
              color: #666;
              font-size: 13px;
              font-weight: normal;
              display: block;
              margin: 0;

              &:empty {
                display: none;
              }
            }
          }

          &:hover, &:focus {
            background: rgba(0, 0, 0, .1);

            > a p {
              color: #333;
            }
          }

          &:active {
            box-shadow: inset 0 1px 14px 0 rgba(0,0,0, 0.1);

            &:after {
              opacity: 1.0;
              right: 15px;
            }
          }
        }

        &.active {
          font-weight: bold;

          &:after {
            content: '›';
            position: absolute;
            top: 50%;
            right: 20px;
            margin-top: -13px;
            font-size: 30px;
            font-weight: normal;
            color: #333;
            opacity: 0;
            @include transition(none);
          }

          > a {
            border: 1px solid $border-color-1;
            box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset;
            background: $sidebar-active-image;

            &:after {
              opacity: 1.0;
              right: 15px;
            }

            p {
              color: #333;
            }
          }

          span.subtitle {
            font-weight: normal;
          }
        }

        &.graded {
         > a {
           > img {
             margin: auto;
             position: absolute;
             top: 0;
             bottom: 0;
             right: 7px;
           }
          }

          &.active > a {
            background: linear-gradient(to bottom, #e6e6e6, #d6d6d6);
          }
        }
      }
    }
  }
}
