@charset "UTF-8";

$breadcrumbText:                     rgb(102, 102, 102);      // #666666
$bundleCaratColor:                   rgb(205, 205, 205);      // #CDCDCD - down arrow to the right of bundle name in menu
$bundleListLoadingBackground:        rgb(45, 52, 59);         // #2D343B - backdrop shows when bundle lists make paginated requests
$bundleListLoadingOpacityBackground: rgba(45, 52, 59, .85);   // #2D343B
$bundleListLoadingText:              rgb(226, 226, 226);      // #E2E2E2
$bundlePickerText:                   rgb(70, 70, 70);         // #464646
$bundleViewportBorder:               rgb(70, 70, 70);         // #464646 - used for all inner borders (fallback color)
$bundleViewportOpacityBorder:        rgba(70, 70, 70, .2);    // #464646 - all inner borders, rgba version for supported browsers
$changeAreaBackground:               rgb(219, 222, 225);      // #DBDEE1
$extenderColor:                      rgb(242, 242, 242);      // #F2F2F2 - up arrow from dropdown towards carat
$listItemHover:                      rgb(242, 242, 242);      // #F2F2F2
$listItemSelected:                   rgb(227, 227, 227);      // #E3E3E3
$listItemSelectedText:               rgb(45, 52, 59);         // #2D343B
$menuBundleTextColor:                rgb(51, 51, 51);         // #666666 - bundle name in the header that shows current bundle
$navigatorBackground:                rgb(255, 255, 255);      // #FFFFFF
$shellBackground:                    rgb(242, 242, 242);      // #F2F2F2

.bundle-picker {
  cursor: pointer;

  .bundle-carat {
    display: inline-block;
    margin-left: 5px;
    vertical-align: top;
    margin-top: 15px;
    height: 0;
    width: 0;
    border-width: 8px;
    border-style: solid;
    border-color: $bundleCaratColor transparent transparent;
  }

  .extender {
    position: absolute;
    display: block;
    top: -16px;
    right: 5px;
    height: 0;
    width: 0;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent $extenderColor;
  }
}

.bundle-picker-control-modal {
  position: relative;
  z-index: $bundle-picker-control-z-index;
  width: 500px;
  min-height: 300px;

  &.modal-dialog {
    margin: 100px auto 0;
  }

  .modal-content {
    background-color: transparent;
    border: none;
  }

  .bundle-picker-modal-close {
    position: absolute;
    top: -40px;
    right: -10px;
  }

  .modal-body {
    padding: 0;
  }
}

