@import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Poppins:wght@300;400;600&display=swap');

/* 🌈 Animated pastel background */
body {
    color: #333;
    text-align: center;
    margin: 0;

    background: linear-gradient(-45deg, #ffc0cb, #87ceeb, #c8a2c8, #ffb6c1);
    background-size: 400% 400%;
    animation: gradientBG 12s ease infinite;
    font-family: 'Poppins', sans-serif;
}

/* 🌈 smooth animation */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 🧠 Heading */
h1 {
    font-family: 'Pacifico', cursive;
    font-size: 42px;
    color: #333;
    margin-top: 20px;
    letter-spacing: 1px;

    /* ✨ soft glow */
    text-shadow: 2px 2px 10px rgba(0,0,0,0.1);
}

/* 🔲 Top controls bar */
.top-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;

    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    padding: 15px;
    border-radius: 15px;
    width: 80%;
    margin: 20px auto;

    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Inputs & dropdown */
input, select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
    background: #ffffff;
}

/* Buttons */
button {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;

    background: linear-gradient(135deg, #a0c4ff, #bdb2ff);
    color: #333;

    cursor: pointer;
    font-size: 18px;
    font-weight: bold;

    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Speed box */
.speed-box {
    margin-top: 15px;
    font-weight: 500;
    font-size: 16px;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px
}

/* Main visualization container */
.main-container {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    padding: 30px;
    margin: 25px auto;
    width: 85%;
    border-radius: 20px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Balloons container */
#array-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    height: 300px;
}

@keyframes floaty {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}

/* 🎈 Balloons */
.bar {
    width: 60px;
    height: 60px;
    background-color: #74c0fc;
    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    color: white;
    font-weight: bold;

    border: 2px solid white;

    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);

    animation: floaty 3s ease-in-out infinite;
}

/* Hover */
.bar:hover {
    transform: scale(1.08);
}

/* 📘 Legend container */
.legend {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 15px;
}

/* Each item */
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Small color box */
.color-box {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

/* 🌈 Soft pastel colors */
.blue { background-color: blue; }
.red { background-color: red; }
.yellow { background-color: #ffd43b; color: black; }
.green { background-color: green; }

p {
    font-size: 20px;
    color: #444;
    margin-top: 10px;
    font-weight: bold
}

h1 span {
    font-size: 28px;
}

#algorithm {
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}