h1{
    color: #082f49;
}

h4{
    color: #0c4a6e;
}

.card{
    background-color: #f9fafb !important; /* Light gray background */
}

.btn-secondary{
     background-color: #0284c7; /* Blue background */
    border-color: #0369a1;
}

.nav-link{
    color: #0369a1;
}

.btn-success{
    background-color: #10b981; /* Blue background */
    border-color: #059669;
}

body{
    background-color: #f1f5f9;
}

.nav-item{
    border: 1px solid #ddd;
    background-color: #f9fafb;
}

.nav-item .active{
    background-color: #0284c7 !important; /* Darker gray for active state */
    color: #fff !important;
}
.matrix-row {
    margin-bottom: 10px; /* Add spacing between rows */
}

#matrixGrid {
    display: flex;
    flex-direction: column; /* Ensure rows are stacked vertically */
    gap: 10px; /* Space between rows */
}

.result-container {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.result-container h3 {
    text-align: center;
    color: #333;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.result-table th, .result-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.result-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.result-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.result-table tr:hover {
    background-color: #f1f1f1;
}

.result-table td strong {
    color: #0ea5e9;
}

.result-table td i {
    color: #fb7185;
}

.result-table-container {
    overflow-x: auto;
    max-width: 100%;
}

.result-table {
    border-collapse: separate;
    min-width: 600px;
}

.result-table th:first-child,
.result-table td:first-child {
    position: sticky;
    left: 0;
    background: #f8f9fa; /*TODO: Change to white?*/
    z-index: 2;
}

/* Change background color for SDPModal */
#SDPModal .modal-content {
    background-color: #f0f8ff; /* Light blue */
}

/* Change background color for matrixModal */
#matrixModal .modal-content {
    background-color: #f0f8ff; /* Light blue */
}

/* Mode toggle switch */
.mode-switch {
    position: relative;
    display: inline-flex;
    width: 220px;
    height: 40px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid #cbd5e1;
}
.mode-switch input[type="radio"] {
    display: none;
}
.mode-switch-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
    user-select: none;
    margin: 0;
}
.mode-switch-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 4px);
    height: calc(100% - 4px);
    background: #0284c7;
    border-radius: 16px;
    transition: transform 0.3s ease;
    z-index: 1;
}
#mode-numeric-radio:checked ~ .mode-switch-slider {
    transform: translateX(calc(100% + 4px));
}
#mode-symbolic-radio:checked ~ .mode-switch-label.mode-switch-left,
#mode-numeric-radio:checked ~ .mode-switch-label.mode-switch-right {
    color: #fff;
}
#mode-help-btn {
    text-decoration: none;
    color: #0369a1;
}

/* Wider popovers so each option fits on one line */
.popover {
    max-width: 420px;
}

/* Dimension help icons */
.dim-help-btn {
    text-decoration: none !important;
    line-height: 1;
}
.dim-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #0369a1;
    color: #0369a1;
    background: #fff;
    font-size: 0.7em;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
}
.dim-help-icon-tab {
    background: #f9fafb;
}

/* Card title row: title left, mode toggle centered */
.card-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 0.75rem;
    min-height: 44px;
}
.card-title-row .card-title {
    position: absolute;
    left: 0;
    margin: 0;
}
.mode-toggle-placeholder {
    display: flex;
    align-items: center;
}
.card-title-row #mode-toggle-row {
    margin: 0;
    padding: 0;
}

/* Hide shared elements in original position; shown once JS relocates them */
body > .container > #mode-toggle-row,
body > .container > #dimension-controls {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}
.mode-toggle-placeholder #mode-toggle-row {
    visibility: visible;
    height: auto;
    overflow: visible;
}
.card-body #dimension-controls {
    visibility: visible;
    height: auto;
    overflow: visible;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Dimension controls */
#dimension-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}
#dimension-controls .dim-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
#dimension-controls label {
    font-size: 0.82em;
    color: #0c4a6e;
    margin-bottom: 0;
    white-space: nowrap;
}
#dimension-controls .form-control-sm {
    height: 2rem;
    font-size: 0.85em;
    width: 3.5rem;
}

/* Parameter row: always left-aligned regardless of which items are visible */
.param-row {
    justify-content: flex-start !important;
}

/* Sweep counter */
#sweep-counter {
    font-size: 0.82em;
    display: block;
    margin-bottom: 2px;
}

/* Invalid matrix-cell outline */
.matrix-row input.cell-invalid {
    border: 1.5px solid #dc2626;
    background-color: #fef2f2;
}
.matrix-row input.cell-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.25);
}