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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.sound-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, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
    font-weight: 300;
}

main {
    padding: 30px;
}

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

.simulation-panel, .wave-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.simulation-panel canvas, .wave-panel canvas {
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #1e272e;
}

.simulation-info {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.info-item {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    font-size: 0.95em;
}

.info-item span:first-child {
    color: #667eea;
    font-weight: 600;
}

.info-item span:last-child {
    color: #764ba2;
    font-weight: 700;
}

.wave-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.9em;
}

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

.legend-color.direct {
    background: #3498db;
}

.legend-color.reflected {
    background: #e74c3c;
}

.controls-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.controls-panel h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
}

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

.control-group {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: none;
}

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

.control-button {
    flex: 1;
    min-width: 120px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

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

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

.control-button.reset {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.control-button:active {
    transform: translateY(0);
}

.calculations-section {
    margin-top: 20px;
}

.calculations-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 600;
}

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

.calc-item {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    font-size: 0.9em;
}

.calc-label {
    color: #666;
    font-weight: 500;
}

.calc-value {
    color: #764ba2;
    font-weight: 700;
    font-size: 1.1em;
}

.explanation {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.explanation h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 600;
}

.explanation h3 {
    color: #764ba2;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: 600;
}

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

.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.application-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.application-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.application-item h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: 600;
}

.application-item p {
    line-height: 1.6;
    color: #666;
    font-size: 0.95em;
    margin: 0;
}

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

    header h1 {
        font-size: 2em;
    }

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

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

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

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

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    main {
        padding: 15px;
    }

    .explanation {
        padding: 20px;
    }

    .explanation h2 {
        font-size: 1.4em;
    }

    .explanation h3 {
        font-size: 1.2em;
    }
}