/* Tuning Controls and Modal */

/* Tuning Column Styles */
.tuning-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.tuning-button,
.fret-count-button {
    background: linear-gradient(135deg, #4a4f8d 0%, #3a3f78 100%);
    padding: 0 10px;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    border: 1px solid rgba(140, 150, 220, 0.35);
    border-radius: 6px;
    color: rgba(235, 231, 255, 0.85);
    cursor: pointer;
    height: 28px;
    padding: 0 10px;
    line-height: 1;
    width: 5.5em;
    line-height: 1;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tuning-button:hover,
.fret-count-button:hover {
    background: linear-gradient(135deg, #5a63b0 0%, #4953a0 100%);
    border-color: rgba(150, 170, 255, 0.7);
    color: rgba(235, 231, 255, 0.95);
    box-shadow: 0 0 6px rgba(120, 150, 255, 0.28);
}

.tuning-indicator,
.fret-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4CAF50;
    opacity: 0.75;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.tuning-display {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #ccc);
    text-align: center;
}

.tuning-strings-text {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary, #ccc);
    text-align: center;
    margin-top: 1px;
}

/* Tuning Modal Styles */
.tuning-modal-content {
    max-width: 820px;
    width: calc(100% - 4em);
}

.tuning-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: center;
    gap: 12px;
    margin: 20px auto;
    width: min(100%, 960px);
    max-width: 960px;
    align-items: stretch;
    grid-auto-flow: row;
}

.tuning-preset-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tuning-preset-button {
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.12), rgba(33, 150, 243, 0.06));
    border: 2px solid rgba(33, 150, 243, 0.5);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.2s ease;
    color: var(--text-primary, #233049);
    position: relative;
}

.preset-indicator {
    display: none;
}

/* Strum button with blue theme */
.manual-strum-controls button {
    background: rgba(33, 150, 243, 0.12);
    border: 2px solid rgba(33, 150, 243, 0.6);
    color: var(--text-primary, #e8e8e8);
    box-shadow: 0 0 12px rgba(33, 150, 243, 0.35);
    transition: all 0.2s ease;
    font-size: 24px;
    font-weight: 600;
    padding: 14px 24px;
}

.manual-strum-controls button:hover {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.9);
    box-shadow: 0 0 16px rgba(33, 150, 243, 0.5);
}

/* Dark-mode label tweaks */
.capo-label,
.super-capo-label,
#superCapoControls .capo-label {
    color: var(--text-secondary, #cfd7e2);
}

.tuning-preset-button:hover {
    background-color: rgba(33, 150, 243, 0.08);
    border-color: #1976D2;
}

.tuning-preset-button.active {
    background-color: #2196F3;
    color: white;
    border-color: #2196F3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.4);
}

.tuning-section {
    margin: 16px auto;
    padding: 16px 18px;
    background-color: var(--panel-bg, #f9f9f9);
    border: 1px solid var(--panel-border, #e0e0e0);
    border-radius: 8px;
    max-width: 820px;
    width: 100%;
}

.tuning-section#capoSection {
    text-align: center;
}

.tuning-section-title {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary, #333);
}

.tuning-instructions-text {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-secondary, #666);
    text-align: center;
}

.sample-sustain-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.sample-library-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.sample-library-select {
    min-width: 240px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--panel-border, #d3d3d3);
    background: var(--panel-muted, #ffffff);
    color: var(--text-primary, #333);
    font-size: 15px;
}

.sample-sustain-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary, #666);
}

.sample-sustain-slider {
    width: min(340px, 70vw);
}

.sample-sustain-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #333);
    min-width: 64px;
    text-align: right;
}

.tuning-strings-container {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    align-items: flex-start;
}

.tuning-string {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px 12px;
    background-color: var(--panel-muted, #ffffff);
    border-radius: 8px;
    border: 2px solid var(--panel-border, #e0e0e0);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 54px;
    gap: 6px;
}

.tuning-string:hover {
    border-color: #2196F3;
    background-color: #214277;
}

.tuning-string.selected {
    border-color: #2196F3;
    background-color: #12639e;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.string-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary, #666);
    text-align: center;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.string-label-text {
    font-size: 15px;
}

.string-label-number {
    font-size: 28px;
    font-weight: 700;
    color: #2196F3;
    line-height: 1;
}

.string-note {
    display: flex;
    align-items: baseline;
    justify-content: center;
    font-family: 'Courier New', monospace;
    color: #c3d6e6 !important;
    text-align: center;
    padding: 10px 14px;
    background-color: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.note-letter {
    font-size: 44px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(90, 155, 255, 0.3);
}

.note-octave {
    font-size: 22px;
    font-weight: 600;
    opacity: 0.75;
    align-self: flex-end;
    margin-bottom: 4px;
    margin-left: 1px;
}

.tuning-string.selected .string-note {
    background-color: white;
    border-color: #2196F3;
}

/* Dark mode styling for string notes */
html[data-theme="dark"] .string-note {
    background-color: #0f2038;
    color: #5a9bff !important;
    border-color: rgba(90, 155, 255, 0.4);
}

html[data-theme="dark"] .note-letter {
    text-shadow: 0 2px 12px rgba(90, 155, 255, 0.4);
}

html[data-theme="dark"] .note-octave {
    opacity: 0.6;
}

html[data-theme="dark"] .tuning-string.selected .string-note {
    background-color: #152743;
    border-color: rgba(90, 155, 255, 0.7);
}

html[data-theme="dark"] .tuning-string.selected .note-letter {
    text-shadow: 0 2px 16px rgba(90, 155, 255, 0.6);
}

/* Capo Controls */
.capo-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.capo-button {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.85);
    color: #333;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.capo-button:hover,
.capo-button:focus-visible {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.15);
}

.capo-button.active {
    background: #2196F3;
    border-color: #2196F3;
    color: #fff;
}

.capo-button.small {
    padding: 4px 10px;
    font-size: 16px;
}

.capo-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    overflow: hidden;
    padding: 2px;
}

.capo-stepper-small {
    transform: scale(0.9);
    transform-origin: center;
}

.capo-stepper-btn {
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

.capo-stepper span {
    min-width: 36px;
    text-align: center;
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

.capo-stepper:focus-visible {
    outline: 2px solid rgba(33, 150, 243, 0.4);
    outline-offset: 2px;
}

.capo-stepper:focus {
    box-shadow: 0 0 0 2.5px rgba(66, 165, 245, 0.8), 0 0 10px rgba(66, 165, 245, 0.4);
}

.capo-stepper-stack {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    justify-content: center;
}

.capo-stepper-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.capo-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary, #cfd7e2);
    letter-spacing: 0.05em;
    padding-top: 1em;
}

.capo-super .capo-label {
    font-size: 15px;
    color: var(--text-secondary, #cfd7e2);
}

.capo-stepper-stack .capo-stepper {
    margin: 0 auto;
}

.capo-super-controls {
    position: relative;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 2px;
}

.capo-super-controls.visible {
    display: flex;
}

.capo-special-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(180, 200, 220, 0.7);
    margin: 10px 0 0;
    user-select: none;
}

.capo-special-checkbox input[type="checkbox"] {
    accent-color: #5ba3d9;
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
}

.capo-special-checkbox-text {
    letter-spacing: 0.02em;
}

.capo-lock {
    position: absolute;
    right: -50px;
    bottom: 6px;
    transform: scale(0.7);
    display: none;
    align-items: center;
    gap: 3px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    padding: 2px 6px;
    color: #555;
    font-size: 10px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.capo-lock.visible {
    display: inline-flex;
}

.capo-lock .lock-icon {
    font-size: 14px;
}

.capo-lock.unlocked {
    color: #d35400;
}

/* Bigger lock button for banjo */
.capo-lock.banjo-lock {
    transform: scale(1.1);
    right: -70px;
    bottom: 5px;
    padding: 0px 8px;
    font-size: 11px;
    padding-bottom: 2px;
}

.capo-lock.banjo-lock .lock-icon {
    font-size: 15px;
}

.capo-hint {
    font-size: 13px;
    color: #6c6;
    text-align: center;
    margin-bottom: 0;
    margin-top: 10px;
}
