@use "../../styles/abstract/base" as base;
@use "../../styles/abstract/variables" as v;
@use "../../styles/abstract/functions" as f;
@use "../../styles/abstract/mixins" as m;
@use "../../styles/abstract/direction" as d;
@use "../../styles/abstract/theme" as t;

$component: "#{base.$prefix}-progress";

.#{$component} {
position: relative;
display: block;
line-height: 0;

&[hidden] {
display: none;
}

&__canvas {
display: block;
max-width: 100%;
}

&--linear {
width: 100%;
padding: 0 #{4px};
box-sizing: border-box;
}

&--circular {
display: inline-flex;
align-items: center;
justify-content: center;
vertical-align: middle;
}

&__label {
@include m.typography("label-medium");
position: absolute;
line-height: normal;
color: t.color("on-surface-variant");
white-space: nowrap;

.#{$component}--linear & {
@include d.end(0, $arm: false);
top: 100%;
margin-top: 4px;
}

.#{$component}--circular & {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}

&--linear {
@include d.arms($self: true) {
.#{$component}__label {
right: auto;
left: 0;
}
}
}

&--linear:has(.#{$component}__label) {
margin-bottom: 20px;
}

&--disabled,
&[aria-disabled="true"] {
opacity: 0.38;
pointer-events: none;
}

&--transition {
transition: opacity v.motion("duration-short4") v.motion("easing-standard");
}

@include m.print {
display: none;
}
}
