/* css/knobs.css */
/* Knobs of all synth panels (drawn by _synth_knobs.js), the sections they sit in and the small buttons of a section head */

/* Sections: separated by a line, except the first one directly below the panel header */
#icosmo-matrix-synth-container .knob-section {
    border-top: 1px solid #333;
    padding: 3px 0 2px;
}
#icosmo-matrix-synth-container .knob-section:not(.knob-section ~ .knob-section) {
    border-top: none;
    padding-top: 0;
}
#icosmo-matrix-synth-container .knob-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 16px;
    font-size: var(--font-size-label);
    font-weight: bold;
    color: #ccc;
    letter-spacing: 0.05em;
}


/* Small switches in a section head (ping-pong / sync, pitch env targets), with the label font of the knobs */
#icosmo-matrix-synth-container .fx-small-buttons,
#icosmo-matrix-synth-container .knob-head-buttons,
#icosmo-matrix-synth-container .knob-section-head .pitch-env-target-button-group {
    display: flex;
    gap: 3px;
}
#icosmo-matrix-synth-container .fx-small-button,
#icosmo-matrix-synth-container .knob-head-button {
    background-color: #4a4a4a;
    color: #bbb;
    border: 1px solid #3a3a3a;
    border-radius: 3px;
    padding: 0 4px !important;
    margin: 0 !important;
    height: 15px;
    min-height: 0 !important;
    line-height: 13px;
    font-family: Arial, sans-serif;
    font-size: var(--font-size-label);
    font-weight: normal;
    letter-spacing: normal;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}
#icosmo-matrix-synth-container .fx-small-button:hover,
#icosmo-matrix-synth-container .knob-head-button:hover {
    background-color: #5a5a5a;
    color: #fff;
}
#icosmo-matrix-synth-container .fx-small-button.active,
#icosmo-matrix-synth-container .knob-head-button.active {
    background-color: #e0e0e0;
    color: #222222;
    border-color: #c0c0c0;
}


/* Knobs: four columns per row (five in the mixer) */
#icosmo-matrix-synth-container .knob-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
#icosmo-matrix-synth-container .synth-knob {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    gap: 0;
}
#icosmo-matrix-synth-container .synth-knob label.synth-knob-label {
    text-align: center;
    padding: 0;
    margin: 0 0 1px;
    font-size: var(--font-size-label);
}
#icosmo-matrix-synth-container .synth-knob-dial {
    position: relative;
    width: 40px;
    height: 40px;
}
#icosmo-matrix-synth-container .synth-knob-svg {
    display: block;
    width: 40px;
    height: 40px;
}
/* The range input lies invisibly over the knob: it keeps MIDI Learn, presets and keyboard focus working */
#icosmo-matrix-synth-container .synth-knob-dial input[type="range"].synth-knob-input {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    cursor: ns-resize;
    touch-action: none;
    -webkit-appearance: none;
    appearance: none;
}
#icosmo-matrix-synth-container .synth-knob-dial:has(.midi-learn-waiting) .synth-knob-svg {
    outline: 3px dashed #ff8c00;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff8c00b0;
}
#icosmo-matrix-synth-container .synth-knob-dial:has(.midi-mapped) .synth-knob-svg {
    border-left: 3px solid #e0e0e0;
    border-radius: 50%;
}
#icosmo-matrix-synth-container .synth-knob-dial:focus-within .synth-knob-svg {
    filter: brightness(1.2);
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-value {
    font-size: var(--font-size-value-display);
    color: #888;
    text-align: center;
    margin-top: -2px;
    min-height: 1em;
    white-space: nowrap;
}

/* LFO mapping below the knob (checkbox, LFO 1 / 2, depth) */
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo {
    width: 70px;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 3px;
    margin-top: 1px;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo .lfo-mod-checkbox,
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="range"].lfo-source-switch {
    margin: 0 !important;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="range"].lfo-mod-depth {
    flex: none;
    width: 30px;
    max-width: 30px;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo-spacer {
    height: 11px;
}


#icosmo-matrix-synth-container .knob-row.knob-row-5 {
    grid-template-columns: repeat(5, 1fr);
}
#icosmo-matrix-synth-container .knob-row-5 .synth-knob .synth-knob-lfo {
    width: 62px;
}
#icosmo-matrix-synth-container .knob-row-5 .synth-knob .synth-knob-lfo input[type="range"].lfo-mod-depth {
    width: 24px;
    max-width: 24px;
}

/* LFO panels: display above the knobs */
#icosmo-matrix-synth-container .knob-panel .lfo-visualizer-container-inline {
    margin: 4px 0 6px;
}
#icosmo-matrix-synth-container .knob-panel .lfo-mode-toggle {
    margin-left: 8px !important;
}

/* OSC 1 / OSC 2: FINE and SHAPE knobs, then the wave display over the two remaining columns */
#icosmo-matrix-synth-container .osc-wave-display {
    grid-column: span 2;
    display: flex;
    align-items: center;
    padding: 4px 2px 4px 6px;
    min-width: 0;
}
#icosmo-matrix-synth-container canvas.osc-wave-canvas {
    display: block;
    width: 100%;
    height: 62px;
    background-color: #111111;
    border: 1px solid #4f4f4f;
    border-radius: 3px;
    box-sizing: border-box;
}

/* LFO mapping below a knob (checkbox, LFO 1 / 2 switch, depth): all three 10 px high, taken from the depth fader:
   7 px track with a 10 px handle; the checkbox is a 10 px box in the same greys, filled in the LFO colour when on */
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo {
    align-items: center;
    height: 10px;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="checkbox"].lfo-mod-checkbox {
    -webkit-appearance: none;
    appearance: none;
    transform: none;
    width: 10px;
    height: 10px;
    margin: 0 !important;
    padding: 0;
    border: 1px solid #333;
    border-radius: 2px;
    background-color: #5f5f5f;
    box-sizing: border-box;
    cursor: pointer;
    flex: none;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="checkbox"].lfo-mod-checkbox:checked {
    background-color: var(--lfo-colour, #bdbdbd);
    border-color: #222;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="range"].lfo-source-switch {
    height: 10px;
    width: 18px;
    max-width: 18px;
    background: transparent;
    flex: none;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="range"].lfo-source-switch::-webkit-slider-runnable-track {
    height: 7px;
    background: #5f5f5f;
    border-radius: 2px;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="range"].lfo-source-switch::-moz-range-track {
    height: 7px;
    background: #5f5f5f;
    border-radius: 2px;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="range"].lfo-source-switch::-webkit-slider-thumb {
    width: 7px;
    height: 10px;
    margin-top: -1.5px;
    border-radius: 1px;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="range"].lfo-source-switch::-moz-range-thumb {
    width: 7px;
    height: 10px;
    border-radius: 1px;
    box-sizing: border-box;
}
#icosmo-matrix-synth-container .synth-knob .synth-knob-lfo input[type="range"].lfo-mod-depth {
    height: 7px;
}
