/** LAYOUT SECTION **/
* { box-sizing: border-box; }

body {
    align-items: stretch;
    display: flex;
    flex: 0 0 100%;
    flex-direction: column;
    height: 100vh;
    justify-content: space-between;
    overflow: hidden;
}

body header {
    align-items: stretch;
    display: flex;
    flex: 0 0 content;
    flex-flow: row wrap;
    justify-content: space-between;
    min-height: 2em;
    padding: 0 1em 0 1em;
}

body header .logo { max-height: 2em; }

/* Application selector hover effect */
.hover-primary:hover {
    color: #0d6efd !important;
    text-decoration: underline !important;
    transition: all 0.2s ease;
}

.hover-primary i {
    transition: transform 0.2s ease;
}

.hover-primary:hover i {
    transform: scale(1.1);
}

body main {
    align-items: stretch;
    display: flex;
    flex: 1 0 50%;
    flex-flow: column nowrap;
    justify-content: flex-start;
    min-height: 2em;
    padding: 0 1em 0 1em;
}

body footer {
    flex: 0 0 content;
    margin-top: 0.75rem;
    padding: 0 1em 0 1em;
}

.nav-link { padding: 0 .5em; }

.hover-box:hover { border: 1px solid red; }

.flex_row_break {
    flex-basis: 100%;
    height: 0;
}

.hidden { display: none !important; }

.seethrough { visibility: hidden; }

.cursor-link { cursor: pointer; }

option.applied { font-weight: bolder; }

.modal-center {
    align-items: center;
    background-color: rgb(128, 128, 128, .6);
    display: flex;
    height: 100vh;
    justify-items: center;
    position: absolute;
    width: 100vw;
}

.modal-center > article {
    background-color: white;
    border: 2px solid red;
    margin: auto;
    padding: 1em;
}

/** ULTRA-SPECIFIC DISABLED BUTTON STYLING - OVERRIDE ALL BOOTSTRAP DEFAULTS */
/* This section ensures that ALL disabled buttons maintain the blue theme, specifically targeting */
/* the workbench buttons that were showing as gray instead of light blue */

/* Most specific selectors for workbench buttons - target the exact button container and IDs */
.d-flex.flex-wrap.gap-2.mt-1 #close-reports:disabled,
.d-flex.flex-wrap.gap-2.mt-1 #close-reports[disabled],
.d-flex.flex-wrap.gap-2.mt-1 button#close-reports:disabled,
.d-flex.flex-wrap.gap-2.mt-1 button#close-reports[disabled],
#close-reports.btn-primary:disabled,
#close-reports.btn-primary[disabled],
button#close-reports.btn-primary:disabled,
button#close-reports.btn-primary[disabled] {
    background-color: #6c9bd2 !important; /* Lighter blue instead of gray */
    border-color: #6c9bd2 !important;
    color: #ffffff !important;
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* General disabled button styling for ALL primary buttons */
.btn-primary:disabled,
.btn-primary.disabled,
.btn-primary[disabled],
button.btn-primary:disabled,
button.btn-primary.disabled,
button.btn-primary[disabled] {
    background-color: #6c9bd2 !important; /* Lighter blue instead of gray */
    border-color: #6c9bd2 !important;
    color: #ffffff !important;
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Hover state for disabled buttons - no change */
.btn-primary:disabled:hover,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
button.btn-primary:disabled:hover,
button.btn-primary.disabled:hover,
button.btn-primary[disabled]:hover,
#close-reports.btn-primary:disabled:hover,
#close-reports.btn-primary[disabled]:hover {
    background-color: #6c9bd2 !important;
    border-color: #6c9bd2 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Focus state for disabled buttons - no change */
.btn-primary:disabled:focus,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
button.btn-primary:disabled:focus,
button.btn-primary.disabled:focus,
button.btn-primary[disabled]:focus,
#close-reports.btn-primary:disabled:focus,
#close-reports.btn-primary[disabled]:focus {
    background-color: #6c9bd2 !important;
    border-color: #6c9bd2 !important;
    box-shadow: none !important;
}

