body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
}

h1, h2, h3 {
    color: #333;
    font-family: "Playfair Display", "georgia", sans-serif;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.problem-setup {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

select, input[type="radio"] {
    margin: 0 5px;
}

button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

#branchBoundTree {
    margin-top: 20px;
    border: 2px solid #17a2b8;
    border-radius: 8px;
}

#treeContent svg {
    max-width: 100%;
    height: auto;
}

.btn-success {
    background-color: #28a745;
    color: white;
    font-weight: bold;
    padding: 10px 20px;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.tableau-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
}

th, td {
    border: 1px solid #dee2e6;
    text-align: center;
    padding: 8px;
    position: relative;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
}

/* Cell type styles */
.decision-cell {
    background-color: #e3f2fd !important;
}

.constraint-cell {
    background-color: #f3e5f5 !important;
}

.objective-cell {
    background-color: #e8f5e8 !important;
}

.rhs-cell {
    background-color: #fff3e0 !important;
}

.slack-cell {
    background-color: #fce4ec !important;
}

.result-cell {
    background-color: #ffeb3b !important;
    font-weight: bold;
    animation: highlight 2s ease-in-out;
}

.constraint-type {
    width: 60px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
}

@keyframes highlight {
    0% { background-color: #ffeb3b; }
    50% { background-color: #ff9800; }
    100% { background-color: #ffeb3b; }
}

input[type="number"] {
    width: 80px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: center;
    background: transparent;
}

input[type="number"]:focus {
    outline: 2px solid #007bff;
    border-color: #007bff;
}

.invalid-input {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

.legend {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 20px;
    height: 15px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

.result-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.tableau-steps {
    margin-top: 20px;
}

.tableau-step {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #17a2b8;
}

.tableau-table {
    margin-top: 10px;
    font-size: 12px;
}

.tableau-table td, .tableau-table th {
    padding: 4px 6px;
    font-size: 11px;
}

.pivot-element {
    background-color: #ff6b6b !important;
    color: white;
    font-weight: bold;
}

.entering-col {
    background-color: #4ecdc4 !important;
    color: white;
}

.leaving-row {
    background-color: #45b7d1 !important;
    color: white;
}

.instructions {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.error {
    color: #dc3545;
    font-weight: bold;
}

.success {
    color: #28a745;
    font-weight: bold;
}

.step-controls {
    margin: 10px 0;
}

.step-button {
    background-color: #6c757d;
    color: white;
    padding: 5px 10px;
    margin-right: 5px;
    font-size: 12px;
}

.step-button:hover {
    background-color: #545b62;
}

.toggle-section {
    cursor: pointer;
    user-select: none;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin: 10px 0;
}

.toggle-section:hover {
    background-color: #dee2e6;
}

.collapsible-content {
    display: none;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.optimization-type {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #e3f2fd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.binary-selection {
    background-color: #fff8e1;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

#binaryCheckboxes {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.binary-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
}