/*
 * Piano Tools Stylesheet
 *
 * Provides basic styling for the piano chord and scale tools. This file
 * defines the layout for the control elements, piano keyboard, and
 * information panel. Colors have been chosen to provide clear contrast
 * between white and black keys and to highlight active notes when a
 * chord or scale is selected.
 */

.piano-tools-wrapper {
    width: 100%;
    margin: 20px auto;
    font-family: Arial, sans-serif;
}

.piano-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.piano-controls select,
.piano-controls button {
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #f8f8f8;
    cursor: pointer;
}

.piano-controls button {
    background: #1976d2;
    color: #fff;
    border: none;
    transition: background 0.2s;
}

.piano-controls button:hover {
    background: #1565c0;
}

.piano-keyboard {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 200px;
    margin: 0 auto;
    user-select: none;
}

/*
 * White keys span the full width of the keyboard equally. There are
 * fourteen white keys (C4–B5) so each key occupies 1/14 of the
 * container width. A float layout ensures they sit horizontally.
 */
/*
 * White keys float to the left so they appear horizontally across the
 * keyboard. Their widths are set dynamically via JavaScript based on
 * the container width. Height spans the full height of the keyboard.
 */
.white-key {
    position: relative;
    float: left;
    height: 100%;
    border: 1px solid #aaa;
    border-bottom: 2px solid #666;
    box-sizing: border-box;
    background: #fff;
}

/*
 * Black keys sit on top of the white keys using absolute positioning. Their
 * width and left offset are computed in JavaScript to adapt to the
 * container width. A higher z-index ensures they appear above the white
 * keys. The top property anchors them to the top of the keyboard.
 */
.black-key {
    position: absolute;
    top: 0;
    background: #222;
    border: 1px solid #111;
    border-radius: 0 0 3px 3px;
    box-sizing: border-box;
    z-index: 2;
}

/* Highlight active notes */
.white-key.active {
    background: #ffd54f;
}

.black-key.active {
    background: #f57c00;
}

/* Keys being played during audio playback */
/* Keys being played during audio playback. Use distinct green hues so
   playback is clearly visible against the default active colours. */
.white-key.playing {
    background: #66bb6a !important;
}

.black-key.playing {
    background: #388e3c !important;
}

/* Root note indicator: draw a small red dot on the active root key.
   Applies to both white and black keys. Positioned near the bottom of the
   key for visibility. */
.white-key.root-key::after,
.black-key.root-key::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #e53935;
    border-radius: 50%;
}

.info-panel {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.info-panel .label {
    font-weight: bold;
    margin-right: 5px;
}

/* Inversion control styling */
.inversion-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}
.inversion-controls button {
    background: #e0e0e0;
    color: #333;
    border: 1px solid #ccc;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
}
.inversion-controls button:hover {
    background: #d5d5d5;
}
.inversion-controls .inversion-label {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
}