// studio - views - course static pages
// ====================

.view-static-pages {

  .new-static-page-button {
    @include grey-button;
    display: block;
    text-align: center;
    padding: 12px 0;
  }

  .nav-introduction-supplementary {

    .icon-question-sign {
      display: inline-block;
      vertical-align: baseline;
      margin-right: ($baseline/4);
    }

  }

  .unit-body {
    padding: 0;

    .details {
      display: block !important;

      h2 {
        margin: 0 0 5px 0;
      }
    }

    .wrapper-component-editor {
      z-index: 9999;
      position: relative;
      background: $lightBluishGrey2;
    }

    .component-editor {
      @include edit-box;
      box-shadow: none;
      display: none;
      padding: 0;
      border-radius: 2px 2px 0 0;

      //Overrides general edit-box mixin
      .row {
        margin-bottom: 0px;
      }

      // This duplicates the styling from Unit page editing
      .module-actions {
        box-shadow: inset 0 1px 1px $shadow;
        padding: 0px 0 10px 10px;
        background-color: $gray-l6;

        .save-button {
        margin: ($baseline/2) 8px 0 0;
        }
      }
    }
  }

  .component-editor {
    border: none;
    border-radius: 0;
  }

  .components > li {
    margin: 0;
    border-radius: 0;

    &.new-component-item {
      background: transparent;
      border: none;
      box-shadow: none;
    }
  }

  .component {
    position: relative;
    border: 1px solid $mediumGrey;
    border-top: none;

    &:first-child {
      border-top: 1px solid $mediumGrey;
    }

    &:hover {
      border: 1px solid $mediumGrey;
      border-top: none;

      &:first-child {
        border-top: 1px solid $mediumGrey;
      }

      .drag-handle {
        background: url(../img/drag-handles.png) center no-repeat #fff;
      }
    }

    .drag-handle {
      position: absolute;
      display: block;
      top: 0;
      right: 0;
      z-index: 11;
      width: 35px;
      height: 100%;
      border: none;
      background: url(../img/drag-handles.png) center no-repeat #fff;

      &:hover {
        background: url(../img/drag-handles.png) center no-repeat #fff;
      }
    }

    // uses similar styling as assets.scss, unit.scss
    .wrapper-component-action-header {
      @include box-sizing(border-box);
      position: absolute;
      width: 100%;
      padding: $baseline/4 $baseline/2;
      top: 0;
      left: 0;
    }

    .component-header {
      display: none;
    }

    .component-actions {
      display: inline-block;
      float: right; 
      margin-right: $baseline*2;
      padding: 8px 0px;
      vertical-align: middle;
      text-align: center;

      .action-item {
        display: inline-block;
        margin: ($baseline/4) 0 ($baseline/4) ($baseline/4);

        .action-button {
          @include transition(all $tmg-f2 ease-in-out 0s);
          display: block;
          padding: 0 $baseline/2;
          width: auto;
          height: ($baseline*1.5);
          border-radius: 3px;
          color: $gray-l1;

          &:hover {
            background-color: $blue;
            color: $gray-l6;
          }

          .action-button-text {
            padding-left: 1px;
            vertical-align: bottom;
            line-height: 17px;
          }

          &.delete-button:hover {
            background-color: $gray-l1;
          }
        }

        [class^="icon-"] {
          display: inline-block;
          vertical-align: bottom;
        }

        &.action-duplicate {
          display: none;
        }
      }
    }
  }

  .component.editing {
    border-left: 1px solid $mediumGrey;
    border-right: 1px solid $mediumGrey;

    .xblock-student_view {
      display: none;
    }
  }

  .new .xblock-student_view {
    background: $yellow;
  }

  .xblock-student_view {
    @include transition(background-color $tmg-s3 linear 0s);
    padding: 20px 20px 22px;
    font-size: 24px;
    font-weight: 300;
    background: #fff;
  }

  .static-page-item {
    position: relative;
    margin: 10px 0;
    padding: 22px 20px;
    border: 1px solid $darkGrey;
    border-radius: 3px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .1);

    .page-name {
      font-size: 19px;
      font-weight: 700;
    }

    .item-actions {
      margin-top: 19px;
      margin-right: 12px;
    }
  }
}

.edit-static-page {
  .main-wrapper {
    margin-top: 40px;
  }

  .static-page-details {
    @extend %ui-window;
    padding: 32px 40px;

    .row {
      border: none;
    }
  }

  .page-display-name-input {
    width: 100%;
    font-size: 20px;
  }

  .page-contents {
    @include box-sizing(border-box);
    @include linear-gradient(top, rgba(255, 255, 255, 0), rgba(255, 255, 255, .3));
    width: 100%;
    height: 360px;
    padding: 15px;
    border: 1px solid #b0b6c2;
    border-radius: 2px;
    background-color: #edf1f5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .1) inset;
    font-family: Monaco, monospace;
    font-size: 13px;
    color: #3c3c3c;
    outline: 0;
  }
}

