// Studio - Course Settings
// ====================
body.course.checklists {

  .content-primary, .content-supplementary {
    @include box-sizing(border-box);
    float: left;
  }

  .content-primary {
    width: flex-grid(9, 12);
    margin-right: flex-gutter();
  }

  // checklists - general
  .course-checklist {
    @extend .window;
    margin: 0 0 ($baseline*2) 0;

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

    // visual status
    .viz-checklist-status {
      @include text-hide();
      @include size(100%,($baseline/4));
      position: relative;
      display: block;
      margin: 0;
      background: $gray-l4;

      .viz-checklist-status-value {
        @include transition(width 2s ease-in-out .25s);
        position: absolute;
        top: 0;
        left: 0;
        width: 0%;
        height: ($baseline/4);
        background: $green;

        .int {
          @include text-sr();
        }
      }
    }
    // <span class="viz viz-checklist-status"><span class="viz value viz-checklist-status-value"><span class="int">0</span>% of checklist completed</span></span>

    // header/title
    header {
      @include clearfix();
      @include box-shadow(inset 0 -1px 1px $shadow-l1);
      margin-bottom: 0;
      border-bottom: 1px solid $gray-l3;
      padding: $baseline ($baseline*1.5);

      .checklist-title {
        @include transition(color .15s .25s ease-in-out);
        width: flex-grid(6, 9);
        margin: 0 flex-gutter() 0 0;
        float: left;

        .ui-toggle-expansion {
          @include transition(rotate .15s ease-in-out .25s);
          @include font-size(14);
          display: inline-block;
          vertical-align: middle;
          margin-right: ($baseline/2);
          color: $gray-l4;
        }

        &.is-selectable {
          cursor: pointer;

          &:hover {
            color: $blue;

            .ui-toggle-expansion {
              color: $blue;
            }
          }
        }
      }

      .checklist-status {
        @include font-size(13);
        width: flex-grid(3, 9);
        float: right;
        margin-top: ($baseline/2);
        text-align: right;
        color: $gray-l2;
        

        .icon-confirm {
          @include font-size(20);
          display: inline-block;
          vertical-align: middle;
          margin-left: ($baseline/2);
          color: $gray-l4;
        }

        .status-count {
          @include font-size(16);
          margin-left: ($baseline/4);
          margin-right: ($baseline/4);
          color: $gray-d3;
          font-weight: 600;
        }

        .status-amount {
          @include font-size(16);
          margin-left: ($baseline/4);
          color: $gray-d3;
          font-weight: 600;
        }
      }
    }

    // checklist actions
    .course-checklist-actions {
      @include clearfix();
      @include box-shadow(inset 0 1px 1px $shadow-l1);
      @include transition(border .15s ease-in-out .25s);
      border-top: 1px solid $gray-l2;
      padding: $baseline ($baseline*1.5);
      background: $gray-l4;

      .action-primary {
        @include green-button();
        float: left;

        .icon-add {
          @include font-size(12);
          display: inline-block;
          vertical-align: middle;
          margin-right: ($baseline/4);
        }
      }

      .action-secondary {
        @include font-size(14);
        @include grey-button();
        font-weight: 400;
        float: right;

        .icon-delete {
          @include font-size(12);
          display: inline-block;
          vertical-align: middle;
          margin-right: ($baseline/4);
        }
      }
    }

    // state - collapsed
    &.is-collapsed {

      header {
        @include box-shadow(none);

        .checklist-title {

          .ui-toggle-expansion {
            @include transform(rotate(-90deg));
            @include transform-origin(50% 50%);
          }
        }
      }

      .list-tasks {
        height: 0;
      }
    }

    // state - completed
    &.is-completed {
      
      .viz-checklist-status {

        .viz-checklist-status-value {
          width: 100%;
        }
      }

      header {

        .checklist-title, .icon-confirm {
          color: $green;
        }

        .checklist-status {
          
          .status-count, .status-amount, .icon-confirm {
            color: $green;          
          }
        }
      }
    }

    // state - not available
    .is-not-available {

    }
  }

  // list of tasks
  .list-tasks {
    height: auto;
    overflow: hidden;

    .task {
      @include transition(background .15s ease-in-out .25s);
      @include transition(border .15s ease-in-out .25s);
      @include clearfix();
      position: relative;
      border-top: 1px solid $white;
      border-bottom: 1px solid $gray-l5;
      padding: $baseline ($baseline*1.5);
      background: $white;
      opacity: 1.0;


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

      .task-input {
        display: inline-block;
        vertical-align: text-top;
        float: left;
        margin: ($baseline/2) flex-gutter() 0 0;
      }

      .task-details {
        display: inline-block;
        vertical-align: text-top;
        float: left;
        width: flex-grid(6,9);
        font-weight: 500;

        .task-name {
          @include transition(color .15s .25s ease-in-out);
          vertical-align: baseline;
          cursor: pointer;
          margin-bottom: 0;
        }   

        .task-description {
          @include transition(color .15s .25s ease-in-out);
          @include font-size(14);
          color: $gray-l2;
        }

        .task-support {
          @include transition(opacity .15s .25s ease-in-out);
          @include font-size(12);
          opacity: 0;
          pointer-events: none;
        }
      }

      .task-actions {
        @include transition(opacity .15s .25s ease-in-out);
        @include clearfix();
        display: inline-block;
        vertical-align: middle;
        float: right;
        width: flex-grid(2,9);
        margin: ($baseline/2) 0 0 flex-gutter();
        opacity: 0;
        pointer-events: none;
        text-align: right;

        .action-primary {
          @include blue-button;
          @include transition(all .15s);
          @include font-size(12);
          font-weight: 600;
          text-align: center;
        }

        .action-secondary {
          @include font-size(13);
          margin-top: ($baseline/2);
        }
      }

      // state - hover
      &:hover {
        background: $blue-l5;
        border-bottom-color: $blue-l4;
        border-top-color: $blue-l4;
        opacity: 1.0;

        .task-details {

          .task-support {
            opacity: 1.0;
            pointer-events: auto;
          }
        }

        .task-actions {
          opacity: 1.0;
          pointer-events: auto;
        }
      }


      // state - completed
      &.is-completed {
        background: $gray-l6;
        border-top-color: $gray-l5;
        border-bottom-color: $gray-l5;

        .task-name {
          color: $gray-l2;
        }

        .task-actions {

          .action-primary {
            @include grey-button;
            @include font-size(12);
            font-weight: 600;
            text-align: center;
          }
        }

        &:hover {
          background: $gray-l5;
          border-bottom-color: $gray-l4;
          border-top-color: $gray-l4;

          .task-details {
            opacity:1.0;
          }
        }
      }
    }
  }

  .content-supplementary {
    width: flex-grid(3, 12);
  }
}