@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1a1a1a;
    color: #e0e0e0;
    text-align: center;
    padding: 20px;
    margin: 0;
    box-sizing: border-box;
}

h1 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 2.5em;
    font-weight: 700;
}

p {
    margin-bottom: 20px;
}

#main-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
    max-height: 50vh;
}

#controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 400px;
}

#main-controls-container, #secondary-controls-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#sound-generation-controls, #sequencer-controls, #examples-section, #export-section {
    background: #2c2c2c;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #444;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

h2 {
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 15px;
    color: #007bff;
    border-bottom: 1px solid #007bff;
    padding-bottom: 8px;
}

.control-group {
    margin-bottom: 10px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 400;
    font-size: 0.9em;
}

select, input[type="range"] {
    width: 100%;
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    padding: 8px;
    box-sizing: border-box;
}

button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin: 5px;
}

button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

#loop.active {
    background-color: #ff9800;
}

#grid-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(16, 1fr);
    border: 3px solid #007bff;
    border-radius: 10px;
    padding: 10px;
    background-color: #222;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.3);
}

.grid-cell {
    background-color: #444;
    border: 1px solid #666;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.grid-cell:hover {
    background-color: #555;
}

.grid-cell.active {
    background-color: #007bff;
    box-shadow: 0 0 8px #007bff;
}

.grid-cell.playing {
    background-color: #ff00ff;
    box-shadow: 0 0 8px #ff00ff;
}

@media (max-width: 768px) {
    #main-container {
        flex-direction: column;
    }

    #controls-wrapper {
        width: 100%;
    }
}
