/* ==============================================
   QUARTER CAR SUSPENSION MODEL VISUALIZATION
   ============================================== */

/* Container */
.sus-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    padding: 15px;
    box-sizing: border-box;
}

/* Main Layout */
.sus-main-layout {
    display: flex;
    gap: 12px;
    min-height: 600px;
}

/* Left Panel - Controls */
.sus-control-panel {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sus-control-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.sus-control-section h4 {
    color: #4fc3f7;
    font-size: 12px;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Parameter Sliders */
.sus-param-group {
    margin-bottom: 12px;
}

.sus-param-group:last-child {
    margin-bottom: 0;
}

.sus-param-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.sus-param-label .name {
    color: #b0bec5;
    font-size: 11px;
}

.sus-param-label .value {
    color: #69f0ae;
    font-size: 12px;
    font-weight: bold;
    min-width: 60px;
    text-align: right;
}

.sus-param-label .unit {
    color: #78909c;
    font-size: 10px;
    margin-left: 3px;
}

.sus-slider {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.sus-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.sus-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Different colors for parameters */
.sus-slider.mass::-webkit-slider-thumb { background: #ff7043; }
.sus-slider.stiffness::-webkit-slider-thumb { background: #66bb6a; }
.sus-slider.damping::-webkit-slider-thumb { background: #ab47bc; }
.sus-slider.tire::-webkit-slider-thumb { background: #ffa726; }
.sus-slider.speed::-webkit-slider-thumb { background: #42a5f5; }

/* Stats Display */
.sus-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sus-stat-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 4px;
    text-align: center;
}

.sus-stat-item .label {
    color: #78909c;
    font-size: 9px;
    display: block;
    margin-bottom: 2px;
}

.sus-stat-item .value {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: bold;
}

.sus-stat-item .value.body { color: #4fc3f7; }
.sus-stat-item .value.wheel { color: #ffa726; }

/* Control Buttons */
.sus-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sus-btn {
    flex: 1;
    min-width: 50px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    transition: all 0.15s ease;
}

.sus-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sus-btn.primary {
    background: #4fc3f7;
    border-color: #4fc3f7;
    color: #1a1a2e;
}

.sus-btn.primary:hover {
    background: #81d4fa;
}

.sus-btn.danger {
    border-color: #ef5350;
    color: #ef5350;
}

.sus-btn.danger:hover {
    background: rgba(239, 83, 80, 0.2);
}

/* Right Panel - Visualizations */
.sus-visual-panel {
    flex: 1;
    min-width: 0;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
}

/* Car View Container */
.sus-car-view {
    flex: 1;
    background: linear-gradient(180deg, #0d47a1 0%, #1565c0 30%, #42a5f5 70%, #64b5f6 100%);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.sus-car-view .sky {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(180deg, #0d47a1 0%, #1976d2 100%);
}

.sus-car-view canvas#sus-road-canvas {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 5;
}

/* Dynamics Subplot */
.sus-subplot {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    height: 140px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.sus-subplot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 9px;
    color: #b0bec5;
}

.sus-subplot-legend {
    display: flex;
    gap: 8px;
}

.sus-subplot-legend span {
    font-size: 8px;
}

.sus-subplot-legend .body { color: #4fc3f7; }
.sus-subplot-legend .wheel { color: #ffa726; }
.sus-subplot-legend .road { color: #8d6e63; }

.sus-subplot canvas {
    width: 100%;
    height: calc(100% - 22px);
    display: block;
}

/* Phase Plots Row */
.sus-phase-row {
    position: absolute;
    top: 160px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 20;
}

.sus-phase-plot {
    flex: 1;
    min-width: 0;
    height: 280px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.sus-phase-plot .sus-subplot-header {
    padding: 3px 6px;
    font-size: 8px;
}

.sus-phase-plot .sus-subplot-header span:first-child {
    font-size: 8px;
}

.sus-phase-plot .sus-subplot-legend {
    gap: 5px;
}

.sus-phase-plot .sus-subplot-legend span {
    font-size: 7px;
}

.sus-phase-plot canvas {
    width: 100%;
    height: calc(100% - 20px);
    display: block;
}

.sus-car-svg {
    position: absolute;
    bottom: 62px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 150px;
    z-index: 10;
}

/* Model View Container */
.sus-model-view {
    height: 200px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    position: relative;
    display: flex;
    overflow: hidden;
}

.sus-model-canvas {
    flex: 1;
}

.sus-model-info {
    width: 150px;
    padding: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.sus-model-info .equation {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 4px;
    font-size: 10px;
    color: #b0bec5;
    font-family: 'Times New Roman', serif;
}

.sus-model-info .equation .var {
    color: #4fc3f7;
    font-style: italic;
}

/* Road Type Selector */
.sus-road-selector {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.sus-road-btn {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #78909c;
    border-radius: 3px;
    font-size: 9px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sus-road-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
}

.sus-road-btn.active {
    background: rgba(79, 195, 247, 0.3);
    border-color: #4fc3f7;
    color: #4fc3f7;
}

/* Legend */
.sus-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.sus-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #b0bec5;
}

.sus-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.sus-legend-color.body { background: #4fc3f7; }
.sus-legend-color.wheel { background: #ffa726; }
.sus-legend-color.spring { background: #66bb6a; }
.sus-legend-color.damper { background: #ab47bc; }
.sus-legend-color.road { background: #8d6e63; }

/* Damping Indicator */
.sus-damping-indicator {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
}

.sus-damping-indicator .label {
    color: #78909c;
    font-size: 9px;
    display: block;
    margin-bottom: 4px;
}

.sus-damping-indicator .status {
    font-size: 11px;
    font-weight: bold;
}

.sus-damping-indicator .status.under { color: #ef5350; }
.sus-damping-indicator .status.critical { color: #66bb6a; }
.sus-damping-indicator .status.over { color: #ffa726; }

/* Simulation Content Background */
#content_sim {
    background-color: #1a1a2e;
}

/* Responsive */
@media (max-width: 900px) {
    .sus-main-layout {
        flex-direction: column;
    }
    
    .sus-control-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sus-control-section {
        flex: 1;
        min-width: 200px;
    }
}

/* Bump animation */
@keyframes bumpFlash {
    0% { background: rgba(255, 255, 255, 0.1); }
    100% { background: transparent; }
}

.sus-car-view.bump {
    animation: bumpFlash 0.3s ease;
}

/* Preset dropdown */
.sus-preset-select {
    width: 100%;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
}

.sus-preset-select optgroup {
    background: #1a1a2e;
    color: #4fc3f7;
}

.sus-preset-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}
