/* VTD Production - AG Grid styles */

/* AG Grid: header styling (background + border) */
.ag-theme-alpine .ag-header {
    background-color: #f8f8f8;
    border-bottom: 1px solid #babfc7;
}

/* Second header row (leaf columns under groups): separator line */
.ag-theme-alpine .ag-header-row:not(:first-child) .ag-header-cell:not(.ag-header-span-height.ag-header-span-total),
.ag-theme-alpine .ag-header-row:not(:first-child) .ag-header-group-cell.ag-header-group-cell-with-group {
    border-top: 1px solid #babfc7;
}

/* AG Grid: centered headers (group and column) */
.ag-theme-alpine .ag-header-group-cell-label,
.ag-theme-alpine .ag-header-cell-label {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

/* AG Grid: avoid excess padding/margin on headers */
.ag-theme-alpine .ag-header-cell,
.ag-theme-alpine .ag-header-group-cell {
    padding-left: 8px;
    padding-right: 8px;
    margin: 0;
}

/* AG Grid: two-line headers */
.ag-theme-alpine .ag-header-cell.header-two-lines .ag-header-cell-label,
.ag-theme-alpine .ag-header-cell.header-two-lines .ag-header-cell-text {
    white-space: pre-line;
    text-align: center;
    line-height: 1.2;
}

/* Taller header rows for column groups */
.processes-grid-container .ag-theme-alpine {
    --ag-header-height: 48px;
}

/* Grid container overflow */
#vtd-production-grid.processes-grid-container,
.processes-grid-container.ag-theme-alpine {
    overflow: visible;
}

/* AG Grid loading overlay */
.ag-theme-alpine .ag-overlay-loading-center {
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
}

/* Heat name link */
.vtd-heat-link {
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
}

.vtd-heat-link:hover {
    color: #0056b3;
}

/* Checkbox cells */
.vtd-checkbox {
    height: 20px;
    width: 20px;
    cursor: pointer;
    accent-color: #2196f3;
}

.vtd-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Hand Additions button in grid */
.vtd-hand-addition-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #007bff;
    font-size: 16px;
    padding: 4px 8px;
}

.vtd-hand-addition-btn:hover {
    color: #0056b3;
}

/* Warning cell style (reused by cellClassRules) */
.warning {
    background-color: red !important;
    color: #FFFFFF !important;
    font-weight: bold;
}

/* ---- Toggle switch (Hand Additions) ---- */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: 0.4s;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 17px;
    width: 17px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: 0.4s;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: #2196f3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ---- Modal styles (Hand Additions modal - not refactored) ---- */
.modal {
    width: 650px !important;
}

div#handAdditions {
    width: 750px !important;
    margin-left: -400px !important;
}

.hand-additions-items-grid-container.items-grid-container {
    margin-left: 20px;
}

.modal-body {
    width: 95%;
}

div#modal {
    width: 350px !important;
    margin-top: 40px;
}

h3#modalLabel {
    font-size: 18px;
}

#handAdditions.blur {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

#handAdditions h5 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.5em;
    padding-bottom: 15px;
    position: relative;
}

#handAdditions h5:before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 5px;
    width: 55px;
    background-color: #111;
}

#handAdditions h5:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    height: 1px;
    width: 95%;
    max-width: 255px;
    background-color: #333;
}

#handAdditions .modal-header {
    border: 0px solid #eee !important;
}

#addHandAdditionBtn {
    margin-top: 10px !important;
}

.highlight-missing-value {
    background-color: orangered;
}

.highlight-modified-row {
    background-color: #a1f5a1;
}

.handAdditionBtn {
    height: 40px !important;
    width: 40px !important;
}

/* Backgrid styles for the Hand Additions modal grid (not refactored) */
.hand-additions-items-grid-container .backgrid td {
    padding-left: 1px;
    padding-right: 1px;
    font-size: 12px;
    border-right: 0.5px solid #DDD;
    border-left: 0.5px solid #DDD;
    cursor: pointer;
}

.select-cell select {
    width: 100px;
    border: 1px solid #cccccc;
    background-color: #ffffff;
    margin-bottom: 0px;
}

th.renderable.Delete {
    border: none !important;
    background: none;
}

td.delete-cell.align-center-cell.renderable {
    border: none;
    padding: 0;
}

td.save-button-cell.align-center-cell.renderable {
    border: none;
}

button.delete-button {
    background: #f56464;
    border: 1px solid;
}

button.save-action-button {
    background: #a1f5a1;
    border: 1px solid;
    margin-left: -10px;
}

.selectedItem {
    background-color: #f8e509 !important;
}

.selectedItem td {
    font-weight: 700;
}
