/* Basic styles for the decision support tool */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    padding: 36px 24px 32px 24px;
    box-sizing: border-box;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 20px 16px;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .step {
        padding: 20px 16px;
        margin: 0;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 5px;
        padding: 16px 12px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .step {
        padding: 16px 12px;
    }
}

.step {
    min-height: 400px;
    border: 1px solid #dee2e6;
    padding: 30px;
    margin: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.step-content {
    margin-top: 20px;
}

#step-container {
    min-height: 400px;
}

.btn {
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px; /* Simpler rectangle */
    padding: 8px 18px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: none; /* Remove shadows */
}

.btn:hover {
    background: #5a67d8;
}

.llm-config-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px; /* Simpler rectangle */
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    box-shadow: none; /* Remove shadows */
}

h1 {
    color: #334e68;
    margin-top: 0;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.summary-box {
    background: #f1f8e9;
    border-left: 4px solid #43a047;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 24px;
    color: #222;
}

/* Pugh Matrix table styles for common functions */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.matrix-table th, .matrix-table td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: center;
    vertical-align: middle;
}

.matrix-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.matrix-table.pugh-matrix td.positive {
    background-color: #d4edda;
    color: #155724;
    font-weight: bold;
    font-size: 16px;
}

.matrix-table.pugh-matrix td.negative {
    background-color: #f8d7da;
    color: #721c24;
    font-weight: bold;
    font-size: 16px;
}

.matrix-table.pugh-matrix td.neutral {
    background-color: #fff3cd;
    color: #856404;
    font-weight: bold;
    font-size: 16px;
}

.matrix-table.pugh-matrix td.total-score {
    background-color: #e2e3e5;
    font-weight: bold;
    font-size: 14px;
}

.matrix-table.pugh-matrix td.baseline-score {
    background-color: #f8f9fa;
    font-style: italic;
    color: #6c757d;
}

.matrix-table.pugh-matrix th.baseline-header {
    background-color: #f8f9fa;
    font-style: italic;
    color: #6c757d;
}

.matrix-table.reasons-matrix td.reason-cell {
    text-align: left;
    padding: 8px;
    font-size: 12px;
    white-space: pre-wrap;
    max-width: 200px;
}

.matrix-table td.breakdown-cell {
    text-align: left;
    font-size: 12px;
    max-width: 200px;
}

.matrix-table td.positive {
    background-color: #d4edda;
    color: #155724;
}

.matrix-table td.negative {
    background-color: #f8d7da;
    color: #721c24;
}

.matrix-table td.neutral {
    background-color: #fff3cd;
    color: #856404;
}

/* Test mode banner styles */
.test-mode-banner {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.test-mode-banner h3 {
    margin: 0;
    font-size: 18px;
}

.test-mode-banner p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Matrix info styles */
.matrix-info {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
}

.matrix-info h3 {
    margin-top: 0;
    color: #0056b3;
}

.matrix-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.matrix-info li {
    margin: 5px 0;
}

/* Recommendation section styles */
.recommendation-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.recommendation-section h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    text-align: center;
}

.top-solution {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #ffd700;
}

.top-solution h3 {
    margin: 0 0 10px 0;
    color: #ffd700;
    font-size: 20px;
}

.score-breakdown {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.score-breakdown h4 {
    margin: 0 0 10px 0;
    color: #ffd700;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.breakdown-item:last-child {
    border-bottom: none;
    font-weight: bold;
    color: #ffd700;
}

.baseline-indicator {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-style: italic;
}

/* Edit controls styles */
.edit-controls {
    margin: 20px 0;
    text-align: center;
    display: none;
}

.edit-controls button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.edit-controls button:hover {
    opacity: 0.8;
}

.btn-danger { /* Centralized style for Clear All button */
    background-color: #f8f9fa !important; /* Light grey, similar to .collapsible */
    color: #333; /* Darker text */
    border: 1px solid #dee2e6 !important; /* Add a border */
    border-radius: 4px;
}

.btn-danger:hover {
    background-color: #e9ecef;
}

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

/* Step Navigation Styles - Older Formatting */
.workflow-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* Distribute items with space between them */
    align-items: center;
    margin-bottom: 10px;
    gap: 15px;
}


.collapsible {
    flex: 0 0 auto;
    width: auto; /* Ensure it only takes needed width based on content */
    max-width: fit-content; /* Max width to fit content */
    background-color: #f8f9fa;
    color: #333;
    cursor: pointer;
    padding: 15px;
    border: 1px solid #dee2e6;
    text-align: left;
    outline: none;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px; /* Simpler rectangle */
    transition: background-color 0.3s, border-color 0.3s;
    box-shadow: none; /* Remove shadows */
}

.collapsible:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.collapsible.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* The Clear All button is now a direct child of workflow-controls */
.workflow-controls .btn-danger {
    margin-left: auto; /* Push Clear All button to the right */
    margin-bottom: 0;
}

