/*
    @license
    Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
    This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
    The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
    The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
    Code distributed by Google as part of the polymer project is also
    subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
 */
/**************************/
/* STYLES FOR THE SPINNER */
/**************************/
/*
 * Constants:
 *      STROKEWIDTH = 3px
 *      ARCSIZE     = 270 degrees (amount of circle the arc takes up)
 *      ARCTIME     = 1333ms (time it takes to expand and contract arc)
 *      ARCSTARTROT = 216 degrees (how much the start location of the arc
 *                                should rotate each time, 216 gives us a
 *                                5 pointed star shape (it's 360/5 * 3).
 *                                For a 7 pointed star, we might do
 *                                360/7 * 3 = 154.286)
 *      CONTAINERWIDTH = 28px
 *      SHRINK_TIME = 400ms
 */
.tvd-preloader-wrapper {
  display: inline-block;
  position: relative;
  width: 48px;
  height: 48px; }
  .tvd-preloader-wrapper.tvd-small {
    width: 36px;
    height: 36px; }
  .tvd-preloader-wrapper.tvd-big {
    width: 110px;
    height: 110px; }
  .tvd-preloader-wrapper.tvd-bigger {
    width: 150px;
    height: 150px; }
  .tvd-preloader-wrapper.tvd-active {
    /* duration: 360 * ARCTIME / (ARCSTARTROT + (360-ARCSIZE)) */
    -webkit-animation: tvd-container-rotate 1568ms linear infinite;
    animation: tvd-container-rotate 1568ms linear infinite; }

@-webkit-keyframes tvd-container-rotate {
  to {
    -webkit-transform: rotate(360deg); } }

@keyframes tvd-container-rotate {
  to {
    transform: rotate(360deg); } }

.tvd-spinner-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  border-color: #2b85af; }

