/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header h1 i {
    color: #2e948b;
    margin-right: 15px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* Header Top Layout */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    transition: all 0.2s ease;
    text-decoration: none;
}

.home-btn {
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.3);
}

.home-btn:hover {
    background: linear-gradient(135deg, #FF5252, #E53E3E);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.previous-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
}

.previous-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.next-btn {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.3);
}

.next-btn:hover {
    background: linear-gradient(135deg, #44A08D, #3A9B8E);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.nav-btn i {
    font-size: 0.9rem;
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navigation-buttons {
        width: 100%;
        justify-content: flex-start;
    }
    
    .nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* Single Page Layout */
.single-page-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.main-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 3px solid #29c8e4;
    overflow: hidden;
    padding: 30px;
    animation: fadeIn 0.3s ease-in-out;
}

/* Section titles removed for cleaner interface */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Setup Tab Layout */
.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border: 4px solid #29c8e4;
    overflow: hidden;
    height: fit-content;
}

.card-header {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    padding: 15px 20px;
    border-bottom: 4px solid #29c8e4;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px;
    border-left: 6px solid #343a40;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #6c757d;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: white;
    margin-bottom: 8px;
}

.radio-label:hover {
    background: #f8f9fa;
    border-color: #17a2b8;
}

.radio-label input[type="radio"]:checked + .radio-custom + span {
    font-weight: bold;
    color: #0c5460;
}

.radio-label:has(input[type="radio"]:checked) {
    background: #b2ebf2;
    border-color: #17a2b8;
    border-width: 3px;
    box-shadow: 0 3px 12px rgba(23, 162, 184, 0.2);
}

/* Fallback for browsers that don't support :has() */
.radio-label.selected {
    background: #b2ebf2;
    border-color: #17a2b8;
    border-width: 3px;
    box-shadow: 0 3px 12px rgba(23, 162, 184, 0.2);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 3px solid #17a2b8;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    background: white;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #0c5460;
    background: #17a2b8;
    transform: scale(1.1);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Assessment Option Styles */
.option-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border: 3px solid #495057;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item:hover {
    border-color: #007bff;
    border-width: 4px;
    background: #f8fbff;
}

.option-item input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
    transform: scale(1.2);
}

.option-item input[type="radio"]:checked {
    accent-color: #3498db;
}

.option-content strong {
    color: #2c3e50;
    font-size: 0.95rem;
}

.option-content p {
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 0.85rem;
}