/* LLM Configuration Panel Toggle */
.content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 18px;
    margin-bottom: 0;
}

.content.show {
    max-height: 500px;
    padding: 18px;
    margin-bottom: 20px; /* Add margin to push content below */
}

/* Ensure step content is visible when active */
.step.show {
    display: block !important;
}



.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

/* Solutions table specific styles */
.solutions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.solutions-table th, .solutions-table td {
    border: 1px solid #dee2e6;
    padding: 12px 8px;
    text-align: left;
    vertical-align: middle;
}

.solutions-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.solutions-table tbody tr:hover {
    background-color: #f8f9fa;
}

.solutions-table tbody tr.baseline-row {
    background-color: #fff3cd !important;
}

.solutions-table .editable-cell {
    cursor: pointer;
    transition: background-color 0.2s;
}

.solutions-table .editable-cell:hover {
    background-color: #e9ecef;
}

.solutions-table .actions-cell {
    text-align: center;
    vertical-align: middle;
    background-color: #ffffff;
}

.solutions-table .baseline-label {
    color: #28a745;
    font-weight: 600;
    font-size: 12px;
    background-color: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Small remove buttons with X */
.btn-small {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-small.btn-danger {
    background-color: #dc3545; /* Bootstrap danger red */
    color: white;
    font-weight: 600;
    border: 1px solid #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
    transition: all 0.2s ease;
}

.btn-small.btn-danger:hover {
    background-color: #c82333; /* Darker red on hover */
    border-color: #bd2130;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    transform: translateY(-1px);
}

.btn-small.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.4);
}

/* Remove button specific styling for solutions table */
.solutions-table .btn-small.btn-danger {
    font-size: 14px !important;
    padding: 4px 8px !important;
    min-width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background-color: #dc3545 !important;
    color: white !important;
    border: 1px solid #dc3545 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.solutions-table .btn-small.btn-danger:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4) !important;
    transform: scale(1.1) !important;
}

.solutions-table .btn-small.btn-danger:active {
    transform: scale(0.95) !important;
}

/* Criteria table specific styles */
#criteria-table .actions-cell {
    text-align: center;
    vertical-align: middle;
    background-color: #ffffff;
}

#criteria-table .btn-small.btn-danger {
    font-size: 14px !important;
    padding: 4px 8px !important;
    min-width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background-color: #dc3545 !important;
    color: white !important;
    border: 1px solid #dc3545 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

#criteria-table .btn-small.btn-danger:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4) !important;
    transform: scale(1.1) !important;
}

#criteria-table .btn-small.btn-danger:active {
    transform: scale(0.95) !important;
}

/* Mobile Responsive Tables */
@media (max-width: 768px) {
    .matrix-table, .solutions-table, #criteria-table {
        font-size: 12px;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .matrix-table th, .matrix-table td,
    .solutions-table th, .solutions-table td,
    #criteria-table th, #criteria-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    .matrix-table th:first-child,
    .solutions-table th:first-child,
    #criteria-table th:first-child {
        position: sticky;
        left: 0;
        background: #f8f9fa;
        z-index: 10;
    }
}

@media (max-width: 480px) {
    .matrix-table, .solutions-table, #criteria-table {
        font-size: 10px;
    }
    
    .matrix-table th, .matrix-table td,
    .solutions-table th, .solutions-table td,
    #criteria-table th, #criteria-table td {
        padding: 4px 2px;
        font-size: 10px;
    }
}

/* Mobile Responsive Forms */
@media (max-width: 768px) {
    .workflow-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .workflow-controls .btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .llm-config-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .llm-config-group {
        width: 100%;
    }
    
    .llm-config-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .llm-config-buttons .btn {
        width: 100%;
    }
}

/* Mobile Responsive Grid Layouts */
@media (max-width: 768px) {
    .ranked-solutions {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .solution-card {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .solution-card .rank-badge {
        margin-bottom: 8px !important;
    }
}

/* Mobile Responsive Modals */
@media (max-width: 768px) {
    .solution-chat-modal > div {
        width: 95% !important;
        max-width: none !important;
        margin: 10px !important;
        padding: 20px !important;
    }
    
    .solution-chat-modal textarea {
        height: 80px !important;
    }
    
    .solution-chat-modal .btn {
        width: 100% !important;
        margin: 5px 0 !important;
    }
}

/* Mobile Responsive Buttons */
@media (max-width: 768px) {
    .btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly minimum size */
    }
    
    .btn-small {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }
    
    .btn-small.btn-danger {
        min-width: 36px !important;
        height: 36px !important;
    }
}

/* Mobile Responsive Text */
@media (max-width: 768px) {
    p, label, span {
        font-size: 14px;
        line-height: 1.4;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    h4 {
        font-size: 16px;
    }
} 