/* ===== PIANO MODULE (REALISTIC PIANO SOUND GENERATOR) - INDEPENDENT CSS ===== */

/* Components container */
.piano-component-container {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Pitch Auto Knob Container */
.piano-knob-container {
    width: 140px;
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-size: contain;
    position: relative;
}

.piano-knob-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 5px;
}

.piano-knob {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #111;
    position: relative;
    margin: 0 0 8px 0;
    transform: rotate(-130deg);
    transition: transform 0.15s ease-out;
    border: 2px solid #666; /* Default gray border for manual mode */
    cursor: pointer; /* Show it's interactive by default */
}

.piano-knob:hover {
    background: #222; /* Slight highlight on hover in manual mode */
}

.piano-knob.cv-auto {
    pointer-events: none; /* Disable manual interaction when CV connected */
    border-color: #00aaff; /* Blue border for CV automation */
    cursor: default;
}

.piano-knob.cv-auto:hover {
    background: #111; /* No hover effect in CV mode */
}

.piano-knob .piano-knob-dot {
    width: 8px;
    height: 8px;
    background: #00aaff; /* Blue dot for CV automation */
    border-radius: 50%;
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.piano-knob-value-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    color: #00aaff;
    text-align: center;
    pointer-events: none;
}

.piano-labels-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 9px;
    color: #888;
    margin-top: 5px;
   
}

.piano-label-title {
    font-size: 10px;
    font-weight: bold;
    color: #00aaff; /* Blue title for CV mode */
}

.piano-label-min, .piano-label-max {
    color: #666;
}

.piano-component {
    margin: 2px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Space Divider */
.piano-space10 {
    height: 0px;
    }

/* Slider Pot Container */
.piano-slider-pot {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 120px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.piano-slider-pot:hover {
    border-color: #4a9f4a;
    box-shadow: 0 0 3px rgba(74, 159, 74, 0.3);
}

/* Header row: title + value */
.piano-slider-pot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.piano-slider-pot-header label {
    font-size: 9px;
    font-weight: bold;
    color: #4a9f4a;
    margin: 0;
}

.piano-value-display {
    font-size: 8px;
    color: #fff;
    font-family: 'Courier New', monospace;
    background: #000;
    border: 1px solid #333;
    padding: 2px 4px;
    border-radius: 2px;
    min-width: 24px;
    text-align: center;
}

/* Slider track and thumb styling */
.piano-slider-pot input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #333;
    border: 1px solid #555;
    border-radius: 3px;
    outline: none;
    margin: 0;
}

.piano-slider-pot input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4a9f4a;
    border: 1px solid #fff;
    cursor: pointer;
}

.piano-slider-pot input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4a9f4a;
    border: 1px solid #fff;
    cursor: pointer;
}

/* Dropdown container */
.piano-dropdown {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 120px;
}

.piano-dropdown label {
    color: #4a9f4a;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
}

.piano-dropdown select {
    width: 100%;
    padding: 4px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #111;
    font-size: 11px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

.piano-dropdown:hover select {
    border-color: #4a9f4a;
    box-shadow: 0 0 3px rgba(74, 159, 74, 0.3);
}

/* Buttons */
.piano-btn {
    background: #2a4a2a;
    color: #fff;
    border: 2px solid #4a9f4a;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    margin-top: 6px;
    min-width: 80px;
}

.piano-btn:hover {
    background: #3a5a3a;
    border-color: #5aaf5a;
}

.piano-btn:active,
.piano-btn.active {
    background: #4a9f4a;
    color: #000;
    transform: scale(0.98);
}

/* Piano Play Glow */
.piano-component.playing {
    animation: piano-glow 0.5s ease-out;
}

@keyframes piano-glow {
    0% { box-shadow: 0 0 5px #fff; }
    50% { box-shadow: 0 0 15px #fff, 0 0 25px #fff; }
    100% { box-shadow: 0 0 5px #fff; }
}

/* CV Input Field */
.piano-cv-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 5px;
    height: 25px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #111;
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    width: 100%;
    max-width: 140px;
}

.piano-cv-field input.piano-cv-id {
    background: transparent;
    border: none;
    outline: none;
    font-size: 12px;
    color: #ccc;
    width: 100%;
    font-weight: bold;
}

.piano-cv-field input.piano-cv-id::placeholder {
    color: #666;
    font-weight: normal;
}

/* CV Connection Indicator */
.piano-cv-connection-indicator {
    width: 10px;
    height: 10px;
    background: gray;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 6px;
    transition: background 0.3s, box-shadow 0.3s;
}

.piano-cv-connection-indicator.connected {
    background: #ff8800;
    box-shadow: 0 0 4px rgba(255, 136, 0, 0.6);
}

.piano-cv-connection-indicator.invalid {
    background: red;
    box-shadow: 0 0 4px rgba(255, 0, 0, 0.6);
}

/* Frequency Information Styling */
.piano-freq-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px;
    margin-top: 5px;
    width: 100%;
    max-width: 140px;
}

.freq-ranges, .cv-examples {
    font-size: 10px;
    line-height: 1.2;
    color: #888;
    text-align: center;
}

.freq-ranges {
    border-bottom: 1px solid #333;
    padding-bottom: 6px;
    margin-bottom: 2px;
}

.cv-examples {
    padding-top: 2px;
}
