/* --- Plugin Main Container --- */
.mtp-container {
    padding: 20px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    max-width: 600px;
    margin: 20px auto;
}

/* --- Controls Row (New) --- */
.mtp-controls-row {
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
}

#mtp-current-octave-range {
    margin: 0 15px;
    display: inline-block;
    min-width: 70px;
    text-align: center;
}

/* Piano Keyboard Container */
#mtp-piano-key-display {
    overflow: hidden; /* Crucial: Hides the off-screen keys */
    margin-top: 20px;
    width: 1008px;
}

.keyboard-container {
    display: flex;
    position: relative;
    height: 120px;
    user-select: none;
    
    /* Crucial: Add transition for smooth shifting */
    transition: transform 0.3s ease-out; 
    /* This ID is targeted by the JS transform: #main-keyboard */
}

/* White Keys */
.piano-key.white {
    width: 40px;
    height: 120px;
    background-color: white;
    border: 1px solid #333;
    cursor: pointer;
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5px;
    font-size: 10px;
    position: relative; 
    z-index: 1;
}

/* Black Keys */
.piano-key.black {
    width: 30px;
    height: 80px;
    background-color: black;
    cursor: pointer;
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5px;
    font-size: 10px;
    
    position: absolute;
    top: 0;
    z-index: 2;
}

/* ---------------------------------------------------------------------- */
/* --- Black Key Positioning (Based on 40px width + 2px border = 42px per white key) --- */
/* (Offset is 42px * (key index) - 15px (half black key width) = left position) */

/* C3-B3 Octave (Start C3 at 0px) */
.piano-key[data-note="C#3"] { left: 27px; } 
.piano-key[data-note="D#3"] { left: 69px; } 
.piano-key[data-note="F#3"] { left: 153px; } 
.piano-key[data-note="G#3"] { left: 195px; }
.piano-key[data-note="A#3"] { left: 237px; }

/* C4-B4 Octave (Starts after 7 white keys = 7 * 42px = 294px) */
.piano-key[data-note="C#4"] { left: 321px; }
.piano-key[data-note="D#4"] { left: 363px; }
.piano-key[data-note="F#4"] { left: 447px; }
.piano-key[data-note="G#4"] { left: 489px; }
.piano-key[data-note="A#4"] { left: 531px; }

/* NOTE: You will need to continue this pattern for C#5, D#5, etc. if you expand the default visible range */
/* C5-B5 Octave (Starts after 14 white keys = 14 * 42px = 588px) */
.piano-key[data-note="C#5"] { left: 615px; } 
.piano-key[data-note="D#5"] { left: 657px; }
/* ...and so on. For now, the JS controls the visibility of the C3-B4 range. */


/* --- Feedback Styles --- */

.piano-key.clicked-feedback {
    background-color: #a0c2e6 !important; /* Light blue flash */
}

.piano-key.correct {
    background-color: #70e0a5 !important; /* Green */
}

.piano-key.incorrect {
    background-color: #f77d7d !important; /* Red */
}

.piano-key.playing {
    background-color: yellow !important; /* Yellow flash for notes being played */
    box-shadow: 0 0 10px yellow;
}