body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    padding: 20px; 
    background-color: #f8f9fa; 
}
.container { max-width: 1400px; }
.chart-container, .step-list, .card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.chart-container { 
    height: 400px; 
    padding: 20px; 
}
.step-list { 
    height: 500px; 
    overflow-y: auto; 
    padding: 20px; 
    border-top: 1px solid #e9ecef;
}
.step-item {
    cursor: pointer;
    padding: 15px;
    margin: 10px 0;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.step-item:hover { background-color: #f8f9fa; }
.highlighted-step {
    background-color: #e9ecef;
    border-left: 4px solid #007bff;
}
#loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.nav-tabs .nav-link { color: #6c757d; }
.nav-tabs .nav-link.active { color: #495057; font-weight: bold; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,.5);
}

.modal-header h5 {
    margin: 0;
}

.modal-body {
    margin-top: 10px;
}

.modal-footer {
    margin-top: 20px;
    text-align: right;
}

.modal-footer .btn {
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.final-answer {
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background-color: #f8f9fa;
}

.final-answer h2 {
    margin-bottom: 15px;
}

.final-answer p {
    font-size: 1rem;
}

/* ----- Updated Styles for Best Plans Table ----- */

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    table-layout: fixed; /* Enables fixed table layout */
}

th, td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word; /* Allows long words to break and wrap */
}

th {
    background-color: #f2f2f2;
}

pre {
    margin: 0;
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    overflow: auto;
}

code {
    font-family: monospace;
}

/* Specific Column Widths */
th.id-column, td.id-column {
    width: 10%; /* Adjust as needed */
}

th.goal-column, td.goal-column {
    width: 20%; /* Adjust as needed */
}

th.best-plan-column, td.best-plan-column {
    width: 50%; /* Reduced width */
}

th.meta-column, td.meta-column {
    width: 20%; /* Adjust as needed */
}

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

/* Optional: Hover Effects for Preformatted Text */
.best-plan-column pre,
.meta-column pre {
    /* No height restrictions */
    max-height: none;
}
