/*!
Copyright 2023 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

.spectrum-ProgressBar{
  --spectrum-progressbar-animation-ease-in-out-indeterminate:var(--spectrum-animation-ease-in-out);
  --spectrum-progressbar-animation-duration-indeterminate:var(--spectrum-animation-duration-2000);
  --spectrum-progressbar-corner-radius:var(--spectrum-corner-radius-100);

  --spectrum-progressbar-fill-size-indeterminate:70%;
  --spectrum-progressbar-size-2400:192px;
  --spectrum-progressbar-size-2500:200px;
  --spectrum-progressbar-size-2800:224px;
  --spectrum-progressbar-font-size:var(--spectrum-font-size-75);
  --spectrum-progressbar-line-height-cjk:var(--spectrum-cjk-line-height-100);

  --spectrum-progressbar-min-size:var(--spectrum-progress-bar-minimum-width);
  --spectrum-progressbar-max-size:var(--spectrum-progress-bar-maximum-width);

  --spectrum-progressbar-thickness:var(--spectrum-progress-bar-thickness-medium);
  --spectrum-progressbar-line-height:var(--spectrum-line-height-100);
  --spectrum-progressbar-spacing-label-to-progressbar:var(--spectrum-spacing-75);
  --spectrum-progressbar-spacing-top-to-text:var(--spectrum-component-top-to-text-100);
  --spectrum-progressbar-spacing-label-to-text:var(--spectrum-spacing-200);
  --spectrum-progressbar-text-color:var(--spectrum-neutral-content-color-default);
  --spectrum-progressbar-track-color:var(--spectrum-gray-300);
  --spectrum-progressbar-fill-color:var(--spectrum-accent-color-900);
  --spectrum-progressbar-fill-color-positive:var(--spectrum-positive-visual-color);
  --spectrum-progressbar-fill-color-notice:var(--spectrum-notice-visual-color);
  --spectrum-progressbar-fill-color-negative:var(--spectrum-negative-visual-color);
  --spectrum-progressbar-label-and-value-white:var(--spectrum-white);
  --spectrum-progressbar-track-color-white:var(--spectrum-transparent-white-300);
  --spectrum-progressbar-fill-color-white:var(--spectrum-white);
  --spectrum-meter-min-width:var(--spectrum-meter-minimum-width);
  --spectrum-meter-max-width:var(--spectrum-meter-maximum-width);
  --spectrum-meter-inline-size:var(--spectrum-meter-default-width);
  --spectrum-meter-thickness-s:var(--spectrum-meter-thickness-small);
  --spectrum-meter-thickness-l:var(--spectrum-meter-thickness-large);
  --spectrum-meter-top-to-text:var(--spectrum-component-top-to-text);
}

.spectrum-ProgressBar--sizeS, .spectrum-Meter--sizeS{
  --spectrum-progressbar-size-default:var(--spectrum-progressbar-size-2400);

  --spectrum-progressbar-font-size:var(--spectrum-font-size-75);
  --spectrum-progressbar-thickness:var(--spectrum-progress-bar-thickness-small);

  --spectrum-progressbar-spacing-top-to-text:var(--spectrum-component-top-to-text-75);
}

.spectrum-ProgressBar--sizeM{
  --spectrum-progressbar-size-default:var(--spectrum-progressbar-size-2400);

  --spectrum-progressbar-font-size:var(--spectrum-font-size-75);
  --spectrum-progressbar-thickness:var(--spectrum-progress-bar-thickness-large);

  --spectrum-progressbar-spacing-top-to-text:var(--spectrum-component-top-to-text-75);
}

.spectrum-ProgressBar--sizeL, .spectrum-Meter--sizeL{
  --spectrum-progressbar-size-default:var(--spectrum-progressbar-size-2500);

  --spectrum-progressbar-font-size:var(--spectrum-font-size-100);
  --spectrum-progressbar-thickness:var(--spectrum-progress-bar-thickness-large);

  --spectrum-progressbar-spacing-top-to-text:var(--spectrum-component-top-to-text-200);
}

.spectrum-ProgressBar--sizeXL{
  --spectrum-progressbar-size-default:var(--spectrum-progressbar-size-2800);

  --spectrum-progressbar-font-size:var(--spectrum-font-size-200);
  --spectrum-progressbar-thickness:var(--spectrum-progress-bar-thickness-extra-large);

  --spectrum-progressbar-spacing-top-to-text:var(--spectrum-component-top-to-text-300);
}

.spectrum-Meter{
  --spectrum-progressbar-size-default:var(--mod-meter-inline-size, var(--spectrum-meter-inline-size));
  --spectrum-progressbar-max-size:var(--mod-meter-max-width, var(--spectrum-meter-max-width));
  --spectrum-progressbar-min-size:var(--mod-meter-min-width, var(--spectrum-meter-min-width));
}

.spectrum-Meter.spectrum-Meter--sizeS{
    --spectrum-progressbar-thickness:var(--spectrum-meter-thickness-s);
  }

.spectrum-Meter.spectrum-Meter--sizeL{
    --spectrum-progressbar-thickness:var(--spectrum-meter-thickness-l);
    --spectrum-progressbar-spacing-top-to-text:var(--spectrum-component-top-to-text-75);
  }

.spectrum-Meter.is-positive .spectrum-ProgressBar-fill{
    background-color:var(--highcontrast-progressbar-fill-color, var(--mod-progressbar-fill-color-positive, var(--spectrum-progressbar-fill-color-positive)));
  }

.spectrum-Meter.is-notice .spectrum-ProgressBar-fill{
    background-color:var(--highcontrast-progressbar-fill-color, var(--mod-progressbar-fill-color-notice, var(--spectrum-progressbar-fill-color-notice)));
  }

.spectrum-Meter.is-negative .spectrum-ProgressBar-fill{
    background-color:var(--highcontrast-progressbar-fill-color, var(--mod-progressbar-fill-color-negative, var(--spectrum-progressbar-fill-color-negative)));
  }

.spectrum-ProgressBar{
  position:relative;
  display:inline-flex;
  flex-flow:row wrap;
  justify-content:space-between;
  align-items:center;
  font-size:var(--mod-progressbar-font-size, var(--spectrum-progressbar-font-size));
  vertical-align:top;

  inline-size:var(--mod-progressbar-size-default, var(--spectrum-progressbar-size-default));
  max-inline-size:var(--mod-progressbar-max-size, var(--spectrum-progressbar-max-size));
  min-inline-size:var(--mod-progressbar-min-size, var(--spectrum-progressbar-min-size));
}

.spectrum-ProgressBar .spectrum-ProgressBar-label, .spectrum-ProgressBar .spectrum-ProgressBar-percentage{
    text-align:start;
    margin-block-start:var(--mod-progressbar-spacing-top-to-text, var(--spectrum-progressbar-spacing-top-to-text));
    margin-block-end:var(--mod-progressbar-spacing-label-to-progressbar, var(--spectrum-progressbar-spacing-label-to-progressbar));

    line-height:var(--mod-progressbar-line-height, var(--spectrum-progressbar-line-height));

    color:var(--mod-progressbar-text-color, var(--spectrum-progressbar-text-color));
  }

.spectrum-ProgressBar .spectrum-ProgressBar-label:lang(ja), .spectrum-ProgressBar .spectrum-ProgressBar-percentage:lang(ja), .spectrum-ProgressBar .spectrum-ProgressBar-label:lang(zh), .spectrum-ProgressBar .spectrum-ProgressBar-percentage:lang(zh), .spectrum-ProgressBar .spectrum-ProgressBar-label:lang(ko), .spectrum-ProgressBar .spectrum-ProgressBar-percentage:lang(ko){
      line-height:var(--mod-progressbar-line-height-cjk, var(--spectrum-progressbar-line-height-cjk));
    }

.spectrum-ProgressBar .spectrum-ProgressBar-label{
    flex:1 1 0%;
  }

.spectrum-ProgressBar .spectrum-ProgressBar-percentage{
    align-self:flex-start;
    margin-inline-start:var(--mod-progressbar-spacing-label-to-text, var(--spectrum-progressbar-spacing-label-to-text));
  }

.spectrum-ProgressBar .spectrum-ProgressBar-track{
    overflow:hidden;
    inline-size:100%;
    block-size:var(--mod-progressbar-thickness, var(--spectrum-progressbar-thickness));
    border-radius:var(--spectrum-progressbar-corner-radius);

    background-color:var(--highcontrast-progressbar-track-color, var(--mod-progressbar-track-color, var(--spectrum-progressbar-track-color)));
  }

.spectrum-ProgressBar .spectrum-ProgressBar-fill{
    border:none;
    block-size:var(--mod-progressbar-thickness, var(--spectrum-progressbar-thickness));
    transition:width 1s;
    background-color:var(--highcontrast-progressbar-fill-color, var(--mod-progressbar-fill-color, var(--spectrum-progressbar-fill-color)));
  }

.spectrum-ProgressBar--indeterminate .spectrum-ProgressBar-fill{
  inline-size:var(--mod-progressbar-fill-size-indeterminate, var(--spectrum-progressbar-fill-size-indeterminate));
  position:relative;
  animation-timing-function:var(--mod-progressbar-animation-ease-in-out-indeterminate, var(--spectrum-progressbar-animation-ease-in-out-indeterminate));
  will-change:transform;
}

.spectrum-ProgressBar--sideLabel{
  display:inline-flex;
  flex-flow:row;
  justify-content:space-between;
}

.spectrum-ProgressBar--sideLabel .spectrum-ProgressBar-track{
    flex:1 1 var(--mod-progressbar-size-default, var(--spectrum-progressbar-size-default));
  }

.spectrum-ProgressBar--sideLabel .spectrum-ProgressBar-label{
    flex-grow:0;
    margin-inline-end:var(--mod-progressbar-spacing-label-to-text, var(--spectrum-progressbar-spacing-label-to-text));
    margin-block-end:0;
  }

.spectrum-ProgressBar--sideLabel .spectrum-ProgressBar-percentage{
    order:3;
    text-align:end;
    margin-inline-start:var(--mod-spacing-progressbar-label-to-text, var(--spectrum-progressbar-spacing-label-to-text));
    margin-block-end:0;
  }

.spectrum-ProgressBar--staticWhite .spectrum-ProgressBar-fill{
    color:var(--mod-progressbar-label-and-value-white, var(--spectrum-progressbar-label-and-value-white));
    background-color:var(--mod-progressbar-fill-color-white, var(--spectrum-progressbar-fill-color-white));
  }

.spectrum-ProgressBar--staticWhite .spectrum-ProgressBar-label, .spectrum-ProgressBar--staticWhite .spectrum-ProgressBar-percentage{
    color:var(--mod-progressbar-label-and-value-white, var(--spectrum-progressbar-label-and-value-white));
  }

.spectrum-ProgressBar--staticWhite .spectrum-ProgressBar-track{
    background-color:var(--spectrum-progressbar-track-color-white);
  }

.spectrum-ProgressBar--indeterminate .spectrum-ProgressBar-fill{
  animation:indeterminate-loop-ltr var(--mod-progressbar-animation-duration-indeterminate, var(--spectrum-progressbar-animation-duration-indeterminate)) infinite;
}

[dir="rtl"] .spectrum-ProgressBar--indeterminate .spectrum-ProgressBar-fill{
  animation:indeterminate-loop-rtl var(--mod-progressbar-animation-duration-indeterminate, var(--spectrum-progressbar-animation-duration-indeterminate)) infinite;
}

.spectrum-ProgressBar--indeterminate .spectrum-ProgressBar-fill:dir(rtl){
  animation:indeterminate-loop-rtl var(--mod-progressbar-animation-duration-indeterminate, var(--spectrum-progressbar-animation-duration-indeterminate)) infinite;
}

@keyframes indeterminate-loop-ltr{
  from{
    transform:translate(
      calc(-1 * var(--mod-progressbar-fill-size-indeterminate, var(--spectrum-progressbar-fill-size-indeterminate)))
    );
  }

  to{
    transform:translate(var(--mod-progressbar-size-default, var(--spectrum-progressbar-size-default)));
  }
}

@keyframes indeterminate-loop-rtl{
  from{
    transform:translate(var(--mod-progressbar-size-default, var(--spectrum-progressbar-fill-size-indeterminate)));
  }

  to{
    transform:translate(calc(-1 * var(--mod-progressbar-size-default, var(--spectrum-progressbar-size-default))));
  }
}

@media (forced-colors: active){
  .spectrum-ProgressBar-track{
    forced-color-adjust:none;
    --highcontrast-progressbar-fill-color:ButtonText;
    --highcontrast-progressbar-track-color:ButtonFace;
    border:1px solid ButtonText;
  }
}
