* {
    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;
}

.doppler-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    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: 700;
}

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

main {
    padding: 30px;
}

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

.wave-panel,
.controls-panel {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
}

.wave-display,
.frequency-display,
.waveform-display {
    margin-bottom: 20px;
}

.wave-display h3,
.frequency-display h3,
.waveform-display h3 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 1.2em;
}

canvas {
    width: 100%;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

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

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.frequency-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-item span:first-child {
    color: #6b7280;
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}

.stat-item span:last-child {
    color: #1f2937;
    font-weight: 700;
    font-size: 1.3em;
}

.controls-panel h3 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.controls-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.control-group h4 {
    color: #4b5563;
    margin-bottom: 12px;
    font-size: 1em;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.control-group label {
    display: block;
    margin-bottom: 12px;
    color: #374151;
    font-size: 0.9em;
}

.control-group label span:first-child {
    font-weight: 500;
}

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

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    transition: all 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #5568d3;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    transition: all 0.2s;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    background: #5568d3;
}

.checkbox-input {
    margin-right: 8px;
    cursor: pointer;
}

.preset-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.preset-btn:active {
    transform: translateY(0);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.control-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.control-button.start {
    background: #10b981;
    color: white;
}

.control-button.start:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

.control-button.pause:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.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.3);
}

.formulas-section {
    margin-top: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.formulas-section h3 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.formula-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.formula-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.formula-label {
    font-weight: 600;
    color: #4b5563;
    font-size: 0.85em;
    min-width: 120px;
}

.formula {
    font-family: 'Courier New', monospace;
    color: #1f2937;
    font-size: 0.9em;
    background: #e5e7eb;
    padding: 4px 8px;
    border-radius: 4px;
}

.explanation {
    background: #f9fafb;
    padding: 30px;
    border-radius: 12px;
    line-height: 1.8;
}

.explanation h2 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.explanation h3 {
    color: #374151;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.explanation p {
    color: #4b5563;
    margin-bottom: 15px;
    text-align: justify;
}

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

    .frequency-stats {
        grid-template-columns: 1fr;
    }
}

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

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.9em;
    }

    main {
        padding: 15px;
    }

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

    .wave-legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}
