body {
    background-color: #1a1a1a;
    color: #ecf0f1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    min-height: 100vh;
}

header {
    width: 100%;
    background-color: #2c3e50;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.back-link {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 2rem;
    flex-grow: 1;
}

.controls {
    display: flex;
    gap: 1.5rem;
    background-color: #34495e;
    padding: 1rem 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

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

label {
    font-size: 0.9rem;
    color: #bdc3c7;
}

input[type="range"] {
    width: 100px;
    cursor: pointer;
}

select {
    padding: 0.5rem;
    border-radius: 4px;
    border: none;
    background-color: #ecf0f1;
    color: #2c3e50;
    font-weight: bold;
    cursor: pointer;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    background-color: #2ecc71;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #27ae60;
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#visualizer-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 80%;
    height: 400px;
    background-color: #2c3e50;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.bar {
    width: 20px;
    background-color: #3498db;
    margin: 0 2px;
    transition: height 0.1s ease;
}

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

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

.bar.sorted {
    background-color: #9b59b6; /* Purple for sorted */
}