/* Also apply to secondary buttons for consistency */
.btn-secondary:disabled,
.btn-secondary.disabled,
.btn-secondary[disabled],
button.btn-secondary:disabled,
button.btn-secondary.disabled,
button.btn-secondary[disabled] {
    background-color: #9ca3af !important; /* Light gray for secondary */
    border-color: #9ca3af !important;
    color: #ffffff !important;
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Ensure success buttons (like Solve) also have consistent disabled styling */
.btn-success:disabled,
.btn-success.disabled,
.btn-success[disabled],
button.btn-success:disabled,
button.btn-success.disabled,
button.btn-success[disabled] {
    background-color: #86c87a !important; /* Lighter green */
    border-color: #86c87a !important;
    color: #ffffff !important;
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Specific overrides for workbench button container - ultra specific */
.col-md-3 .d-flex.flex-wrap.gap-2.mt-1 .btn-primary:disabled,
.col-md-3 .d-flex.flex-wrap.gap-2.mt-1 .btn-primary[disabled],
.col-md-3 .d-flex.flex-wrap.gap-2.mt-1 button.btn-primary:disabled,
.col-md-3 .d-flex.flex-wrap.gap-2.mt-1 button.btn-primary[disabled] {
    background-color: #6c9bd2 !important;
    border-color: #6c9bd2 !important;
    color: #ffffff !important;
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Override any Bootstrap default disabled styling that might be interfering */
.btn:disabled,
.btn.disabled,
.btn[disabled] {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Ensure no Bootstrap defaults override our specific button colors */
.btn-primary:disabled,
.btn-primary[disabled],
.btn-primary.disabled {
    background-color: #6c9bd2 !important;
    border-color: #6c9bd2 !important;
    color: #ffffff !important;
}

.btn-secondary:disabled,
.btn-secondary[disabled], 
.btn-secondary.disabled {
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
    color: #ffffff !important;
}

.btn-success:disabled,
.btn-success[disabled],
.btn-success.disabled {
    background-color: #86c87a !important;
    border-color: #86c87a !important;
    color: #ffffff !important;
}

/** SYNCFUSION STYLING SECTION */

/* for deleted rows to not disappear */

.e-hiddenrow {
    background-color: lightpink !important;
    display: table-row !important;
}

tr.e-hiddenrow td { text-decoration: line-through; }

/* to set icons only in grid toolbar */

.e-toolbar .e-tbar-btn-text, .e-toolbar .e-toolbar-items .e-toolbar-item .e-tbar-btn-text { display: none; }

/* outline search popups */

.e-excelfilter { border: 1px solid red !important; }

/* more pronounced active filter */

.e-grid .e-icon-filter.e-filtered::before {
    color: red;
    content: "\e735" !important;
}

/* alt row coloring */

.e-grid .e-altrow { background-color: #fafafa; }

/* frozen columns blue background*/

.e-leftfreeze { background-color: lightblue !important; }

.e-grid .e-headercell.filtered {
    background-color: #c2f7c2;
    color: black;
}

.e-grid .e-headercell {
    background-color: #fff;
    color: black;
}

.e-grid .e-gridheader .e-headercelldiv {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Ensure the grid container handles scrolling properly */

.grid-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden; /* Prevent the body from scrolling */
}

.grid-wrapper {
    flex: 1;
    overflow: auto; /* Enable both horizontal and vertical scrolling */
    position: relative;
}



/* Make the horizontal scrollbar sticky */

.grid-wrapper::-webkit-scrollbar {
    height: 16px; /* Adjust the height of the scrollbar */
}

.grid-wrapper::-webkit-scrollbar-thumb {
    background: #888; /* Color of the scrollbar thumb */
}

.grid-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555; /* Color of the scrollbar thumb on hover */
}

.grid-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1; /* Color of the scrollbar track */
}

.grid-wrapper {
    padding-bottom: 16px; /* Add padding to make space for the scrollbar */
}

.grid-wrapper::after {
    background: white;
    bottom: 0;
    content: '';
    display: block;
    height: 16px; /* Adjust the height to match the scrollbar height */
    position: sticky;
    z-index: 1;
}

/* Add a custom icon for e-export-pdf if not present in Syncfusion theme */

.e-export-pdf:before {
    content: "\e728"; /* Use a similar icon code as Syncfusion's PDF icon, adjust if needed */
    display: inline-block;
    font-family: 'e-icons';
    font-style: normal;
    font-weight: normal;
    speak: never;
    text-align: center;
    text-decoration: inherit;
}

/* Add a custom icon for e-excelexport if not present in Syncfusion theme */

.e-excelexport:before {
    content: "\e34b"; /* Use a similar icon code as Syncfusion's Excel icon, adjust if needed */
    display: inline-block;
    font-family: 'e-icons';
    font-style: normal;
    font-weight: normal;
    speak: never;
    text-align: center;
    text-decoration: inherit;
}

/** DATATABLES STYLING SECTION */

.dataTables_wrapper {
    align-items: flex-start;
    display: flex;
    flex: 1 1 10px;
    flex-flow: column nowrap;
    justify-content: flex-start;
}

.dataTables_filter { align-self: flex-end; }

.dataTables_scroll {
    align-items: flex-start;
    display: flex;
    flex: 1 1 10px;
    flex-flow: column nowrap;
    justify-content: flex-start;
    max-width: 99%;
}

.busy-indicator {
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    height: 100%;
    justify-content: center;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9999;
}

.spinner {
    animation: spin 2s linear infinite;
    border: 16px solid #f3f3f3;
    border-radius: 50%;
    border-top: 16px solid #3498db;
    height: 120px;
    width: 120px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }

    100% { transform: rotate(360deg); }
}

.busy-text {
    color: #333;
    font-size: 18px;
    margin-top: 20px;
}


.dataTables_scrollHead { flex: 0 0 auto; }

.dataTables_scrollBody { flex: 1 1 10px; }

.dataTables_scrollBody * { overflow: unset; }

.dataTables_scrollBody tr { overflow: visible; }

.dataTables_scrollBody td.dtfc-fixed-left { overflow: visible; }

table.dataTable td { padding: 1px 2px 1px 2px; }

.dtfc-fixed-left { background-color: lightblue !important; }

.cellSelected { outline: 2px solid yellow; }

.solveButton {
    cursor: pointer;
    height: 1.5em;
    object-fit: fill;
}

.solveButtonContainer {
    margin: 0;
    padding: 0 !important;
}

/** LEGACY SECTION **/

/* Center screen popup */

div.popup-outer {
    background: rgba(128, 128, 128, .6);
    display: none; /* start hidden */
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9999;
}

div.popup-inner {
    align-content: stretch;
    background: border-box;
    background-color: white;
    display: flex;
    flex-flow: column nowrap;
    height: 225px;
    justify-content: flex-start;
    left: 50%;
    margin-left: -200px;
    margin-top: -117px;
    position: relative;
    top: 50%;
    width: 400px;
}

/** Cool tools section **/

.rotatingBorder {
    animation-direction: reverse;
    animation-duration: .75s;
    animation-iteration-count: infinite;
    animation-name: rotatingborder;
}

@keyframes rotatingborder {
    from { border: red solid 0px; }

    to { border: red solid 5px; }
}

/* User data cell styling for Customize/ConfigureColumns */

.user-data-cell {
    background-color: #e3f2fd;
    border-radius: 4px;
    color: #0d47a1;
    font-weight: 500;
    padding-left: 8px;
}

/* Caption cell styling for Customize/ConfigureColumns */

.column-details-table th {
    color: #374151;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Selection panel styling for left area */

.selection-panel {
    background: #f3f6fb;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 1.5rem 1rem 1rem 1rem;
}

.selection-panel h4 {
    color: #0d47a1;
    font-weight: 700;
}

.selection-panel label,
.selection-panel select,
.selection-panel .btn { font-size: 1rem; }

.selection-panel select {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #0d47a1;
    font-weight: 500;
}

.selection-panel .btn-primary {
    background: #1976d2;
    border-color: #1976d2;
}

.selection-panel .btn-danger {
    background: #d32f2f;
    border-color: #d32f2f;
}

.selection-panel label.control-label {
    background: #f5f5f5;
    border-radius: 4px;
    color: #222;
    display: inline-block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0.75rem;
}

/* Editable field styling */

.editable-field {
    background: #e3f2fd;
    border-radius: 4px;
    color: #0d47a1;
    font-weight: 500;
    transition: box-shadow 0.2s;
}

.editable-field:focus, .editable-field:hover { box-shadow: 0 0 0 2px #90caf9; }

/* Non-editable field styling */

.non-editable-field {
    background: #f5f5f5;
    border-radius: 4px;
    color: #888;
    cursor: not-allowed;
    font-style: italic;
}

.scrollable-column-list {
    background: #f8fafc;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    height: 680px;
    margin-bottom: 1rem;
    max-height: 680px;
    min-height: 680px;
    overflow-y: auto;
}

/* Center main content and match panel heights */

form#mainForm > .row {
    align-items: flex-end;
    display: flex;
    flex-wrap: nowrap;
    margin: 0 auto;
    max-width: 1400px;
    min-height: 700px;
}

.selection-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-start;
    min-height: 700px;
    position: relative;
}

.col-lg-8.col-md-7.col-12 {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 700px;
}

/* Increase visible columns */

.scrollable-column-list {
    flex: 1 1 auto;
    margin-bottom: 1rem;
    max-height: 600px;
    min-height: 0;
    overflow-y: auto;
}

/* Button alignment: flex row, bottom of selection panel */

.column-list-actions {
    align-items: center;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    margin-bottom: 0;
    margin-top: auto;
    position: static;
}

.column-list-item {
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: background 0.2s;
}

.column-list-item.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 600;
}

.column-list-item:hover { background: #bbdefb; }

.column-list-label {
    background: #f5f5f5;
    border-radius: 4px;
    color: #222;
    display: inline-block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0.75rem;
}
