@import '../colors';

.tix-loading.v4 {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 99;
  height: inherit;
}

.tix-loading__loading-indicator-container.v4 {
  height: 60px;

  &:not(.primary) {
    color: $color-N0;
  }

  &.primary {
    color: $color-B400;
  }
}

.progress-bar-wrapper {
  background: $color-N200;
  border-radius: 4px;
  height: 8px;
  width: 100%;
  position: relative;
  overflow: hidden;

  .bar-content {
    background: $color-B400;
    border-radius: inherit;
    height: inherit;
    transition: width 0.4s linear;
  }
}

.placeholder-wrapper {
  display: inline-block;

  &.border {
    border: solid 1px $color-N200;
    border-radius: 4px;
    padding: 16px 16px 8px 16px;
  }

  .placeholder-row {
    display: flex;

    &.text {
      margin-bottom: 8px;

      &:first-child {
        width: 80%;
      }

      &:last-child {
        width: 100%;
      }
    }

    .placeholder-col {
      flex: 1 1 auto;

      &.thumb {
        text-align: center;
      }

      &.circle,
      &.circle-text {
        display: inline-grid;

        .placeholder:not(:first-child) {
          margin-top: 10px;
        }
      }

      &.columns {
        margin: 5px;
      }

      .placeholder {
        background-color: $color-N100;
        background-repeat: no-repeat;
        border-radius: 4px;
        line-height: 1;
        min-height: 16px;
        width: 100%;
        transform: translateZ(0);

        &.pulse {
          animation: pulse 1.5s ease-in-out 0.5s infinite;
        }

        &.wave {
          animation: wave 2s ease-in-out infinite;
          background-image: linear-gradient(
            90deg,
            $color-N100,
            $color-N200,
            $color-N100
          );
          background-size: 300px 100%;
        }

        &.circle,
        &.circle-text {
          border-radius: 50%;
          width: 24px;
          height: 24px;
          margin: 0 auto;
        }

        &.title {
          min-height: 24px;
          width: 118px;
        }

        &.icon-square {
          max-width: 40px;
          min-height: 40px;
          display: inline-block;
        }

        &.icon-circle {
          max-width: 24px;
          min-height: 24px;
          border-radius: 50%;
        }

        &.right {
          float: right;
        }

        &.icon-label {
          display: flex;
          margin: 8px auto;
        }
      }
    }
  }

  &.two-column {
    .placeholder-col {
      &:first-of-type {
        margin-left: 0;
      }

      .placeholder {
        float: left;
      }

      &:last-child {
        margin-left: auto;

        .placeholder {
          float: right;
        }
      }
    }
  }

  @keyframes wave {
    0% {
      background-position: -300px 0;
    }

    100% {
      background-position: calc(300px + 100%) 0;
    }
  }

  @-webkit-keyframes pulse {
    0% {
      opacity: 1;
    }
    50% {
      opacity: 0.4;
    }
    100% {
      opacity: 1;
    }
  }
}
