/* Existing CSS is unchanged. Only new additions are listed below. */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    color: #333;
}

.header-container {
    margin-bottom: 20px;
}

h1 {
    color: #007BFF;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 5px;
}

.controls-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    /* Adds space between the button groups and sliders */
    margin-bottom: 20px;
    width: 100%;
    max-width: 900px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    /* Adds a consistent gap between the buttons themselves */
}

.controls button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 25px;
    transition: background-color 0.3s ease;
}

.controls button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    /* A subtle lift effect on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    /* A shadow effect for depth */
}

.controls button:active {
    background-color: #004085;
    transform: translateY(0);
    box-shadow: none;
}

.sliders {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sliders label {
    font-size: 16px;
    font-weight: bold;
}

input[type="range"] {
    cursor: pointer;
}

.info-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 900px;
}

.info-box {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    flex: 1;
    text-align: center;
    min-width: 150px;
}

#array-container {
    display: flex;
    align-items: flex-end;
    height: 400px;
    width: 100%;
    max-width: 900px;
    border: 1px solid #ccc;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.array-bar {
    flex: 1;
    margin: 0 1px;
    transition: height 0.2s ease;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.custom-array-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-array-input input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.info-box {
    /* ... (Existing styles) */
    text-align: center;
    flex: 1;
    /* This makes the boxes flexible */
    min-width: 150px;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}