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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 20px;
}

.elasticity-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

main {
    padding: 40px;
}

.simulation-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .simulation-layout {
        grid-template-columns: 1fr;
    }
}

/* Visual Panel */
.visual-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.visual-panel h3 {
    color: #0f3460;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

#springCanvas {
    width: 100%;
    height: 500px;
    background: linear-gradient(180deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Zoom Control */
.zoom-control {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.zoom-control label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #333;
    margin-bottom: 10px;
}

.zoom-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #0f3460 0%, #3498db 100%);
    outline: none;
    -webkit-appearance: none;
}

.zoom-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #0f3460;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.zoom-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #0f3460;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.measurements-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.measurement-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.measurement-item span:first-child {
    color: #555;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 5px;
}

.highlight {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1.2rem;
}

/* Controls Panel */
.controls-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.force-control, .constant-control, .material-control, .properties-display {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.force-control h4, .constant-control h4, .material-control h4, .properties-display h4 {
    color: #0f3460;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.force-control label, .constant-control label {
    display: block;
    color: #555;
    margin-bottom: 10px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #0f3460;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 3px solid #0f3460;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Material Buttons */
.material-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.material-btn {
    padding: 12px;
    border: 2px solid #0f3460;
    background: white;
    color: #0f3460;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.material-btn:hover {
    background: #0f3460;
    color: white;
}

.material-btn.active {
    background: #0f3460;
    color: white;
}

/* Animation Controls */
.animation-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.load-button, .unload-button, .reset-button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.load-button {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.unload-button {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    color: white;
}

.reset-button {
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    color: white;
}

.load-button:hover, .unload-button:hover, .reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.icon {
    font-size: 1.2rem;
}

/* Properties Display */
.property-item {
    padding: 10px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-bottom: 8px;
    color: #333;
}

.property-item span:first-child {
    font-weight: 500;
}

/* Curve Section */
.curve-section, .comparison-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 40px;
}

.curve-section h3, .comparison-section h3 {
    color: #0f3460;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

#curveCanvas, #comparisonCanvas {
    width: 100%;
    height: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.curve-legend, .comparison-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 30px;
    height: 4px;
    border-radius: 2px;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e74c3c;
    border: 2px solid #c0392b;
}

/* Formulas Section */
.formulas-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 40px;
}

.formulas-section h3 {
    color: #0f3460;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

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

.formula-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.formula-card h4 {
    color: #555;
    margin-bottom: 10px;
    font-size: 1rem;
}

.formula {
    font-size: 1.4rem;
    color: #0f3460;
    font-weight: 600;
    text-align: center;
}

.formula-card.highlight {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

.formula-card.highlight h4,
.formula-card.highlight .formula {
    color: white;
}

/* Explanation Section */
.explanation {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.explanation h2 {
    color: #0f3460;
    margin-bottom: 20px;
    font-size: 2rem;
}

.explanation h3 {
    color: #16213e;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.explanation p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* Regions Explanation */
.regions-explanation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px 0;
}

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

.region-card {
    padding: 20px;
    border-radius: 12px;
}

.region-card.elastic {
    background: linear-gradient(135deg, #d5f4e6 0%, #b8e6cc 100%);
    border-left: 4px solid #27ae60;
}

.region-card.plastic {
    background: linear-gradient(135deg, #fef5e7 0%, #fdebd0 100%);
    border-left: 4px solid #f39c12;
}

.region-card.fracture {
    background: linear-gradient(135deg, #fadbd8 0%, #f5b7b1 100%);
    border-left: 4px solid #e74c3c;
}

.region-card h4 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.region-card.elastic h4 { color: #27ae60; }
.region-card.plastic h4 { color: #f39c12; }
.region-card.fracture h4 { color: #e74c3c; }

.region-card p {
    color: #555;
    line-height: 1.6;
    font-size: 0.9rem;
}

/* Materials Grid */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px 0;
}

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

.material-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.material-card h4 {
    color: #0f3460;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 2px solid #0f3460;
    padding-bottom: 8px;
}

.material-card ul {
    list-style: none;
    padding: 0;
}

.material-card li {
    padding: 8px 0;
    color: #555;
    line-height: 1.5;
    font-size: 0.9rem;
    border-bottom: 1px solid #e0e0e0;
}

.material-card li:last-child {
    border-bottom: none;
}

/* Applications List */
.applications-list {
    list-style: none;
    padding: 0;
}

.applications-list li {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 10px;
    border-left: 4px solid #0f3460;
    color: #555;
    line-height: 1.7;
}

/* Experiment Tips */
.experiment-tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tip-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #e5eeff 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #0f3460;
}

.tip-card h4 {
    color: #0f3460;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.tip-card p {
    color: #555;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    main {
        padding: 20px;
    }

    .measurements-display {
        grid-template-columns: 1fr;
    }

    .material-buttons {
        grid-template-columns: 1fr;
    }

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