.tvd-spinner-blue,
.tvd-spinner-blue-only {
  border-color: #1da5e5; }

.tvd-spinner-red,
.tvd-spinner-red-only {
  border-color: #db4437; }

.tvd-spinner-yellow,
.tvd-spinner-yellow-only {
  border-color: #f4b400; }

.tvd-spinner-green,
.tvd-spinner-green-only {
  border-color: #0f9d58; }

/**
 * IMPORTANT NOTE ABOUT CSS ANIMATION PROPERTIES (keanulee):
 *
 * iOS Safari (tested on iOS 8.1) does not handle animation-delay very well - it doesn't
 * guarantee that the animation will start _exactly_ after that value. So we avoid using
 * animation-delay and instead set custom keyframes for each color (as redundant as it
 * seems).
 *
 * We write out each animation in full (instead of separating animation-name,
 * animation-duration, etc.) because under the polyfill, Safari does not recognize those
 * specific properties properly, treats them as -webkit-animation, and overrides the
 * other animation rules. See https://github.com/Polymer/platform/issues/53.
 */
.tvd-active .tvd-spinner-layer.tvd-spinner-blue {
  /* durations: 4 * ARCTIME */
  -webkit-animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, tvd-blue-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, tvd-blue-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; }

.tvd-active .tvd-spinner-layer.tvd-spinner-red {
  /* durations: 4 * ARCTIME */
  -webkit-animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, tvd-red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, tvd-red-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; }

.tvd-active .tvd-spinner-layer.tvd-spinner-yellow {
  /* durations: 4 * ARCTIME */
  -webkit-animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, tvd-yellow-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, tvd-yellow-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; }

.tvd-active .tvd-spinner-layer.tvd-spinner-green {
  /* durations: 4 * ARCTIME */
  -webkit-animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, tvd-green-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both, tvd-green-fade-in-out 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; }

.tvd-active .tvd-spinner-layer,
.tvd-active .tvd-spinner-layer.tvd-spinner-blue-only,
.tvd-active .tvd-spinner-layer.tvd-spinner-red-only,
.tvd-active .tvd-spinner-layer.tvd-spinner-yellow-only,
.tvd-active .tvd-spinner-layer.tvd-spinner-green-only {
  /* durations: 4 * ARCTIME */
  opacity: 1;
  -webkit-animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: tvd-fill-unfill-rotate 5332ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; }

@-webkit-keyframes tvd-fill-unfill-rotate {
  12.5% {
    -webkit-transform: rotate(135deg); }
  /* 0.5 * ARCSIZE */
  25% {
    -webkit-transform: rotate(270deg); }
  /* 1   * ARCSIZE */
  37.5% {
    -webkit-transform: rotate(405deg); }
  /* 1.5 * ARCSIZE */
  50% {
    -webkit-transform: rotate(540deg); }
  /* 2   * ARCSIZE */
  62.5% {
    -webkit-transform: rotate(675deg); }
  /* 2.5 * ARCSIZE */
  75% {
    -webkit-transform: rotate(810deg); }
  /* 3   * ARCSIZE */
  87.5% {
    -webkit-transform: rotate(945deg); }
  /* 3.5 * ARCSIZE */
  to {
    -webkit-transform: rotate(1080deg); }
  /* 4   * ARCSIZE */ }

@keyframes tvd-fill-unfill-rotate {
  12.5% {
    transform: rotate(135deg); }
  /* 0.5 * ARCSIZE */
  25% {
    transform: rotate(270deg); }
  /* 1   * ARCSIZE */
  37.5% {
    transform: rotate(405deg); }
  /* 1.5 * ARCSIZE */
  50% {
    transform: rotate(540deg); }
  /* 2   * ARCSIZE */
  62.5% {
    transform: rotate(675deg); }
  /* 2.5 * ARCSIZE */
  75% {
    transform: rotate(810deg); }
  /* 3   * ARCSIZE */
  87.5% {
    transform: rotate(945deg); }
  /* 3.5 * ARCSIZE */
  to {
    transform: rotate(1080deg); }
  /* 4   * ARCSIZE */ }

@-webkit-keyframes tvd-blue-fade-in-out {
  from {
    opacity: 1; }
  25% {
    opacity: 1; }
  26% {
    opacity: 0; }
  89% {
    opacity: 0; }
  90% {
    opacity: 1; }
  100% {
    opacity: 1; } }

@keyframes tvd-blue-fade-in-out {
  from {
    opacity: 1; }
  25% {
    opacity: 1; }
  26% {
    opacity: 0; }
  89% {
    opacity: 0; }
  90% {
    opacity: 1; }
  100% {
    opacity: 1; } }

@-webkit-keyframes tvd-red-fade-in-out {
  from {
    opacity: 0; }
  15% {
    opacity: 0; }
  25% {
    opacity: 1; }
  50% {
    opacity: 1; }
  51% {
    opacity: 0; } }

@keyframes tvd-red-fade-in-out {
  from {
    opacity: 0; }
  15% {
    opacity: 0; }
  25% {
    opacity: 1; }
  50% {
    opacity: 1; }
  51% {
    opacity: 0; } }

@-webkit-keyframes tvd-yellow-fade-in-out {
  from {
    opacity: 0; }
  40% {
    opacity: 0; }
  50% {
    opacity: 1; }
  75% {
    opacity: 1; }
  76% {
    opacity: 0; } }

@keyframes tvd-yellow-fade-in-out {
  from {
    opacity: 0; }
  40% {
    opacity: 0; }
  50% {
    opacity: 1; }
  75% {
    opacity: 1; }
  76% {
    opacity: 0; } }

@-webkit-keyframes tvd-green-fade-in-out {
  from {
    opacity: 0; }
  65% {
    opacity: 0; }
  75% {
    opacity: 1; }
  90% {
    opacity: 1; }
  100% {
    opacity: 0; } }

@keyframes tvd-green-fade-in-out {
  from {
    opacity: 0; }
  65% {
    opacity: 0; }
  75% {
    opacity: 1; }
  90% {
    opacity: 1; }
  100% {
    opacity: 0; } }

/**
 * Patch the gap that appear between the two adjacent div.circle-clipper while the
 * spinner is rotating (appears on Chrome 38, Safari 7.1, and IE 11).
 */
.tvd-gap-patch {
  position: absolute;
  top: 0;
  left: 45%;
  width: 10%;
  height: 100%;
  overflow: hidden;
  border-color: inherit; }

.tvd-gap-patch .tvd-circle {
  width: 1000%;
  left: -450%; }

.tvd-circle-clipper {
  display: inline-block;
  position: relative;
  width: 50%;
  height: 100%;
  overflow: hidden;
  border-color: inherit; }
  .tvd-circle-clipper .tvd-circle {
    width: 200%;
    height: 100%;
    border-width: 3px;
    /* STROKEWIDTH */
    border-style: solid;
    border-color: inherit;
    border-bottom-color: transparent !important;
    border-radius: 50%;
    -webkit-animation: none;
    animation: none;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0; }
  .tvd-circle-clipper.tvd-left .tvd-circle {
    left: 0;
    border-right-color: transparent !important;
    -webkit-transform: rotate(129deg);
    transform: rotate(129deg); }
  .tvd-circle-clipper.tvd-right .tvd-circle {
    left: -100%;
    border-left-color: transparent !important;
    -webkit-transform: rotate(-129deg);
    transform: rotate(-129deg); }

.tvd-active .tvd-circle-clipper.tvd-left .tvd-circle {
  /* duration: ARCTIME */
  -webkit-animation: tvd-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: tvd-left-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; }

.tvd-active .tvd-circle-clipper.tvd-right .tvd-circle {
  /* duration: ARCTIME */
  -webkit-animation: tvd-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both;
  animation: tvd-right-spin 1333ms cubic-bezier(0.4, 0, 0.2, 1) infinite both; }

@-webkit-keyframes tvd-left-spin {
  from {
    -webkit-transform: rotate(130deg); }
  50% {
    -webkit-transform: rotate(-5deg); }
  to {
    -webkit-transform: rotate(130deg); } }

@keyframes tvd-left-spin {
  from {
    transform: rotate(130deg); }
  50% {
    transform: rotate(-5deg); }
  to {
    transform: rotate(130deg); } }

@-webkit-keyframes tvd-right-spin {
  from {
    -webkit-transform: rotate(-130deg); }
  50% {
    -webkit-transform: rotate(5deg); }
  to {
    -webkit-transform: rotate(-130deg); } }

@keyframes tvd-right-spin {
  from {
    transform: rotate(-130deg); }
  50% {
    transform: rotate(5deg); }
  to {
    transform: rotate(-130deg); } }

#tvd-spinnerContainer.tvd-cooldown {
  /* duration: SHRINK_TIME */
  -webkit-animation: tvd-container-rotate 1568ms linear infinite, tvd-fade-out 400ms cubic-bezier(0.4, 0, 0.2, 1);
  animation: tvd-container-rotate 1568ms linear infinite, tvd-fade-out 400ms cubic-bezier(0.4, 0, 0.2, 1); }

@-webkit-keyframes tvd-fade-out {
  from {
    opacity: 1; }
  to {
    opacity: 0; } }

@keyframes tvd-fade-out {
  from {
    opacity: 1; }
  to {
    opacity: 0; } }

.tvd-modal-preloader, .tvd-card-preloader {
  transform: translate(-50%, -50%);
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 7; }

.tvd-page-preloader {
  position: fixed;
  box-sizing: border-box;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10004; }
  .tvd-page-preloader:before {
    background: rgba(0, 0, 0, 0.2);
    content: '';
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0; }
