/* =========================
   GLOBAL
   ========================= */

*, *::before, *::after {
    box-sizing: border-box;
}

/* =========================
   DIALOG FULLSCREEN
   ========================= */

.fullscreen-dialog {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    overflow-x: hidden;
}

.fullscreen-dialog .md-dialog-content,
.ai-stepper,
.ai-stepper-row.data .cell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.fullscreen-dialog .md-dialog-content,
.ai-stepper {
    overflow: hidden;
}

/* =========================
   STEPPER STRUCTURE
   ========================= */

.ai-stepper {
    padding: 0 10px;
}

.ai-stepper-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

/* =========================
   LINE 1 – TRACK
   ========================= */

.ai-stepper-row.track {
    height: 96px;
    margin-bottom: 5px;
}

.ai-stepper-row.track .bar,
.ai-stepper-row.track .bar-progress {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
}

.ai-stepper-row.track .bar {
    left: 0;
    right: 0;
    background: #e0e0e0;
    z-index: 1;
}

.ai-stepper-row.track .bar-progress {
    left: 0;
    background: #A3D039;
    z-index: 2;
    transition: width 0.4s ease;
}

.ai-stepper-row.track .cell {
    display: flex;
    justify-content: center;
    z-index: 3;
}

/* =========================
   CIRCLES
   ========================= */

