* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', sans-serif; 
}

body {
    background: #d7f0e0; 
    color: #333;
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem; 
}


#controls {
    display: flex; 
    gap: 1rem; flex-wrap: wrap; 
    justify-content: center; 
    margin-bottom: 1rem;
}

.control-group { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
}

#algo, .input-box input {
    padding: 0.6rem; 
    border-radius: 8px; 
    border: 2px solid #27AE60;
    background: white; 
    font-size: 1rem; 
    transition: all 0.3s;
}

#algo:hover, .input-box input:hover { 
    border-color: #76D7C4;
}

#speed { 
    width: 180px; 
}

#speed {
    accent-color: #27AE60;
    transition: accent-color 0.3s;
}

#speed:hover {
    accent-color: #76D7C4;
}

button {
    background: #27AE60; 
    color: white; 
    border: none; 
    border-radius: 8px;
    padding: 0.6rem 1.2rem; 
    font-size: 1rem; 
    cursor: pointer; 
    transition: all 0.3s;
}

button:hover { 
    background: #76D7C4; 
    transform: scale(1.05); 
}

#visualization { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    width: 100%; 
}

#bars {
    display: flex; 
    align-items: flex-end; 
    justify-content: center; 
    gap: 4px;
    height: 350px; 
    width: 95%; 
    margin: 1rem auto;
}


.bar {
    flex: 1;
    background: #27AE60;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    border-radius: 5px 5px 0 0;
    transition: height 0.35s ease, background 0.3s ease;
}

@keyframes hop { 
    0%{
        transform: translateY(0)
    } 
    50%{
        transform: translateY(-8px)
    } 
    100%{
        transform: translateY(0)
    } 
}
.swap-anim { 
    animation: hop 0.35s ease; 
}

#step-caption {
    margin-top: 1rem; 
    padding: 0.8rem 1.2rem; 
    background: #e0e7ff9f;
    border-radius: 8px;
    min-height: 40px; 
    text-align: center; 
    font-size: 1.1rem; 
    font-weight: 500; 
    width: 80%;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
