* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar h1 {
    color: #e9edeb;
    font-size: 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.form-container {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-container h2, .form-container h3 {
    color: #007f40;
    margin-bottom: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007f40;
}

.checkbox-group {
    margin: 1rem 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.route-types {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0;
}

.route-types input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-primary {
    background: #007f40;
    color: #fff;
    border: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #007f40;
}

.loading {
    text-align: center;
    padding: 3rem;
    background: #fff;
    border-radius: 8px;
    margin: 2rem 0;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007f40;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.result-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.result-card h3 {
    color: #007f40;
    margin-bottom: 1rem;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.spec-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007f40;
}

.spec-item label {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.spec-item value {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #333;
}

.info-card {
    background: #E3F2FD;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid #007f40;
}

.unused-space-info {
    background: #FFF3E0;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 1rem;
    border: 1px solid #FF6F00;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-box {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #666;
}

.part-color { background: #4CAF50; }
.clearance-color { background: #FFF3E0; border-style: dashed; border-color: #FF9800; }
.insert-color { background: #007f40; }
.partition-color { background: #000; }
.unused-length-color { background: #FFE0B2; border-style: dashed; border-color: #FF6F00; }
.unused-width-color { background: #E1BEE7; border-style: dashed; border-color: #7B1FA2; }


.view-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.view-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #007f40;
    margin-bottom: 1rem;
}

.matrix-grid {
    display: inline-block;
    border: 3px solid #007f40;
    background: #007f40;
}

.matrix-row {
    display: flex;
}

.matrix-cell {
    background: #E3F2FD;
    border: 1px solid #007f40;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #007f40;
}

.layer-stack {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
    border: 2px solid #333;
    padding: 5px;
    background: #f0f0f0;
}

.layer {
    display: flex;
    border: 1px solid #000;
    background: #E3F2FD;
    position: relative;
    padding: 5px;
}

.part-cell {
    background: #4CAF50;
    border: 1px solid #2E7D32;
    padding: 10px;
    margin: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    min-width: 30px;
}

.separator {
    background: #000;
    height: 3px;
    width: 100%;
}

.truck-viz-container {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #007f40;
    margin: 1.5rem 0;
}

.truck-info {
    margin: 1rem 0;
    padding: 1rem;
    background: #fff;
    border-radius: 4px;
}

.truck-grid {
    display: inline-block;
    padding: 10px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 4px;
}

.truck-row {
    display: flex;
}

.truck-box {
    width: 35px;
    height: 35px;
    margin: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 8px;
    font-weight: bold;
}

.truck-box.filled {
    background: #E3F2FD;
    border: 2px solid #007f40;
    color: #1976D2;
}

.truck-box.empty {
    background: #f5f5f5;
    border: 1px dashed #ccc;
    color: #999;
}

.technical-details {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.technical-details ul {
    list-style: none;
    padding: 0;
}

.technical-details li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.technical-details li:last-child {
    border-bottom: none;
}

.alternatives-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.alternatives-table th,
.alternatives-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.alternatives-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

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

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .views-grid {
        grid-template-columns: 1fr;
    }
}


.view-label {
    font-size: 0.875rem;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

.text-muted {
    color: #6c757d;
    font-size: 0.9rem;
}

.viz-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.viz-header h3 {
    color: #007f40;
    margin-bottom: 0.25rem;
}
/* Add these new styles */
.view-section-full {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    margin-bottom: 1.5rem;
    width: 100%;
}

.matrix-viz-wrapper,
.front-viz-wrapper {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 4px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
}

/* Remove or update the old views-grid */
.views-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.unused-color {
    background: #e0e0e0;
    border: 2px dashed #999;
}

.box-boundary {
    background: #000;
    border: 4px solid #000;
}