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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.infinite-square-well-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, #1e3a8a 0%, #3b82f6 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.9;
}

main {
    padding: 30px;
}

.visualization-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.wave-panel,
.animation-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-display,
.animation-display,
.superposition-display,
.probability-display {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-display h3,
.animation-display h3,
.superposition-display h3,
.probability-display h3 {
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

canvas {
    width: 100%;
    border-radius: 8px;
    background: white;
    display: block;
}

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

.physics-note {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    margin-top: 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #92400e;
    line-height: 1.5;
}

.physics-note strong {
    color: #78350f;
}

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

.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.energy-info,
.animation-info,
.probability-info {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.info-item {
    font-size: 0.95rem;
    color: #475569;
    text-align: center;
}

.superposition-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.superposition-controls label {
    color: #475569;
    font-size: 0.95rem;
}

.superposition-controls select {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.superposition-controls select:hover {
    border-color: #3b82f6;
}

.superposition-params {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.controls-panel {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.controls-panel h3 {
    color: #1e293b;
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.control-group h4 {
    color: #334155;
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.control-group label {
    display: block;
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #cbd5e1;
    outline: none;
    margin-bottom: 15px;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    transition: background 0.3s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #2563eb;
}

.checkbox-input {
    width: auto !important;
    height: auto !important;
    margin-right: 8px;
    margin-bottom: 12px !important;
    cursor: pointer;
}

.preset-btn {
    padding: 10px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.preset-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.control-button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.control-button.start {
    background: #22c55e;
    color: white;
}

.control-button.start:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.control-button.pause {
    background: #eab308;
    color: white;
}

.control-button.pause:hover {
    background: #ca8a04;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
}

.control-button.reset {
    background: #ef4444;
    color: white;
}

.control-button.reset:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.formulas-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.formulas-section h3 {
    color: #1e293b;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.formula-list {
    display: grid;
    gap: 12px;
}

.formula-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.formula-label {
    font-weight: 600;
    color: #475569;
    min-width: 150px;
}

.formula {
    font-family: 'Courier New', monospace;
    color: #1e293b;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 4px;
}

.explanation {
    background: #f8fafc;
    border-radius: 12px;
    padding: 30px;
}

.explanation h2 {
    color: #1e293b;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.explanation h3 {
    color: #334155;
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
}

.explanation p {
    color: #475569;
    line-height: 1.8;
    margin-bottom: 15px;
    font-size: 1rem;
}

.explanation strong {
    color: #1e293b;
    font-weight: 600;
}

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

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

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    main {
        padding: 20px;
    }

    .chart-display,
    .animation-display,
    .superposition-display,
    .probability-display {
        padding: 15px;
    }

    .button-group {
        flex-direction: column;
    }

    .control-button {
        width: 100%;
    }
}
