/* drums.css */

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    /* App takes full screen */
}

#app-container {
    height: 100vh;
}

#drum-machine {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 800px;
    max-width: 1000px;
    /* Ensure a minimum width so cells don't get too squished */
    user-select: none;
}


.drum-row {
    display: flex;
    align-items: stretch;
    background-color: #333;
    border-radius: 6px;
    overflow: hidden;
}

.drum-label {
    width: 100px;
    min-width: 100px;
    padding: 10px;
    background-color: #1e87f0;
    color: #fff;
    font-weight: bold;
    font-size: 1em;
    display: flex;
    align-items: center;
    border-right: 4px solid #1e87f088;
}

.step-container {
    display: flex;
    flex: 1;
}

.step-cell {
    flex: 1;
    border-right: 2px solid #aaa;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color 0.1s;
    position: relative;
}

/* Distinctive blocks of 4 for easier beat counting */
.step-cell:nth-child(4n) {
    border-right: 4px solid #999;
}

.step-cell:last-child {
    border-right: none;
}

.step-cell:hover {
    background-color: #eee;
}

.step-cell.active {
    background-color: #f39c12;
    /* Default active color */
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Give different instruments slight hue tints when active */
.drum-row[data-drum-id="ride"] .step-cell.active {
    background-color: #e67e22;
}

.drum-row[data-drum-id="hihat_open"] .step-cell.active {
    background-color: #f1c40f;
}

.drum-row[data-drum-id="hihat_closed"] .step-cell.active {
    background-color: #f39c12;
}

.drum-row[data-drum-id="hihat_foot"] .step-cell.active {
    background-color: #d4ac0d;
}

.drum-row[data-drum-id="tom1"] .step-cell.active {
    background-color: #3498db;
}

.drum-row[data-drum-id="tom2"] .step-cell.active {
    background-color: #2980b9;
}

.drum-row[data-drum-id="floor_tom"] .step-cell.active {
    background-color: #1f618d;
}

.drum-row[data-drum-id="snare_stick"] .step-cell.active {
    background-color: #cd6155;
}

.drum-row[data-drum-id="snare"] .step-cell.active {
    background-color: #e74c3c;
}

.drum-row[data-drum-id="bass"] .step-cell.active {
    background-color: #9b59b6;
}

/* Visual Playhead indicator */
.step-cell.playing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* Split mode formatting */
#drum-machine.split-active .drum-row {
    transition: opacity 0.3s;
}

#drum-machine.split-active .drum-row:not(.split-assigned) {
    opacity: 0.3;
    pointer-events: none;
}

#drum-machine.split-active .drum-row.split-assigned .drum-label {
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
}