/* Lab 9: The Assembly Line 2.0 Styles */

/* Base styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    color: #212121;
}

/* Chapter content styling */
.highlight {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.highlight-info {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
}

.highlight-warning {
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
}

.highlight-error {
    background: #FFEBEE;
    border-left: 4px solid #F44336;
}

.highlight-success {
    background: #E8F5E9;
    border-left: 4px solid #4CAF50;
}

/* Interactive demo styling */
.interactive-demo {
    margin: 30px 0;
}

.production-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
}

/* Step cards */
.step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.step-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.step-number {
    width: 30px;
    height: 30px;
    background: #2196F3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Branch visualization */
.branch-system {
    margin: 20px 0;
}

.main-branch {
    margin-bottom: 30px;
}

.branch-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.branch-line {
    height: 80px;
    background: #E0E0E0;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    border: 2px solid #BDBDBD;
}

.main-line {
    background: linear-gradient(to right, #E3F2FD 0%, #BBDEFB 100%);
    border-color: #2196F3;
}

.feature-line {
    background: linear-gradient(to right, #FFF3E0 0%, #FFE0B2 100%);
    border-color: #FF9800;
}

.component-flow {
    display: flex;
    gap: 10px;
    padding: 10px;
    height: 100%;
    align-items: center;
}

.component {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.component.engine { background: #FFEBEE; color: #C62828; }
.component.transmission { background: #E8F5E9; color: #2E7D32; }
.component.brakes { background: #E3F2FD; color: #1565C0; }
.component.wheels { background: #FFF3E0; color: #F57C00; }
.component.body { background: #F3E5F5; color: #6A1B9A; }

.component.developing { opacity: 0.7; border: 2px dashed #999; }
.component.ready { border: 2px solid #4CAF50; }
.component.failed { background: #FFCDD2; color: #D32F2F; }
.component.fixing { background: #FFF3E0; color: #F57C00; border: 2px dashed #F57C00; }

/* Feature toggles */
.toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Trunk-based visualization */
.trunk-system {
    margin: 20px 0;
}

.production-flow {
    background: linear-gradient(to right, #E8F5E9 0%, #C8E6C9 100%);
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.component-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.component.active {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

.component.inactive {
    opacity: 0.4;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.toggle-indicator {
    display: inline-block;
    margin-left: 8px;
    font-size: 10px;
    padding: 2px 6px;
    background: #E0E0E0;
    border-radius: 10px;
    font-weight: bold;
}

.component.active .toggle-indicator {
    background: #4CAF50;
    color: white;
}

/* Comparison styles */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.model-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.model-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.model-content {
    padding: 20px;
}

.metric {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #E0E0E0;
}

.metric .value {
    font-weight: 500;
}

.metric .value.low { color: #4CAF50; }
.metric .value.medium { color: #FF9800; }
.metric .value.high { color: #F44336; }

.pros-cons {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.pros-cons li {
    padding: 5px 0;
    padding-left: 24px;
    position: relative;
}

.pros-cons li.pro:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

.pros-cons li.con:before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #F44336;
    font-weight: bold;
}

/* Scenario tabs */
.scenario-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: #E0E0E0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: #2196F3;
    color: white;
}

/* Timeline styles */
.timeline {
    margin: 20px 0;
}

.timeline-item {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    border-left: 3px solid #E0E0E0;
    margin-left: 10px;
    padding-left: 20px;
}

.timeline-item.good {
    border-color: #4CAF50;
}

.timeline-item.bad {
    border-color: #F44336;
}

.timeline-item .time {
    font-weight: 500;
    color: #666;
    min-width: 80px;
}

/* Approach comparison */
.approach-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.approach {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.approach.stage-per-branch {
    border-top: 4px solid #F44336;
}

.approach.feature-branch {
    border-top: 4px solid #2196F3;
}

.approach.trunk-based {
    border-top: 4px solid #4CAF50;
}

/* Share dialog */
.share-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.share-options {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

/* Insight cards */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.insight-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.insight-card i {
    font-size: 48px;
    color: #2196F3;
    margin-bottom: 10px;
}

/* Action buttons */
.action-button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-button:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.action-button:disabled {
    background: #BDBDBD;
    cursor: not-allowed;
    transform: none;
}

.action-button-outlined {
    background: transparent;
    color: #2196F3;
    border: 2px solid #2196F3;
    padding: 10px 22px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-button-outlined:hover {
    background: #E3F2FD;
}

/* Mini diagrams for comparisons */
.mini-diagram {
    text-align: center;
    padding: 20px;
}

.stage-row {
    font-size: 14px;
    font-weight: 500;
    padding: 10px;
    background: #FFCDD2;
    border-radius: 4px;
    margin-bottom: 10px;
}

.main-line {
    font-size: 16px;
    font-weight: 500;
    padding: 15px;
    background: #C8E6C9;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 2px solid #4CAF50;
}

.feature-lines {
    font-size: 14px;
    color: #666;
}

.feature-lines div {
    padding: 5px;
    margin: 5px 0;
}

.problem-indicator {
    font-size: 12px;
    color: #D32F2F;
    font-weight: 500;
    text-transform: uppercase;
}

.comparison-box {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Complexity meter */
.complexity-meter {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.complexity-bar {
    height: 30px;
    background: #E0E0E0;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
}

.complexity-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    transition: all 0.5s ease;
}

.complexity-fill.low {
    background: #4CAF50;
}

.complexity-fill.medium {
    background: #FF9800;
}

.complexity-fill.high {
    background: #FF5722;
}

.complexity-fill.critical {
    background: #F44336;
}