//
// Component: Info Box
//

.info-box {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 80px;
  padding: 0.5rem;
  $margin-bottom: map-get($spacers, 3); // Extract value
  margin-bottom: $margin-bottom; // Assign to property
  box-shadow:
    0 0 1px rgb(0, 0, 0, 0.125),
    0 1px 3px rgb(0, 0, 0, 0.2);
  @include border-radius($border-radius);

  > .overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: rgb(0, 0, 0, 0.5);
    @include border-radius($border-radius);

    > i {
      font-size: 2rem;
      color: #fff;
      animation: spin 2s linear infinite;
    }
  }

  &.bg-info {
    color: #fff;
    background-color: var(--#{$prefix}info);
  }
  &.bg-success {
    color: #fff;
    background-color: var(--#{$prefix}success);
  }
  &.bg-warning {
    color: #fff;
    background-color: var(--#{$prefix}warning);
  }
  &.bg-danger {
    color: #fff;
    background-color: var(--#{$prefix}danger);
  }
  &.bg-primary {
    color: #fff;
    background-color: var(--#{$prefix}primary);
  }
  &.bg-secondary {
    color: #fff;
    background-color: var(--#{$prefix}secondary);
  }
  &.bg-muted {
    color: #fff;
    background-color: var(--#{$prefix}muted);
  }
  &.bg-light {
    color: #000;
    background-color: var(--#{$prefix}light);
  }
  &.bg-dark {
    color: #fff;
    background-color: var(--#{$prefix}dark);
  }

  &.info-box-outline {
    border: 1px solid #000;

    &.info-box-outline-info {
      border-color: var(--#{$prefix}info);
    }
    &.info-box-outline-success {
      border-color: var(--#{$prefix}success);
    }
    &.info-box-outline-warning {
      border-color: var(--#{$prefix}warning);
    }
    &.info-box-outline-danger {
      border-color: var(--#{$prefix}danger);
    }
    &.info-box-outline-primary {
      border-color: var(--#{$prefix}primary);
    }
    &.info-box-outline-secondary {
      border-color: var(--#{$prefix}secondary);
    }
    &.info-box-outline-muted {
      border-color: var(--#{$prefix}muted);
    }
    &.info-box-outline-light {
      border-color: var(--#{$prefix}light);
    }
    &.info-box-outline-dark {
      border-color: var(--#{$prefix}dark);
    }
  }

  .progress {
    height: 2px;
    margin: 5px 0;
    background-color: rgb(0, 0, 0, 0.125);

    .progress-bar {
      background-color: #fff;
    }
  }

  .info-box-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    font-size: 1.875rem;
    text-align: center;
    @include border-radius($border-radius);

    > img {
      max-width: 100%;
    }
    &.bg-info,
    &.bg-success,
    &.bg-warning,
    &.bg-danger,
    &.bg-primary,
    &.bg-secondary,
    &.bg-muted,
    &.bg-light,
    &.bg-dark {
      color: #fff;
    }
  }

  .info-box-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    padding: 0 10px;
    line-height: 1.8;
  }

  .info-box-number {
    display: block;
    margin-top: 0.25rem;
    font-weight: $font-weight-bold;
  }

  .progress-description,
  .info-box-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .info-box-more {
    display: block;
  }

  .progress-description {
    margin: 0;
  }

  @include media-breakpoint-up(md) {
    .col-xl-2 &,
    .col-lg-2 &,
    .col-md-2 & {
      .progress-description {
        display: none;
      }
    }

    .col-xl-3 &,
    .col-lg-3 &,
    .col-md-3 & {
      .progress-description {
        display: none;
      }
    }
  }

  @include media-breakpoint-up(lg) {
    .col-xl-2 &,
    .col-lg-2 &,
    .col-md-2 & {
      .progress-description {
        @include font-size(0.75rem);
        display: block;
      }
    }

    .col-xl-3 &,
    .col-lg-3 &,
    .col-md-3 & {
      .progress-description {
        @include font-size(0.75rem);
        display: block;
      }
    }
  }

  @include media-breakpoint-up(xl) {
    .col-xl-2 &,
    .col-lg-2 &,
    .col-md-2 & {
      .progress-description {
        @include font-size(1rem);
        display: block;
      }
    }

    .col-xl-3 &,
    .col-lg-3 &,
    .col-md-3 & {
      .progress-description {
        @include font-size(1rem);
        display: block;
      }
    }
  }
}
