﻿.workflow-container {
    display: flex !important;
    flex-direction: row;
    margin-top: 20px;
}

.workflow-step {
    --textcolor: color-mix(white 70%, var(--mud-palette-medium-gray) 30%);
}

    .workflow-step.workflow-step-Ongoing {
        --textcolor: color-mix(white 20%, var(--mud-palette-secondary-blue) 80%);
        --shadowcolor: color-mix(white 60%, var(--mud-palette-medium-gray) 40%);
        --barcolor: #DDD;
        --circlecolor: var(--textcolor) !important;
    }

    .workflow-step.workflow-step-Done {
        --textcolor: #70DAB4;
        --shadowcolor: #5FB797;
        --barcolor: #DDD;
        --circlecolor: var(--textcolor) !important;
    }

    .workflow-step.workflow-step-Rejected {
        --textcolor: #EF6262;
        --barcolor: #DDD;
        --circlecolor: var(--textcolor) !important;
    }

    .workflow-step.workflow-step-paused.workflow-step-paused {
        --textcolor: #FB8C00 !important;
        --shadowcolor: #FB8C00 !important;
        --barcolor: #DDD;
        --circlecolor: #FB8C00 !important;
    }

.workflow-container .workflow-step {
    --stepCircleSize: 50px;
    --shadowcolor: color-mix(white 60%, var(--mud-palette-medium-gray) 40%);
    --barcolor: #DDD;
    --circlecolor: #DDD;
    --stepVerticalGap: 2rem;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-top: var(--stepVerticalGap);
}

    .workflow-container .workflow-step .workflow-step-bar {
        flex: 1;
        height: calc(var(--stepCircleSize)/2);
        background: var(--barcolor);
        position: relative;
    }

    .workflow-container .workflow-step:not(:last-child) .workflow-step-bar::before, .workflow-container .workflow-step:not(:last-child) .workflow-step-bar::after {
        content: "";
        width: 5px;
        height: 100%;
        background: var(--barcolor);
        position: absolute;
    }

    .workflow-container .workflow-step .workflow-step-bar::before {
        left: -5px;
    }

    .workflow-container .workflow-step .workflow-step-bar::after {
        right: -5px;
    }

    .workflow-container .workflow-step > div:not(.workflow-step-bar) {
        position: relative;
        align-items: center;
        z-index: 3;
    }

    .workflow-container .workflow-step:last-child {
        flex: unset;
    }

.workflow-container .workflow-step-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .1rem;
    width: max-content;
    position: absolute;
    top: calc(-1 * var(--stepVerticalGap));
}

.workflow-container .workflow-step-name {
    width: fit-content;
    white-space: nowrap;
    color: var(--textcolor) !important;
    font-weight: bold;
    font-size: .9rem !important;
}

.workflow-container .workflow-step-menu-btn {
    padding: 2px;
    margin: 0;
    color: var(--mud-palette-text-primary) !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

    .workflow-container .workflow-step-menu-btn svg {
        fill: var(--mud-palette-text-primary) !important;
    }

.workflow-container .workflow-step .workflow-step-approval {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    width: max-content;
    position: absolute;
    top: calc(100% + .5rem);
    left: 50%;
    transform: translateX(-50%);
}

.workflow-container .workflow-step-approver {
    color: var(--mud-palette-medium-gray) !important;
    font-weight: bold;
    font-size: .8rem !important;
}

.workflow-container .workflow-step-date {
    color: var(--mud-palette-medium-gray) !important;
    font-size: .75rem !important;
    opacity: .7;
}

.mud-paper.workflow-step-menu-popover {
    background-color: rgba(255, 255, 255, .5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.workflow-container svg.workflow-step-comment-icon {
    fill: var(--mud-palette-text-primary) !important;
    font-size: 1.1rem;
    cursor: pointer;
    display: block;
}

.workflow-container .workflow-step-header .mud-tooltip-root {
    display: flex;
    align-items: center;
}

    .workflow-container .workflow-step-menu-btn svg {
        font-size: 1.1rem;
    }

.workflow-container .workflow-step-icon-container {
    padding: .5rem;
    border-radius: 1000px;
    background-color: var(--circlecolor);
}

    .workflow-container .workflow-step-icon-container .workflow-step-icon-inner-container {
        width: var(--stepCircleSize);
        height: var(--stepCircleSize);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 1000px;
        background-color: white;
        box-shadow: 0rem .1rem .35rem var(--shadowcolor);
        position: relative;
    }

    .workflow-container .workflow-step-icon-container .workflow-step-icon-inner-container .workflow-step-icon-overlay {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 2.75rem !important;
        opacity: .85;
    }

.workflow-step svg {
    fill: var(--textcolor) !important;
}

.workflow-step.workflow-step-iconmode svg {
    font-size: 1.25rem;
}

.workflow-container .workflow-step-icon-container .workflow-step-icon-inner-container svg {
    font-size: 2rem;
}

.workflow-container .workflow-step.workflow-step-icon-Lab .workflow-step-icon-inner-container svg:not(.workflow-step-icon-overlay) {
    margin-left: .4rem;
}

.workflow-container .workflow-step:first-child .workflow-step-header {
    left: 2px;
}

.workflow-container .workflow-step:last-child .workflow-step-header {
    right: 2px;
}

.workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-Ongoing) {
    --barcolor: linear-gradient(to right, var(--textcolor) 20%, color-mix(in srgb, white 20%, var(--mud-palette-secondary-blue) 80%) 80%) !important;
}

    .workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-Ongoing) .workflow-step-bar::before {
        background: var(--textcolor) !important;
    }

    .workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-Ongoing) .workflow-step-bar::after {
        background: color-mix(in srgb, white 20%, var(--mud-palette-secondary-blue) 80%) !important;
    }

.workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-Rejected) {
    --barcolor: linear-gradient(to right, var(--textcolor) 20%, #EF6262 80%) !important;
}

    .workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-Rejected) .workflow-step-bar::before {
        background: var(--textcolor) !important;
    }

    .workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-Rejected) .workflow-step-bar::after {
        background: #EF6262 !important;
    }

.workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-Done) {
    --barcolor: linear-gradient(to right, var(--textcolor) 20%, var(--textcolor) 80%) !important;
}

    .workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-Done) .workflow-step-bar::before {
        background: var(--textcolor) !important;
    }

    .workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-Done) .workflow-step-bar::after {
        background: var(--textcolor) !important;
    }

.workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-paused) {
    --barcolor: linear-gradient(to right, var(--textcolor) 20%, #FB8C00 80%) !important;
}

    .workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-paused) .workflow-step-bar::before {
        background: var(--textcolor) !important;
    }

    .workflow-container .workflow-step.workflow-step-Done:has(+ .workflow-step.workflow-step-paused) .workflow-step-bar::after {
        background: #FB8C00 !important;
    }
