// edX LMS - developer
// ====================
// NOTE: use this area for any developer-needed or created styling that needs to be refactored into patterns or visually polished. Please list any template/view that your styles reference when definining them (example below):

// Views: Login, Sign Up
// .crazy-new-feature {
//   background: transparent;
// }

// --------------------
// rotate clockwise
@include keyframes(rotateCW) {
  0% {
    @include transform(rotate(0deg));
  }

  50% {
    @include transform(rotate(180deg));
  }

  100% {
    @include transform(rotate(360deg));
  }
}

// canned animation - use if you want out of the box/non-customized anim
%anim-rotateCW {
  @include animation(rotateCW $tmg-s1 linear infinite);
}

.ui-loading-base {
  @include animation(fadeIn $tmg-f2 linear 1);
  @extend %t-copy-base;

  .spin {
    @extend %anim-rotateCW;
    display: inline-block;
  }

  .copy {
    padding-left: ($baseline/4);
  }
}

.ui-loading {
  @extend .ui-loading-base;
  @extend %ui-well;
  opacity: 0.6;
  background-color: $white;
  padding: ($baseline*1.5) $baseline;
  text-align: center;
}

// for verify_student/make_payment_step.underscore
.payment-buttons {

  .purchase {
    float: left;
    padding: ($baseline*.5) 0;

    .product-info, .product-name, .price {
      @extend %t-ultrastrong;
      color: $m-blue-d3;
    }
  }

  .payment-button {
    float: right;
    @include margin-left( ($baseline/2) );

    &.is-selected {
      background: $m-green-s1 !important;
    }
  }
}

// teams temporary
.view-teams {

  // Copied from _pagination.scss in cms
  .pagination {
    @include clearfix();
    display: inline-block;
    width: flex-grid(3, 12);

    &.pagination-compact {
      @include text-align(right);
    }

    &.pagination-full {
      display: block;
      width: flex-grid(4, 12);
      margin: $baseline auto;
    }

    .nav-item {
      position: relative;
      display: inline-block;
      vertical-align: middle;
    }

    .nav-link {
      @include transition(all $tmg-f2 ease-in-out 0s);
      display: block;
      border: 0;
      background-image: none;
      background-color: transparent;
      padding: ($baseline/2) ($baseline*0.75);

      &.previous {
        margin-right: ($baseline/2);
      }

      &.next {
        margin-left: ($baseline/2);
      }

      &:hover {
        background-color: $blue;
        border-radius: 3px;
        color: $white;
      }

      &.is-disabled {
        background-color: transparent;
        color: $gray-l2;
        pointer-events: none;
      }
    }

    .nav-label {
      /* This wasn't working for me, so I directly copied the rule
      @extend %cont-text-sr; */
      border: 0;
      clip: rect(0 0 0 0);
      height: 1px;
      margin: -1px;
      overflow: hidden;
      padding: 0;
      position: absolute;
      width: 1px;
    }

    .pagination-form,
    .current-page,
    .page-divider,
    .total-pages {
      display: inline-block;
    }

    .current-page,
    .page-number-input,
    .total-pages {
      @extend %t-copy-base;
      @extend %t-strong;
      width: ($baseline*2.5);
      vertical-align: middle;
      margin: 0 ($baseline*0.75);
      padding: ($baseline/4);
      text-align: center;
      color: $gray;
    }

    .current-page {
      @extend %ui-depth1;
      position: absolute;
      @include left(-($baseline/4));
    }

    .page-divider {
      @extend %t-title4;
      @extend %t-regular;
      vertical-align: middle;
      color: $gray-l2;
    }

    .pagination-form {
      @extend %ui-depth2;
      position: relative;

      .page-number-label,
      .submit-pagination-form {
        /* This wasn't working for me, so I directly copied the rule
        @extend %cont-text-sr; */
        border: 0;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
      }

      .page-number-input {
        @include transition(all $tmg-f2 ease-in-out 0s);
        border: 1px solid transparent;
        border-bottom: 1px dotted $gray-l2;
        border-radius: 0;
        box-shadow: none;
        background: none;

        &:hover {
          background-color: $white;
          opacity: 0.6;
        }

        &:focus {
          // borrowing the base input focus styles to match overall app
          @include linear-gradient($paleYellow, tint($paleYellow, 90%));
          opacity: 1.0;
          box-shadow: 0 0 3px $shadow-d1 inset;
          background-color: $white;
          border: 1px solid transparent;
          border-radius: 3px;
        }
      }
    }
  }
}
