@import '@alfalab/core-components-vars/src/index.css';

:root {
    /* stroke */
    --circular-progress-bar-stroke-color: var(--color-light-neutral-translucent-300);

    /* positive */
    --circular-progress-bar-positive-color: var(--color-light-status-positive);

    /* negative */
    --circular-progress-bar-negative-color: var(--color-light-status-negative);
}

.component {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--border-radius-pill);

    &.bg-positive {
        background: var(--circular-progress-bar-positive-color);
    }

    &.bg-negative {
        background: var(--circular-progress-bar-negative-color);
    }
}

.svg {
    display: block;
    width: 100%;
}

.title,
.subtitle {
    overflow: hidden;
    word-break: break-word;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin: var(--gap-0) var(--gap-6);
}

.subtitle {
    max-height: 40px;
}

.labelWrapper {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    transform: translate(-50%, -50%);

    &.label {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.size-144 {
    width: 144px;
    height: 144px;

    & .labelWrapper {
        max-width: 128px;
    }

    & .title {
        max-height: 32px;
    }
}

.size-128 {
    width: 128px;
    height: 128px;

    & .labelWrapper {
        max-width: 108px;
    }

    & .title {
        max-height: 32px;
    }
}

.size-96 {
    width: 96px;
    height: 96px;

    & .labelWrapper {
        max-width: 64px;
    }

    & .title {
        max-height: 20px;
    }
}

.size-80 {
    width: 80px;
    height: 80px;

    & .labelWrapper {
        max-width: 64px;
    }

    & .title {
        max-height: 24px;
    }
}

.size-64 {
    width: 64px;
    height: 64px;

    & .labelWrapper {
        max-width: 48px;
    }

    & .title {
        max-height: 16px;
        margin: var(--gap-0);
    }
}

.size-48 {
    width: 48px;
    height: 48px;

    & .labelWrapper {
        max-width: 40px;
    }

    & .title {
        max-height: 16px;
        margin: var(--gap-0);
    }
}

.size-24 {
    width: 24px;
    height: 24px;

    & .labelWrapper {
        max-width: 24px;
    }
}

.size-16 {
    width: 16px;
    height: 16px;

    & .labelWrapper {
        max-width: 16px;
    }
}

.backgroundCircle,
.progressCircle {
    width: 100%;
    height: 100%;
    fill: transparent;
}

.positive {
    stroke: var(--circular-progress-bar-positive-color);
}

.negative {
    stroke: var(--circular-progress-bar-negative-color);
}

.backgroundCircle {
    stroke: var(--circular-progress-bar-stroke-color);

    &.stroke {
        stroke: transparent;
    }
}

.progressCircle {
    stroke-linecap: round;
}

.iconWrapper {
    display: flex;
    align-items: center;
    justify-content: center;

    &.size-144 {
        max-width: 64px;
        max-height: 64px;
    }

    &.size-128 {
        max-width: 64px;
        max-height: 64px;
    }

    &.size-96 {
        max-width: 48px;
        max-height: 48px;
    }

    &.size-80 {
        max-width: 48px;
        max-height: 48px;
    }

    &.size-64 {
        max-width: 36px;
        max-height: 36px;
    }

    &.size-48 {
        max-width: 24px;
        max-height: 24px;
    }

    &.size-24 {
        max-width: 16px;
        max-height: 16px;
    }

    &.icon-tertiary {
        color: var(--color-light-neutral-500);
    }

    &.icon-positive {
        color: var(--color-light-status-positive);
    }

    &.icon-negative {
        color: var(--color-light-status-negative);
    }

    &.icon-primary-inverted {
        color: var(--color-light-neutral-translucent-1300-inverted);
    }

    &.icon-primary {
        color: var(--color-light-neutral-translucent-1300);
    }

    &.icon-secondary {
        color: var(--color-light-neutral-700);
    }
}

.icon {
    width: 100%;
    height: 100%;
}