/* PDE Reference Styles */
.pde-display p {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.pde-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.pde-item {
    background: linear-gradient(135deg, #e0f7fa, #b3e5fc);
    padding: 10px;
    border: 2px solid #29c8e4;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(41, 200, 228, 0.15);
}

.pde-symbol {
    font-weight: bold;
    color: #0c5460;
}

.pde-value {
    color: #0c5460;
    margin-top: 2px;
    font-weight: 500;
}

/* Element Selection Section */
.element-selection-section {
    background: white;
    border-radius: 10px;
    border: 3px solid #17a2b8;
    padding: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 4px solid #0c5460;
    background: linear-gradient(90deg, #b2ebf2 0%, #80deea 100%);
    margin: -25px -25px 25px -25px;
    padding: 15px 25px;
    border-top: 2px solid #17a2b8;
}

.section-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selection-summary {
    display: flex;
    align-items: center;
    gap: 20px;
}

.selection-summary span {
    font-size: 1.1rem;
    color: #495057;
}

.selection-summary strong {
    color: #3498db;
}

/* Compact Element Tabs */
.element-tabs-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 3px solid #17a2b8;
}

.element-tab-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f8f9fa;
    border-bottom: 3px solid #0c5460;
}

.element-tab-btn {
    padding: 15px 10px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-direction: column;
    text-align: center;
}

.element-tab-btn:hover {
    background: rgba(255,255,255,0.7);
    color: #495057;
}

.element-tab-btn.active {
    background: white;
    color: #0c5460;
    border-bottom: 4px solid #17a2b8;
    border-left: 2px solid #138496;
    border-right: 2px solid #138496;
    font-weight: 700;
}

.element-tab-btn i {
    font-size: 1.1rem;
}

.class-badge {
    background: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 2px;
}

.element-tab-btn.active .class-badge {
    background: #17a2b8;
}

.element-tab-content {
    padding: 15px;
    min-height: 300px;
    /* Removed max-height and overflow to eliminate scrollbar */
}

.element-tab-pane {
    display: none;
}

.element-tab-pane.active {
    display: block;
}

.elements-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

/* Element Class Styles */
.elements-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.element-class {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.class-title {
    padding: 15px 20px;
    margin: 0;
    font-size: 1.1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.class-1 { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.class-2a { background: linear-gradient(135deg, #f39c12, #e67e22); }
.class-2b { background: linear-gradient(135deg, #3498db, #2980b9); }
.class-3 { background: linear-gradient(135deg, #27ae60, #229954); }

/* Elements Grid */
.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.element-card {
    background: white;
    border: 3px solid #17a2b8;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.2);
}

.element-card:hover {
    border-color: #0c5460;
    border-width: 4px;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(12, 84, 96, 0.3);
}

.element-card.selected {
    border-color: #20c997;
    border-width: 4px;
    background: #e8f7f5;
    box-shadow: 0 8px 25px rgba(32, 201, 151, 0.3);
}

.element-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    border: 3px solid #adb5bd;
}

.element-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.element-symbol {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0c5460;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #17a2b8;
}

.element-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #27ae60;
}

.element-name {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.element-pde {
    font-size: 0.85rem;
    color: #495057;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Assessment status badges removed for cleaner design */

.intentional-toggle {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 2px solid #17a2b8;
}

.intentional-toggle label {
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Calculation Section */
.calculation-section, .results-section {
    padding: 20px;
    border: 3px solid #17a2b8;
    border-radius: 8px;
    background: white;
}

.calculation-summary, .results-summary {
    display: flex;
    align-items: center;
    gap: 20px;
}

.calculation-summary span, .results-summary span {
    font-size: 1rem;
    color: #495057;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    color: #bdc3c7;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #495057;
    margin-bottom: 10px;
}

/* Calculation Content */
.calculation-content {
    margin-top: 25px;
}

.option-summary {
    background: #e8f4fd;
    border: 1px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.option-summary h3 {
    color: #2980b9;
    margin-bottom: 10px;
}

/* Tables */
.results-table, .calculation-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid #17a2b8;
    margin: 20px 0;
}

.results-table th, .calculation-table th,
.results-table td, .calculation-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #6c757d;
    border-right: 2px solid #adb5bd;
}

.results-table th, .calculation-table th {
    background: #17a2b8;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.results-table tbody tr:hover, .calculation-table tbody tr:hover {
    background: #f8f9fa;
}

.concentration-input {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.concentration-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* Status Indicators */
.status-pass {
    color: #27ae60;
    font-weight: bold;
}

.status-fail {
    color: #e74c3c;
    font-weight: bold;
}

.exceeds-limit {
    background-color: #f8d7da !important;
    color: #721c24;
    font-weight: bold;
}

.exceeds-pde {
    background-color: #fff3cd !important;
    color: #856404;
    font-weight: bold;
}

.compliance-status {
    text-align: center;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-size: 1.3rem;
    font-weight: bold;
}

.compliance-status.pass {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.compliance-status.fail {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
}

.export-buttons {
    display: flex;
    gap: 10px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .setup-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .setup-grid .card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .setup-grid {
        grid-template-columns: 1fr;
    }
    
    /* Section title responsive styles removed */
    
    .main-section {
        padding: 20px;
    }
    
    .elements-grid {
        grid-template-columns: 1fr;
    }
    
    .elements-grid-compact {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 8px;
    }
    
    .element-tab-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .element-tab-btn {
        font-size: 0.8rem;
        padding: 12px 8px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .selection-summary, .calculation-summary, .results-summary {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .radio-group {
        gap: 8px;
    }
    
    .elements-grid {
        padding: 15px;
        gap: 10px;
    }
    
    .element-card {
        padding: 8px;
    }
    
    .export-buttons {
        flex-direction: column;
        width: 100%;
    }
}

/* ============================================
   Option 2b Styles - Component Analysis
   ============================================ */

.option2b-section {
    background: white;
    border: 3px solid #17a2b8;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.option2b-section h4 {
    color: #0c5460;
    font-size: 1.2rem;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #b2ebf2;
}

.option2b-section .section-note {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-style: italic;
}

/* Preset Selector */
.preset-selector {
    background: #e8f7f5;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid #17a2b8;
}

.preset-selector label {
    font-weight: 600;
    color: #0c5460;
}

.preset-selector select {
    padding: 8px 15px;
    border: 2px solid #17a2b8;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    background: white;
    min-width: 300px;
}

.preset-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.2);
}

/* Option 2b Component Summary in Results */
.option2b-summary {
    background: #f8f9fa;
    border: 3px solid #17a2b8;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.option2b-summary h4 {
    color: #0c5460;
    margin-bottom: 15px;
}

.option2b-summary h4 i {
    margin-right: 10px;
}

.component-summary-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.component-summary-table th,
.component-summary-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.component-summary-table th {
    background: #17a2b8;
    color: white;
    font-weight: 600;
}

.component-summary-table tbody tr:hover {
    background: #f8f9fa;
}

/* Notification Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Component Table */
.component-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 3px solid #17a2b8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.component-table th,
.component-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.component-table th {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    font-weight: 600;
}

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

.component-table .total-row {
    background: #e8f7f5;
    font-weight: bold;
}

.component-table .total-row td {
    border-top: 3px solid #17a2b8;
}

.component-name-input,
.component-intake-input {
    width: 100%;
    max-width: 250px;
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.component-name-input:focus,
.component-intake-input:focus {
    border-color: #17a2b8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.2);
}

.component-intake-input {
    max-width: 120px;
    text-align: center;
}

.btn-add-component,
.btn-remove-component {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-add-component {
    background: #17a2b8;
    color: white;
}

.btn-add-component:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-remove-component {
    background: #dc3545;
    color: white;
}

.btn-remove-component:hover:not(:disabled) {
    background: #c82333;
}

.btn-remove-component:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Component Validation */
.component-validation {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.component-validation.valid {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.component-validation.warning {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.component-validation i {
    font-size: 1.1rem;
}

/* Concentration Matrix Table */
.concentration-table-wrapper {
    overflow-x: auto;
    margin: 15px 0;
}

.concentration-matrix-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 3px solid #17a2b8;
    border-radius: 8px;
    overflow: hidden;
    min-width: 600px;
}

.concentration-matrix-table th,
.concentration-matrix-table td {
    padding: 10px 12px;
    text-align: center;
    border: 2px solid #dee2e6;
}

.concentration-matrix-table th {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

.concentration-matrix-table th small {
    display: block;
    font-weight: normal;
    opacity: 0.9;
}

/* Transposed table - Components as rows, Elements as columns */
.concentration-matrix-table.transposed .component-header-main {
    text-align: left;
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    min-width: 180px;
    font-weight: 600;
}

.concentration-matrix-table.transposed .intake-header {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    min-width: 100px;
    text-align: center;
}

.concentration-matrix-table.transposed .element-col-header {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    min-width: 90px;
    text-align: center;
    font-weight: 600;
}

.concentration-matrix-table.transposed .element-col-header small {
    display: block;
    font-weight: normal;
    opacity: 0.9;
    font-size: 0.75rem;
}

.concentration-matrix-table.transposed .component-name-cell {
    text-align: left;
    background: #f8f9fa;
    font-weight: 500;
    color: #0c5460;
    min-width: 180px;
    padding: 10px 12px;
}

.concentration-matrix-table.transposed .intake-cell {
    text-align: center;
    background: #e8f7f5;
    font-weight: 500;
    min-width: 100px;
}

.concentration-matrix-table.transposed .conc-input-cell {
    min-width: 90px;
    padding: 6px;
    text-align: center;
}

.concentration-matrix-table.transposed tfoot .totals-row td {
    background: #fff3cd;
    font-weight: bold;
    border-top: 3px solid #17a2b8;
}

.concentration-matrix-table.transposed tfoot .status-row td {
    background: #f8f9fa;
}

.concentration-matrix-table.transposed .daily-intake-cell {
    text-align: center;
    font-weight: bold;
}

.concentration-matrix-table.transposed .status-cell {
    text-align: center;
}

/* Legacy styles for non-transposed table */
.concentration-matrix-table .element-header,
.concentration-matrix-table .element-cell {
    text-align: left;
    background: #f8f9fa;
    font-weight: 600;
    color: #0c5460;
    min-width: 60px;
}

.concentration-matrix-table .pde-header,
.concentration-matrix-table .pde-cell {
    min-width: 80px;
    background: #e8f7f5;
}

.concentration-matrix-table .component-header {
    min-width: 120px;
}

.concentration-matrix-table .conc-input-cell {
    min-width: 100px;
    padding: 8px;
}

.concentration-matrix-table .calculated-header,
.concentration-matrix-table .daily-intake-cell {
    min-width: 100px;
    background: #fff3cd;
    font-weight: bold;
}

.concentration-matrix-table .status-header,
.concentration-matrix-table .status-cell {
    min-width: 120px;
}

.concentration-matrix-table tbody tr:hover {
    background: #f0f9fa;
}

.matrix-conc-input {
    width: 90px;
    padding: 8px 10px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    /* Remove spinner arrows */
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Hide spinner arrows in WebKit browsers */
.matrix-conc-input::-webkit-outer-spin-button,
.matrix-conc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.matrix-conc-input:focus {
    border-color: #17a2b8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.4);
    background: #e8f7f5;
}

.matrix-conc-input::placeholder {
    color: #adb5bd;
}

/* Component intake inputs - also remove spinners */
.component-intake-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

.component-intake-input::-webkit-outer-spin-button,
.component-intake-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Weight Percent Column */
.weight-percent-cell {
    text-align: center;
    font-weight: 600;
    color: #0c5460;
    background: #e8f7f5;
}

/* Specification Table (Option 2b simplified) */
.specification-table {
    width: 100%;
    border-collapse: collapse;
    border: 3px solid #17a2b8;
    margin-top: 15px;
}

.specification-table th,
.specification-table td {
    padding: 12px 10px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.specification-table thead th {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    font-weight: 600;
}

.specification-table .component-header-main {
    text-align: left;
    min-width: 180px;
}

.specification-table .weight-header,
.specification-table .weight-cell {
    min-width: 80px;
    background: #e8f7f5;
    color: #0c5460;
    font-weight: 600;
}

.specification-table .element-col-header {
    min-width: 100px;
}

.specification-table .element-col-header small {
    display: block;
    font-weight: normal;
    opacity: 0.9;
}

.specification-table tbody tr {
    background: white;
}

.specification-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.specification-table tbody tr:hover {
    background: #e8f7f5;
}

.specification-table .component-name-cell {
    text-align: left;
    color: #0c5460;
}

.specification-table .spec-value-cell {
    background: #fff3cd;
    color: #856404;
    font-size: 1rem;
}

.specification-table tfoot .product-spec-row td {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    font-weight: bold;
}

.specification-table tfoot .product-spec-cell {
    font-size: 1.1rem;
}

/* Spec Note */
.spec-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #e8f7f5, #d1ecf1);
    border-left: 4px solid #17a2b8;
    border-radius: 4px;
    color: #0c5460;
    font-size: 0.9rem;
}

.spec-note i {
    color: #17a2b8;
    font-size: 1.1rem;
    margin-top: 2px;
}

/* Footer Rows */
.spec-row td {
    background: linear-gradient(135deg, #e8f7f5, #d1ecf1);
    color: #0c5460;
    font-weight: 600;
}

.daily-intake-row td {
    background: #fff3cd;
    color: #856404;
    font-weight: 600;
}

.status-row td {
    background: #f8f9fa;
}

.status-cell {
    text-align: center;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.pending {
    background: #e9ecef;
    color: #6c757d;
}

.status-badge.pass {
    background: #d4edda;
    color: #155724;
}

.status-badge.fail {
    background: #f8d7da;
    color: #721c24;
}

/* Option 2b Actions */
.option2b-actions {
    text-align: center;
    margin: 25px 0;
}

.btn-calculate-option2b {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-calculate-option2b:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

.btn-calculate-option2b i {
    margin-right: 10px;
}

/* Responsive Option 2b Styles */
@media (max-width: 768px) {
    .concentration-table-wrapper {
        margin: 10px -10px;
    }
    
    .matrix-conc-input {
        width: 60px;
        font-size: 0.8rem;
        padding: 4px 6px;
    }
    
    .concentration-matrix-table th,
    .concentration-matrix-table td {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    
    .component-name-input {
        max-width: 150px;
    }
}