body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #f0f4f8;
    color: #333;
}
.container {
    width: 100%;
    max-width: 1200px;
}
#visualizer {
    display: flex;
    align-items: flex-end;
    height: 300px;
    width: 100%;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 20px;
}
.bar {
    flex-grow: 1;
    margin: 0 1px;
    background-color: #3498db;
    transition: height 0.1s ease-in-out;
}
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
select, input, button {
    font-size: 16px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
}
button {
    background-color: #2ecc71;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}
button:hover {
    background-color: #27ae60;
}
#stats, #timeComplexity {
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}
#algorithmInfo {
    margin-top: 20px;
    padding: 15px;
    background-color: #e8f4fd;
    border-radius: 5px;
    font-size: 14px;
}
#performanceChart {
    margin-top: 20px;
    max-width: 600px;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}
.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}