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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 300;
}

.navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    min-width: 60px;
}

.nav-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

.nav-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.5;
}

#playBtn, #stopBtn {
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#playBtn:hover, #stopBtn:hover {
    background-color: #2980b9;
}

#playBtn {
    background-color: #27ae60;
}

#playBtn:hover {
    background-color: #229954;
}

#stopBtn {
    background-color: #e74c3c;
}

#stopBtn:hover {
    background-color: #c0392b;
}

.speed-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px auto;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
}

.speed-control label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

#speedSlider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    transition: opacity 0.2s;
}

#speedSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

#speedSlider::-webkit-slider-thumb:hover {
    background: #2980b9;
}

#speedSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

#speedSlider::-moz-range-thumb:hover {
    background: #2980b9;
}

#speedValue {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
    color: #3498db;
    font-size: 16px;
}

#visualizationCanvas {
    display: block;
    margin: 0 auto;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

    h1 {
        font-size: 2em;
        margin-bottom: 20px;
    }

    .navigation {
        flex-direction: column;
        gap: 10px;
    }

    #visualizationCanvas {
        width: 100%;
        height: auto;
    }
}