// studio - views - container
// ==========================
// The container view renders xblocks at three levels: Page Level, Nesting Level, and Element Level.

// For containers rendered at the element level, the container is rendered in a way that allows the user to navigate to a separate container page for that container making its children populate the nesting and element levels.

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

// UI: container page view
.view-container {
  @extend %two-col-1;

  .wrapper-mast {

    .mast {
      border-bottom: none;
      padding-bottom: 0;

      .page-header {

        .page-header-title {
          @extend %t-title4;
          @extend %t-strong;
        }

        .is-editable {

          // TOOD: abstract this out into a Sass placeholder
          .incontext-editor-input {
            @include transition(box-shadow $tmg-f1 ease-in-out 0, color $tmg-f1 ease-in-out 0);
            @extend %t-title4;
            @extend %t-strong;
            width: 100%;
            background: none repeat scroll 0 0 $white;
            border: 0;
            box-shadow: 0 0 2px 2px $shadow inset;

            // STATE: focus
            &:focus {
              box-shadow: 0 0 2px 2px rgba($ui-action-primary-color-focus, 0.50) inset;
              color: $ui-action-primary-color-focus;
            }
          }
        }
      }

      &.has-actions {

        .nav-actions {

          .button {
            @extend %t-action3;
            @extend %t-regular;
            padding: ($baseline/4) ($baseline*.75);
          }
        }
      }
    }
  }

  .content-primary {

    .no-container-content {
      @extend %no-content;
      padding: ($baseline*1.5) ($baseline*2);

      // custom rules to reuse xblock validation styling in ui-well context
      .icon-warning-sign {
        display: none;
      }
    }

    .container-message {

      .message {
        border-radius: 3px 3px 0 0;
      }
    }

    // dragging bits
    .ui-sortable-helper {

      article {
        display: none;
      }
    }

    // drop target
    .component-placeholder {
      height: ($baseline*2.5);
      opacity: .5;
      margin: $baseline;
      background-color: $gray-l5;
      border-radius: ($baseline/2);
      border: 2px dashed $gray-l2;
    }
  }

  .content-supplementary {

    label {
      @extend %t-title8;
    }

    .bit-publishing {
      @extend %bar-module;

      // CASE: content is ready to be made live
      &.is-ready {
        @extend %bar-module-green;
      }

      // CASE: content is live
      &.is-live {
        @extend %bar-module-blue;
      }

      // CASE: content has warnings
      &.has-warnings {
        @extend %bar-module-yellow;
      }

      // CASE: content has erors
      &.has-errors {
        @extend %bar-module-red;
      }

      // CASE: content is staff only
      &.staff-only,
      &.is-staff-only {
        @extend %bar-module-black;

        &.is-scheduled .wrapper-release .copy {
          text-decoration: line-through;
        }
      }

      .bar-mod-content {
        border: 0;
        padding: ($baseline/2) ($baseline*.75) ($baseline/4) ($baseline*.75);

        .title {
          margin-bottom: ($baseline/10);
        }
      }

      .wrapper-last-draft {

        .date,
        .user {
          @extend %t-strong;
        }

        .user {
          @extend %cont-text-wrap;
        }
      }

      .wrapper-release {

        .release-date {
          @extend %t-strong;
        }

        .release-with {
          @extend %t-title8;
          display: block;
        }
      }

      .wrapper-visibility {

        .copy {
          @extend %t-strong;
          margin-bottom: ($baseline/10);
        }

        [class^="icon-"] {
          margin-left: ($baseline/4);
          color: $gray-d1;
        }

        .inherited-from {
          @extend %t-title8;
          display: block;
        }


      }

      .wrapper-pub-actions {
        padding: ($baseline*.75);

        .action-publish {
          @extend %btn-primary-blue;
          display: block;
          padding: ($baseline/4) ($baseline/2) ($baseline/3) ($baseline/2);
        }

        .action-discard {
          @extend %t-copy-sub1;
          display: block;
          margin-top: ($baseline/2);
          text-align: right;

          &.is-disabled {
            pointer-events: none;
            color: $gray-l1;
          }
        }
      }

    }

    // versioning widget
    .unit-publish-history {

      .wrapper-last-publish {
        margin-bottom: $baseline;
        padding: ($baseline*.75);
        background-color: $white;

        .copy {
          @extend %t-copy-sub2;
          color: $gray;
        }

        .date,
        .user {
          @extend %t-strong;
        }

        .user {
          @extend %cont-text-wrap;
        }
      }
    }

    // location widget
    .unit-location {
      @extend %bar-module;
      border-top: none;

      .wrapper-unit-id {

        .unit-id-value {
          @extend %cont-text-wrap;
          @extend %t-copy-sub1;
          display: inline-block;
          width: 100%;
        }

        .tip {
          @extend %t-copy-sub2;
          display: inline-block;
          margin: ($baseline/4) 0;
          color: $gray-l2;
        }
      }

      .wrapper-unit-tree-location {

        .item-title {
          @extend %cont-text-wrap;
        }
      }
    }
  }
}


