/* Sheet music styles */
.history-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.notes-history-container {
    width: 100%;
    margin-bottom: 20px;
}

.sheet-music-container {
    width: 100%;
    position: relative;
    margin-top: 15px;
}

/* Make the history table use the full width */
#notes-history {
    width: 100%;
    table-layout: fixed;
}

/* Set the session column to a fixed width */
#notes-history th:first-child,
#notes-history td:first-child {
    width: 100px;
}

/* Make all other columns distribute the remaining space equally */
#notes-history th:not(:first-child),
#notes-history td:not(:first-child) {
    width: calc((100% - 100px) / 10); /* Distribute remaining space equally among 10 note columns */
}

.staff-container {
    position: relative;
    height: 200px;
    margin-top: 30px;
    border: 1px solid #eee;
    background-color: #fff;
    padding: 20px 0;
    overflow-x: auto;
    width: 100%;
    min-height: 250px; /* Ensure enough height for notes */
}

.staff {
    position: relative;
    height: 100px;
    width: 100%;
    min-width: 800px; /* Ensure enough width for 10 notes */
    margin: 0 auto;
}

.staff-line {
    position: absolute;
    height: 1px;
    width: 100%;
    background-color: #000;
}

.staff-line:nth-child(1) {
    top: 0%;
}
.staff-line:nth-child(2) {
    top: 25%;
}
.staff-line:nth-child(3) {
    top: 50%;
}
.staff-line:nth-child(4) {
    top: 75%;
}
.staff-line:nth-child(5) {
    top: 100%;
}

.clef {
    position: absolute;
    left: 10px;
    top: 30px;
    font-size: 60px;
    color: #000;
    font-family: 'Bravura Text', 'Bravura', sans-serif;
    z-index: 2;
}

.note {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 3; /* Ensure notes stay on top */
}

.note-head {
    position: absolute;
    width: 12px;
    height: 10px;
    background-color: #000;
    border-radius: 50%;
    transform: rotate(-20deg);
    top: 5px;
    left: 4px;
}

.stem {
    position: absolute;
    width: 1px;
    height: 30px;
    background-color: #000;
}

.stem-up {
    bottom: 5px;
    right: 3px;
}

.stem-down {
    top: 5px;
    left: 3px;
}

.ledger-line {
    position: absolute;
    width: 16px;
    height: 1px;
    background-color: #000;
    left: 2px;
    top: 10px;
}

.ledger-line.below {
    top: 10px;
}

.accidental {
    position: absolute;
    left: -8px;
    top: -2px;
    font-size: 16px;
}

/* Make sure the note cells don't wrap content */
.note-cell {
    min-width: 30px;
    max-width: none;
    white-space: nowrap;
    font-weight: 500;
    transition: background-color 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ensure proper spacing between notes on the staff */
.staff-container .note:nth-child(1) { left: 60px; }
.staff-container .note:nth-child(2) { left: 100px; }
.staff-container .note:nth-child(3) { left: 140px; }
.staff-container .note:nth-child(4) { left: 180px; }
.staff-container .note:nth-child(5) { left: 220px; }
.staff-container .note:nth-child(6) { left: 260px; }
.staff-container .note:nth-child(7) { left: 300px; }
.staff-container .note:nth-child(8) { left: 340px; }
.staff-container .note:nth-child(9) { left: 380px; }
.staff-container .note:nth-child(10) { left: 420px; }