.bundle-picker-control {
  @include box-shadow(-2px 2px 4px #333);
  @include box-sizing(border-box);
  @include border-radius(4px);
  width: 100%;
  height: 100%;
  background-color: $navigatorBackground;

  .search {
    position: relative;
    width: 100%;
    height: 42px;
    line-height: 40px;
    padding: 0 6px 0 30%;
    border-bottom-color: $bundleViewportBorder;
    border-bottom: 1px solid $bundleViewportOpacityBorder;
    background-color: $shellBackground;
    @include box-sizing(border-box);
    @include border-radius(4px 4px 0 0);

    label {
      display: block;
      position: absolute;
      max-width: 30%;
      left: 0;
      top: 0;
      padding-left: 10px;
      font-size: 18px;
      font-weight: bold;
      color: $bundlePickerText;
      @include localized-line;
      @include box-sizing(border-box);
    }

    .bundle-picker-search {
      display: inline;
      line-height: normal;
      width: 100%;
      padding: 6px 26px 6px 6px;
      vertical-align: middle;
      @include box-sizing(border-box);
    }

    .bundle-picker-magnifier {
      position: absolute;
      right: 13px;
      top: 12px;
      height: 18px;
      width: 18px;
    }
  }

  .bundle-navigator {
    height: 100%;
    width: 100%;
    border: none;
    padding: 0;
    @include border-radius(4px);

    .osicon {
      color: $medium-dark-grey;
    }

    .osicon:hover {
      color: $medium-dark-grey;
    }

    .search-and-viewport {
      border-top-color: $bundleViewportBorder;
      position: relative;

      .bundle-page-loading-indicator {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 100%;
        text-align: center;
        color: $bundleListLoadingText;
        font-weight: bold;
        background-color: $bundleListLoadingBackground;
        background-color: $bundleListLoadingOpacityBackground;

        .srm-throbber {
          position: relative;
        }

        .bundle-loading-text {
          width: 60%;
          margin: 0 auto;
          font-size: 1.3rem;
        }
      }
    }
  }

  .bundle-viewport-wrap {
    position: relative;
    width: 100%;
    height: 175px;
    overflow: hidden;
    border-top-color: $bundleViewportBorder;
    border-top: 1px solid $bundleViewportOpacityBorder;
    border-bottom-color: $bundleViewportBorder;
    border-bottom: 1px solid $bundleViewportOpacityBorder;

    .bundle-viewport {
      position: relative;
      width: 100%;
      height: 100%;
    }
  }

  .change-bundle-wrapper {
    background-color: $changeAreaBackground;
    padding: 5px 10px;
    border-top-color: $bundleViewportBorder;
    border-top: 1px solid $bundleViewportOpacityBorder;
    @include border-radius(0 0 4px 4px);

    button {
      float: right;

      &[disabled] {
        opacity: .5;
      }
    }
  }

  .tentative-selection,
  .search-selection {
    text-align: left;
    font-size: 18px;
    line-height: 40px;
    width: 100%;
    line-height: 23px;
    word-wrap: break-word;
    color: $bundlePickerText;
  }

  .tentative-selection {
    display: inline-block;
  }
}

.bundle-picker-breadcrumbs {
  position: relative;
  height: 53px;
  overflow: hidden;
  color: $breadcrumbText;

  .srm-throbber {
    display: inline-block;
    position: absolute;
    left: 53px;
    top: 16px;
  }

  .bundle-picker-home {
    position: absolute;
    left: 0;
    top: 3px;
    width: 38px;
    height: 33px;
    margin: 5px;
    text-align: center;
    cursor: pointer;

    &[disabled=disabled] {
      cursor: auto;
    }
  }

  ul {
    display: inline-block;
    width: 100%;
    max-height: 50px;
    overflow: hidden;
    padding: 8px 5px 0 53px;
    white-space: nowrap;
    @include box-sizing(border-box);
  }

  li {
    float: left;
    max-width: 26%;
    line-height: 18px;
    list-style: none;
    font-size: 12px;
    padding: 0 10px;
    cursor: pointer;

    span {
      display: block;
      float: left;
      width: 100%;
      height: 18px;
      text-decoration: underline;
      @include localized-line;
    }

    &:after {
      content: "»";
      display: inline-block;
      padding-left: 5px;
    }

    &:last-child {
      cursor: default;

      span {
        text-decoration: none;
      }
    }

    &:last-child:after {
      content: "";
      padding: 0;
    }
  }

  .home:after {
    content: "";
    padding: 0;
  }

}

.bundle-picker-bundle-list {
  opacity: 0;
  @include box-sizing(border-box);
  position: absolute;
  left: -50%;
  display: block;
  float: left;
  width: 50%;
  height: 100%;
  border-left-color: $bundleViewportBorder;
  border-left-color: $bundleViewportOpacityBorder;

  .bundle-picker-elements {
    list-style-type: none;
    padding: 0;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .srm-throbber {
    position: absolute;
    text-align: center;
    width: 100%;
    height: 50%;
    top: 30%;
    left: 0;
  }

  .bundle-list-item {
    @include localized-line;
    @include transition(background-color .25s linear 0s);
    position: relative;
    height: 34px;
    padding: 5px 10px;
    border-bottom-color: $bundleViewportBorder;
    border-bottom: 1px solid $bundleViewportOpacityBorder;
    cursor: pointer;
    color: $bundlePickerText;

    &:hover {
      background-color: $listItemHover;
    }

    .osicon-bundle {
      position: relative;
      left: -5px;
      top: -3px;
    }

    > img {
      display: inline-block;
      position: relative;
      float: left;
      overflow: hidden;
      width: 20px;
      height: 20px;
      left: -5px;
      top: 0;
      padding-right: 5px;
    }

    .bundle-name {
      @include localized-line;
      display: inline-block;
      max-width: 70%;
    }

    .osicon-folder-closed,
    .osicon-folder-open {
      position: absolute;
      right: 15px;
      top: inherit;
    }
  }

  .bundle-picker-current {
    font-weight: bold;
    color: $listItemSelectedText;
    background-color: $listItemSelected;
    cursor: default;

    .folder {
      background-position: 0 -41px;
      bottom: 0;
    }
  }

  .bundle-detail {
    max-height: 100%;
    overflow-y: auto;
    padding: 5px 10px;
    color: $bundlePickerText;
    word-wrap: break-word;

    .name {
      max-height: 50%;
      margin-bottom: 8px;
      font-size: 15px;
      line-height: 17px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .bundle-info {
      width: 80%;
      margin-top: 8px;
    }

    .detail-count {
      span {
        text-align: right;
        display: inline-block;
        min-width: 8%;
      }
    }
  }

  .offset-calculation-elem {
    display: block;
    visibility: hidden;
  }
}

// need force-to-viewport-left sibling for ie8 fallback, class is added in script
.bundle-picker-bundle-list:last-child,
.force-to-viewport-left + .bundle-picker-bundle-list {
  opacity: 1;
  left: 50%;
}

// need force-to-viewport-left for ie8 fallback, class is added in script, sadly important tag is needed too
.bundle-picker-bundle-list:nth-last-child(2),
.force-to-viewport-left {
  left: 0 !important;
  border-right-color: $bundleViewportBorder;
  border-right: 1px solid $bundleViewportOpacityBorder;
  opacity: 1;
}

.bundle-search-results {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 226px;
  border-top-color: $bundleViewportBorder;
  border-top-color: $bundleViewportOpacityBorder;
  overflow: hidden;
  z-index: 1;
  background-color: $shellBackground;
  @include transition(all .40s cubic-bezier(.65, .3, .66, .86) 0s);

  .bundle-picker-bundle-list {
    left: 0;
    width: 100%;
    height: 100%;
    border-top-color: $bundleViewportBorder;
    border-top: 1px solid $bundleViewportOpacityBorder;
    overflow: hidden;
  }

  .bundle-search-wrap {
    position: relative;
    width: 100%;
    height: 229px;
    overflow: hidden;
    background-color: $navigatorBackground;
    @include box-sizing(border-box);

    .bundle-search-header {
      height: 20%;
      padding: 10px;
      @include box-sizing(border-box);
    }

    .bundle-search-results-scaffold {
      position: relative;
      height: 80%;
      @include box-sizing(border-box);

      .bundle-picker-bundle-list {
        padding: 0;
      }

      .empty-search {
        border-top-color: $bundleViewportBorder;
        border-top: 1px solid $bundleViewportOpacityBorder;
        padding: 10px;
      }
    }
  }

  .bundle-search-close {
    position: absolute;
    top: 4px;
    right: 10px;
    font-size: 20px;
    font-weight: normal;
    color: $bundlePickerText;

    &:hover {
      cursor: pointer;
      font-weight: bold;
    }
  }

  h4 {
    margin-bottom: 10px;
    font-size: 18px;
  }

  .srm-throbber {
    position: relative;
    text-align: center;
    width: 100%;
    height: auto;
  }

  .global-icon-throbber {
    margin-top: 80px;
  }
}


@media (max-width: 600px) {
  .bundle-picker-control-modal {
    width: 480px;
  }
}

@media (max-width: 480px) {
  .bundle-picker-control-modal {
    width: 320px;
  }
}