.circle,
.tiny-circle {
    border-radius: 50%;
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle {
    width: 72px;
    height: 72px;
}

.tiny-circle {
    width: 20px;
    height: 20px;
}

.cell.active .circle,
.cell.running .circle {
    background: #77C6CB;
    animation: stepPulse 1.6s ease-in-out infinite;
}

.cell.done .circle { background: #A3D039; }
.cell.disabled .circle { background: #bdbdbd; }
.cell.error .circle { background: #c62828; }

.circle md-icon {
    width: 36px;
    height: 36px;
    fill: white;
}

@keyframes stepPulse {
    0%   { transform: scale(1); box-shadow: 0 0 0 0 rgb(119,198,203); }
    50%  { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(63,81,181,0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(63,81,181,0); }
}

/* =========================
   LINE 2 – LABELS
   ========================= */

.ai-stepper-row.labels .cell,
.ai-stepper-row.actions .cell {
    text-align: center;
}

.title {
    font-size: 16px;
    font-weight: 500;
}

.progress {
    font-size: 14px;
    color: #77C6CB;
}

.progress.done {
    color: #A3D039;
    font-weight: 600;
}

.error-message {
    color: #c62828;
    font-weight: 300;
}

.info-message {
    color: #a8a8a8;
}

/* =========================
   LINE 4 – DATA
   ========================= */

.selected-contradiction {
    border: #A3D039 2px solid;
}

ai-step-data-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ai-stepper-row.data {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    margin-top: 10px;
    gap: 10px;
    align-items: stretch;
}

.parameter-card {
    position: relative;
}

/* =========================
   BADGES
   ========================= */

.parameters-warning md-icon {
    color: white;
    margin: 0;

}

.parameters-warning {
    background-color: #c62828;
    color:white;
    display: flex;
    justify-content: flex-start;
    gap: 5px;
    align-items: center;
    border-radius: 5px;
    padding: 2px 6px;
}

.ai-badge,
.ai-badge-inline {
    background-color: #673ab7;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 5px;
    text-transform: uppercase;
    pointer-events: none;
    padding: 2px 6px;
    letter-spacing: 0.5px;
}

.ai-badge {
    position: absolute;
    top: 6px;
    right: 6px;
}

.ai-badge-inline {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    line-height: 1;
    vertical-align: middle;
}

/* =========================
   DATA TABLE
   ========================= */

.data-container {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    min-height: 0;
    background: #fafafa;
}

.data-table,
.md-table-bordered {
    width: 100%;
    border-collapse: collapse;
    background-color: #fafafa;
}

.data-table {
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: #f5f5f5;
    font-weight: 600;
    z-index: 1;
}

.md-table-bordered th,
.md-table-bordered td {
    border: 1px solid rgba(0,0,0,0.12);
    padding: 8px 12px;
}

.md-table-bordered thead tr {
    background-color: rgba(0,0,0,0.04);
}

/* =========================
   EMPTY STATE
   ========================= */

.no-data {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #9e9e9e;
    border: 1px dashed #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

/* =========================
   BUTTONS
   ========================= */

.run-pipeline-button {
    display: inline-flex;
    align-items: center;
}

.run-pipeline-button .pipeline-icon {
    font-size: 28px;
}

.run-pipeline-button:hover { transform: translateY(-1px); }
.run-pipeline-button:active { transform: translateY(0); }

.fixed-icon-button {
    min-width: 36px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

button.save-button:not([disabled]),
button.save-button:not([disabled]) md-icon
{
    color: #F2F2F2;
}
.md-button.save-button.md-raised{
    background-color: #A3D039;
}

.md-button.save-button:not([disabled]):hover{
    background-color: #adce5f;
}

.md-button.save-button.md-raised:disabled{
    background-color: #b5c68c;
}

.fixed-icon-button md-icon {
    width: 24px;
    height: 24px;
    line-height: 24px;
}

/* =========================
   OVERLAY
   ========================= */

.pipeline-confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-box {
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    width: 480px;
    max-width: 90%;
}

/* =========================
   UTILITIES
   ========================= */
.kpartialsolution-color,
.pe-improved,
.solution-section-title.positive {
    color: #A3D039;
}

.kproblem-color,
.pe-degraded,
.solution-section-title.negative {
    color: #CC6600;
}

.line-break {
    line-break: anywhere;
}

/* =========================
   TRIZ / SOLUTIONS
   ========================= */

.triz-param-card {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
    background-color: #fafafa;
}

.contradiction-summary {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contradiction-summary-compact {
    font-size: 13px;
    line-height: 1.4;
}

.solution-summary {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

.solution-section {
    margin-top: 12px;
}

.solution-section-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.solution-col {
    padding-right: 8px;
}

/* =========================
   MISC
   ========================= */

.schema-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: rgba(0,0,0,0.6);
}

.project-title {
    margin: 0 8px 0 0;
    white-space: nowrap;
}

.project-change-button {
    width: 40px;
    height: 40px;
}

/* =========================
   OVERLAY
   ========================= */

.save-confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.save-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 1200px;
    max-width: 95%;
    color: #333;
    text-align: center;
}

/* =========================
   SLIDER WRAPPER
   ========================= */

.save-slider-wrapper {
    position: relative;
    margin: 120px 60px 20px 60px;
}

/* =========================
   ICONS ROW
   ========================= */

.save-icons-row {
    position: absolute;
    top: -80px;
    left: 0;
    right: 0;
    height: 60px;
}

.save-icon {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.save-icon .step-title {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.save-icon.active .step-title {
    color: #A3D039;
    font-weight: 600;
}

.save-icon .circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #bdbdbd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
}

.save-icon.active .circle {
    background: #A3D039;
    transform: scale(1.1);
}

.save-icon md-icon {
    font-size: 36px;
    color: white;
}

/* =========================
   RANGE SLIDER
   ========================= */

#save-range-slider .md-thumb:after, #save-range-slider .md-track-fill{
    background-color: #A3D039 !important;
    border-color: #A3D039 !important;
}
#save-range-slider .md-focus-thumb, #save-range-slider .md-focus-ring{
    background-color: #A3D039;
}


/* =========================
   TOASTS
   ========================= */

.ai-success-toast .md-toast-content, .ai-error-toast .md-toast-content {
    border-radius: 10px;
}

.ai-success-toast .md-toast-content{
    background-color: #A3D039;
}

.ai-error-toast .md-toast-content{
    background-color: #c62828;
}