$border-color: #C8C8C8;

// repeated extends - needed since LMS styling was referenced
.block-link {
  border-left: 1px solid lighten($border-color, 10%);
  display: block;

  &:hover {
    background: none;
  }
}

.topbar {
  @include clearfix();
  border-bottom: 1px solid $border-color;

  @media print {
    display: none;
  }

  a {
    &.block-link {
      border-left: 1px solid lighten($border-color, 10%);
      display: block;

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

// ====================

nav.sequence-nav {
  // TODO (cpennington): This doesn't work anymore. XModules aren't able to
  // import from external sources.
  @extend .topbar;
  margin: -4px 30px 30px 30px;
  position: relative;
  border-bottom: none;

  .left-shadow {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 20px;
    height: 46px;
    @include linear-gradient(left, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0));
    background-color: transparent;
    pointer-events: none;
  }

  .right-shadow {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 9999;
    width: 20px;
    height: 46px;
    @include linear-gradient(right, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0));
    background-color: transparent;
    pointer-events: none;
  }

  .sequence-list-wrapper {
    position: relative;
    z-index: 99;
    border: 1px solid #ccc;
    height: 44px;
    margin: 0;
    @include linear-gradient(top, #ddd, #eee);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1) inset;
  }

  ol {
    position: absolute;
    top: 0;
    left: 0;
    @include box-sizing(border-box);
    display: table;
    height: 100%;
    margin: 0;
    padding: 0 10px;
    width: 100%;

    a {
      @extend .block-link;
    }

    li {
      display: table-cell;
      min-width: 20px;

      a {
        width: 100%;
        height: 42px;
        margin: 0;
        background-position: center 14px;
        background-repeat: no-repeat;
        border: 1px solid transparent;
        cursor: pointer;
        display: block;
        padding: 0;
        position: relative;
        @include transition(none);
        outline: 0;

        &:focus {
          outline: 0;
        }

        &:hover {
          background-color: #fff;
          background-repeat: no-repeat;
          background-position: center 14px;
        }

        &.active {
          background-color: #fff;
          z-index: 9;

          // &:after {
          //   content: '▲';
          //   position: absolute;
          //   top: 28px;
          //   left: 50%;
          //   z-index: 9999;
          //   margin-left: -5px;
          //   font-size: 12px;
          //   color: #aaa;
          // }

          &:hover {
            background-color: #fff;
            background-repeat: no-repeat;
            background-position: center 14px;
          }
        }

        //video
        &.seq_video {
          &.inactive {
            background-image: url('../images/sequence-nav/video-icon-normal.png');
          }

          &.visited {
            background-image: url('../images/sequence-nav/video-icon-visited.png');
          }

          &.active {
            @extend .active;
            background-image: url('../images/sequence-nav/video-icon-current.png');
          }
        }

        //other
        &.seq_other {
          &.inactive {
            background-image: url('../images/sequence-nav/document-icon-normal.png');
          }

          &.visited {
            background-image: url('../images/sequence-nav/document-icon-visited.png');
          }

          &.active {
            background-image: url('../images/sequence-nav/document-icon-current.png');
          }
        }

        //vertical & problems
        &.seq_vertical, &.seq_problem {
          &.inactive {
            background-image: url('../images/sequence-nav/list-icon-normal.png');
          }

          &.visited {
            background-image: url('../images/sequence-nav/list-icon-visited.png');
          }

          &.active {
            background-image: url('../images/sequence-nav/list-icon-current.png');
          }

          &.progress-none {
            background-image: url('../images/sequence-nav/list-unstarted.png');
          }

          &.progress-some, &.progress-in_progress {
            background-image: url('../images/sequence-nav/list-unfinished.png');
          }

          &.progress-done {
            background-image: url('../images/sequence-nav/list-finished.png');
          }
        }

        p {
          background: #333;
          color: #fff;
          font-family: $sans-serif;
          line-height: lh();
          left: 0px;
          opacity: 0.0;
          padding: 6px;
          position: absolute;
          top: 48px;
          text-shadow: 0 -1px 0 #000;
          @include transition(all .1s $ease-in-out-quart 0s);
          white-space: pre;
          z-index: 99;

          &:empty {
            background: none;

            &::after {
              display: none;
            }
          }

          &::after {
            background: #333;
            content: " ";
            display: block;
            height: 10px;
            left: 18px;
            position: absolute;
            top: -5px;
            @include transform(rotate(45deg));
            width: 10px;
          }
        }

        &:hover {
          p {
            display: block;
            margin-top: 4px;
            opacity: 1.0;
          }
        }
      }
    }
  }

  ul {
    position: absolute;
    top: 0;
    list-style: none !important;
    height: 100%;
    right: 0;
    top: 0;
    width: 100%;
    margin: 0;
    border: none;

    li {
      position: absolute;
      margin-bottom: 0;
      height: 44px;
      width: 70px;
      border: 1px solid #ccc;
      @include linear-gradient(top, #eee, #ddd);
      box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset;

      &.prev, &.next {

        a {
          background-position: center;
          background-repeat: no-repeat;
          display: block;
          height: 34px;
          width: 40px;
          text-indent: -9999px;
          @include transition(all .2s $ease-in-out-quad 0s);
          outline: 0;

          &:focus {
            outline: 0;
          }

          &:hover {
            opacity: 0.5;
          }

          &.disabled {
            cursor: normal;
            opacity: 0.4;
          }
        }
      }

      &.prev {
        left: -40px;
        border-radius: 35px 0 0 35px;
        a {
          background-image: url('../images/sequence-nav/previous-icon.png');
          background-position: center 15px;
        }
      }

      &.next {
        right: -40px;
        border-radius: 0 35px 35px 0;

        a {
          margin-left: 30px;
          background-image: url('../images/sequence-nav/next-icon.png');
          background-position: center 15px;
        }
      }
    }
  }

  body.touch-based-device & ol li a:hover p {
    display: none;
  }
}

div.seq_contents {
  display: none;
}

nav.sequence-bottom {
  margin: lh(2) 0 0;
  text-align: center;

  ul {
    @include clearfix();
    @include inline-block();

    li {
      float: left;
      width: 50px;
      height: 44px;
      border: 1px solid #ccc;
      @include linear-gradient(top, #eee, #ddd);
      box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset;

      &.prev, &.next {
        margin-bottom: 0;

        a {
          background-position: center center;
          background-repeat: no-repeat;
          border: none;
          display: block;
          padding: lh(.5) 4px;
          text-indent: -9999px;
          @include transition(all .2s $ease-in-out-quad 0s);
          outline: 0;

          &:hover {
            opacity: 0.5;
            background-position: center 15px;
          }

          &.disabled {
            opacity: 0.4;
          }

          &:focus {
            outline: 0;
          }
        }
      }

      &.prev {
        border-radius: 35px 0 0 35px;

        a {
          background-image: url('../images/sequence-nav/previous-icon.png');
          background-position: center 15px;
        }
      }

      &.next {
        border-radius: 0 35px 35px 0;
        border-left: none;

        a {
          background-image: url('../images/sequence-nav/next-icon.png');
          background-position: center 15px;
        }
      }
    }
  }
}

.xmodule_VerticalModule ol.vert-mod > li ul.sequence-nav-buttons {
  list-style: none !important;
}

.xmodule_SequenceModule nav.sequence-bottom ul li.next a,
.xmodule_SequenceModule nav.sequence-bottom ul li.prev a {
  outline: 0;

  &:focus {
    outline: 0;
  }
}

