.viewport {
    width: 100%;
    height: 100%;
}

.viewport-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 24px;
    width: 100%;
    height: 100%;
    background: #111;
    padding: 4px;
    border-radius: 4px;
}

/* Progress Overlay Styles */
.progress-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
}

.progress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(31, 35, 39, 0.95);
    border-radius: 8px;
    border: 1px solid rgba(185, 188, 192, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.progress-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: #00c5a0;
    border-radius: 50%;
    animation: progress-spin 1s linear infinite;
}

@keyframes progress-spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-text {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.progress-bar-container {
    width: 180px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00c5a0 0%, #9ed3c9 100%);
    border-radius: 3px;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 8px rgba(74, 255, 219, 0.5);
}

/* Existing spinner - keep for initial loading */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    width: 50px;
    height: 50px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* for hemosiderosis*/
.quantidos-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
    height: 100%;
}

/* for myelin */
.quantidos-grid-2x1 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
    height: 100%;
}

/* Container for a label + input pair */
.toolbar-input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-right: 8px;
}

/* Compact label */
.toolbar-input-group label {
    font-size: 10px;
    margin: 0 0 2px 0;
    line-height: 1.1;
}

/* Compact number input */
.toolbar-input-group input {
    width: 40px;
    height: 24px;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #b9bcc0;
    background-color: #1f2327;
    color: #b9bcc0;
}

/* Toolbar input group */
#quantidos-toolbar .toolbar-input-group,
#ff-toolbar .toolbar-input-group,
#osteo-toolbar .toolbar-input-group,
#myelin-toolbar .toolbar-input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
}

#quantidos-toolbar .toolbar-input-group label,
#ff-toolbar .toolbar-input-group label,
#osteo-toolbar .toolbar-input-group label,
#myelin-toolbar .toolbar-input-group label {
    font-size: 11px;
    color: #fff;
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
}

#quantidos-toolbar .toolbar-input-group input[type="number"],
#ff-toolbar .toolbar-input-group input[type="number"],
#osteo-toolbar .toolbar-input-group input[type="number"],
#myelin-toolbar .toolbar-input-group input[type="number"] {
    width: 45px;
    height: 28px;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid #b9bcc0;
    background-color: #1f2327;
    color: #b9bcc0;
    text-align: center;
}


/* for fat fraction */
.quantidos-grid-3x1 {
    display: grid;
    grid-template-columns: 1fr 1fr 0.65fr;
    gap: 6px;
    width: 100%;
    height: 100%;
}

.quantidos-cell {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.quantidos-modal .mdl-content {
    height: 100vh;
    width: 100vw;
    border-radius: 0;
}

.quantidos-modal .mdl-body {
    flex: 1;
}

.quantidos-modal,
.ff-modal,
.osteo-modal,
.myelin-modal {
    z-index: 2000;
}

#quantidos-modal .modal-lg,
#ff-modal .modal-lg,
#osteo-modal .modal-lg,
#myelin-modal .modal-lg {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    left: 0;
}

#quantidos-modal .modal-header-details,
#ff-modal .modal-header-details,
#osteo-modal .modal-header-details,
#myelin-modal .modal-header-details {
    display: flex;
    color: #b9bcc0;
}

#quantidos-modal .modal-title,
#ff-modal .modal-title,
#osteo-modal .modal-title,
#myelin-modal .modal-title {
    font-size: 3rem;
}

#quantidos-modal .modal-patient-info,
#ff-modal .modal-patient-info,
#osteo-modal .modal-patient-info,
#myelin-modal .modal-patient-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 2rem;
}

#quantidos-modal .modal-content,
#ff-modal .modal-content,
#osteo-modal .modal-content,
#myelin-modal .modal-content {
    width: 100vw;
    border-radius: 0;
}

#quantidos-content,
#ff-content,
#osteo-content,
#myelin-content {
    overflow: auto;
}

#quantidos-modal .modal-footer,
#ff-modal .modal-footer,
#osteo-modal .modal-footer,
#myelin-modal .modal-footer {
    background-color: #1f2327;
    color: #b9bcc0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#quantidos-modal .modal-footer::before,
#quantidos-modal .modal-footer::after,
#ff-modal .modal-footer::before,
#ff-modal .modal-footer::after,
#osteo-modal .modal-footer::before,
#osteo-modal .modal-footer::after,
#myelin-modal .modal-footer::before,
#myelin-modal .modal-footer::after {
    content: none;
}

.modal-footer-left,
.modal-footer-right {
    display: flex;
}

.close-button {
    color: rgb(218, 218, 218);
}

/* Toolbar Styles */
#quantidos-toolbar,
#quantidos-selectSeriesToolbar,
#ff-toolbar,
#osteo-toolbar,
#myelin-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-right: 1rem;
}


#quantidos-toolbar button,
#ff-toolbar button,
#osteo-toolbar button,
#myelin-toolbar button {
    background-color: #1f2327;
    color: #b9bcc0;
    border: 1px solid #b9bcc0;
    font-size: 14px;
    padding: 0.25rem 0.5rem;
    margin-top: 0;
    border-radius: 4px;
}

#quantidos-toolbar select,
#quantidos-selectSeriesToolbar select,
#ff-toolbar select,
#ff-selectSeriesToolbar select,
#osteo-toolbar select,
#osteo-selectSeriesToolbar select,
#myelin-toolbar select,
#myelin-selectSeriesToolbar select {
    background-color: #1f2327;
    color: #b9bcc0;
    border: 1px solid #b9bcc0;
    font-size: 14px;
    padding: 0.25rem 0.5rem;
    margin-right: 0.5rem;
}

#quantidos-toolbar label,
#ff-toolbar label,
#osteo-toolbar label,
#myelin-toolbar label {
    font-size: 11px;
    color: #fff;
    margin-bottom: 0.125rem;
}

/* Colorbar Container*/
.colorbar-container {
    position: relative;
    min-width: 20px;
}

/* Characterization Table*/
.center-table-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    overflow: hidden;
    background: #1a1a1a;
}

.center-table-wrapper table {
    width: 100%;
    height: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    border: 2px solid #666;
    background: #222;
    text-align: center;
}

.center-table-wrapper th,
.center-table-wrapper td {
    border: 1px solid #555;
    padding: 8px 10px;
    text-align: center;
    color: #e2e2e2;
    word-wrap: break-word;
    font-size: 1.6rem;
}