/* progress.css */
#progress-fill {
    height: 100%;
    width: 0%; 
    background-color: #4C78A8;
    color: #fff;
    font-size: 12px;
    text-align: center;
    line-height: 20px;
    transition: width 0.5s ease;
    white-space: nowrap;
    overflow: hidden; 
    text-overflow: ellipsis;
}

#progress-bar {
    border: 1px solid;
}

/* Styles for control buttons */
#progress-controls {
    width: 100% !important;
    max-width: 90%;
    max-height: 90%;
    margin: 5px auto;
    text-align: center;
    box-sizing: border-box;
}


#progress-controls button {
    width: 100%;
    max-width: 100%;
    cursor: pointer;
    box-sizing: border-box; 
    
    flex: 1 1 auto; 

    font-size: clamp(0.5rem, 3vw, 1rem);
}

#progress-info {
    margin-bottom: 0.5em;
}

/* The chart is scaled down to fit its area, so it rarely fills both sides;
   centred, the spare room splits evenly instead of piling up on the right
   and above the progress bar. */
.chart-wrapper {
    grid-area: chart;
    min-width: 0;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-wrapper svg, .chart-wrapper canvas {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}


#footer-panel {
    grid-area: footer;
    flex-direction: row;
    width: 100% !important;
    margin-left: 0px !important;
}

#footer-panel:not(:has(#proc-panel)) #progress-container {
  grid-column: 1 / span 2 !important;
  width: 100% !important;
}

#footer-panel:not(:has(#proc-panel)) #progress-info {
    width: 100% !important;
}

#quality-panel {
    grid-column: 2;
    grid-row: 1;
}

/* The library gives both side panels a fixed 260px. In the grid that made
   the right-hand column at least that wide, and the chart lost the
   difference: in the Inspector it shrank to 370px. They now take the
   column, and their text wraps. */
#quality-panel,
#proc-panel {
    width: auto !important;
}

#progress-container {
    max-width: 100% !important;
}

/* The process panel sits in the "proc" area of the #vis grid (style.css), and a
   grid item stretches to the height of its row: the panel ran far below its
   few lines of content. */
#proc-panel {
    align-self: start;
    height: fit-content;
}

/* Aliveness spinner. The library only toggles the class; without these rules
   (which the exemplar pages in progressive-tests carry, and this file did not)
   the spinner was an empty, invisible div. */
.process-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.2);
    border-top-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    box-sizing: border-box;
    pointer-events: none;
}

.process-spinner.spinning {
    animation: process-spin 1s linear infinite;
}

@keyframes process-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
