body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
}

.container {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.controls {
    margin-bottom: 20px;
}

#array-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 300px;
    margin: 20px 0;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #eee;
}

.bar {
    width: 30px; /* Increased width for number visibility */
    margin: 0 4px;
    background-color: #3498db;
    transition: height 0.3s ease, background-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    color: white; /* Number color */
    font-weight: bold;
}

.bar-label {
    position: absolute;
    bottom: -20px;
    color: #333;
    font-size: 14px;
}

.bar span {
    position: absolute;
    top: -20px;
    color: #333;
    font-size: 12px;
}

.bar.comparing {
    background-color: #e74c3c; /* Red for comparison */
}

.bar.swapping {
    background-color: #f1c40f; /* Yellow for swapping */
}

.bar.sorted {
    background-color: #2ecc71; /* Green for sorted */
}

.step-controls {
    margin-top: 20px;
}

button {
    padding: 10px 15px;
    margin: 0 5px;
    cursor: pointer;
    border: none;
    background-color: #34495e;
    color: white;
    border-radius: 5px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2c3e50;
}


