/* Styles for Cricketer Styled ProgressBar */

/* set cricketer styles */

app-progress-bar .wrapper {
    --progress-bar-primary:#7f5;
    --btn-secondary-highlight:#5d3;
    --btn-secondary-color:#111;
    --border-radius-sm:0rem;
    --shadow-md:0rem;
    margin: 0.8rem 0 1.2rem;
}

/* add batsman */

app-progress-bar .wrapper::before {
    content: '';
    width:2rem;
    aspect-ratio: 1;
    background-image: url('/images/sold-out.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    position:absolute;
    z-index: 20;
    bottom: 40%;
    left: calc(var(--value) * 1cqi);
    transform: translateX( calc(var(--value) * -1%) );
    transition: ease;
    transition-property: left;
    transition-duration: 1s;
}

app-progress-bar.live .wrapper::before {
    background-image: url('/images/runner.webp');
}

/* rotate the main progress bar to create the top of the cube */

app-progress-bar .wrapper .progress {
    overflow: visible;
    transform: perspective(200px) rotateX(60deg);
}

/* fill the label to create the front of the cube */

app-progress-bar .wrapper .label {
    display: block;
    width: 100%;
    height:1rem;
    background-image: linear-gradient(to bottom, var(--btn-secondary-highlight), #993);
    position:absolute;
    transform: perspective(200px) translateZ(0.75rem);
    top:80%;
}

app-progress-bar .wrapper .label::before {
    content:'';
    background-image: linear-gradient(to bottom, var(--progress-bar-primary, var(--btn-secondary-bg)), transparent);
    min-width: var(--min);
    position: relative;
    width: var(--width, 0);
    transition: ease;
    transition-property: width;
    transition-duration: 1s;
    display: block;
    height: 1rem;
}

app-progress-bar .wrapper .label::after {
    color: var(--btn-secondary-color);
    counter-reset: value var(--value,0);
    content: counter(value) "% sold";
    font-weight: 600;
    font-size:0.7rem;
    right: initial;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* add wickets to min/max markers */

app-progress-bar .wrapper .min::after,
app-progress-bar .wrapper .max::after {
    width:1.5rem;
    aspect-ratio: 1;
    background-image: url('/images/wicket.webp');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

app-progress-bar .wrapper .min::after {
    transform: scaleX(-1) translate(50%, -25%);
    top: 0;
}

app-progress-bar .wrapper .max::after {
    transform: scaleX(+1) translate(50%, -25%);
    top: 0;
}
