/* Melodic Loop Engine Styles */

.sequencer-container {
    background: rgba(10, 15, 20, 0.7);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.transport-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 255, 204, 0.1);
}

.divider {
    width: 1px;
    height: 30px;
    background: rgba(0, 255, 204, 0.2);
}

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

.control-group.inline label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
}

#bpmSlider {
    width: 100px;
}

#bpmVal {
    font-family: monospace;
    color: var(--accent, #00ffcc);
    min-width: 30px;
}

.volume-control {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-control input {
    width: 80px;
}

/* Grid Styles */
.grid-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
}

.sequencer-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 4px;
    min-width: 800px;
    /* Ensure 16 steps are visible and playable */
}

.step {
    aspect-ratio: 1;
    background: rgba(0, 255, 204, 0.03);
    border: 1px solid rgba(0, 255, 204, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.step:hover {
    background: rgba(0, 255, 204, 0.1);
    border-color: rgba(0, 255, 204, 0.3);
}

.step.active {
    background: rgba(0, 255, 204, 0.4);
    border-color: #00ffcc;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

.step.playing {
    border-color: #fff;
    transform: scale(1.05);
    z-index: 2;
}

.step.playing.active {
    background: #fff;
    box-shadow: 0 0 20px #00ffcc;
}

/* Note Labels on first column */
.pitch-label {
    position: absolute;
    left: -30px;
    font-size: 0.6rem;
    color: #555;
    font-family: monospace;
}

/* Control Panels */
.engine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.control-panel {
    background: rgba(0, 255, 204, 0.03);
    border: 1px solid rgba(0, 255, 204, 0.1);
    border-radius: 8px;
    padding: 1.2rem;
}

.control-panel h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent, #00ffcc);
    margin-bottom: 1.2rem;
    border-bottom: 1px solid rgba(0, 255, 204, 0.1);
    padding-bottom: 0.5rem;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.4rem;
}

.control-panel select,
.control-panel input[type="range"] {
    width: 100%;
}

select {
    background: #0a0f14;
    color: #fff;
    border: 1px solid rgba(0, 255, 204, 0.2);
    padding: 0.4rem;
    border-radius: 4px;
}

input[type="range"] {
    accent-color: var(--accent, #00ffcc);
}

.primary-action {
    background: var(--accent, #00ffcc);
    color: #000;
    font-weight: bold;
}

/* Responsive fixes */
@media (max-width: 768px) {
    .transport-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .volume-control {
        margin-left: 0;
        margin-top: 1rem;
    }

    .divider {
        display: none;
    }
}