
/* Reduce the width of the chord-controls-container */
.chord-controls-container {
    background: #303030;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    margin-right: 0;
    flex-shrink: 0;
    width: 250px;
}

/* Reduce the width of the dropdown */
.narrow-dropdown {
    width: 60px; /* Already set to accommodate 2 characters */
}

/* Adjust the label width and spacing to bring dropdown closer */
.chord-control-group .control-row label {
    width: 60px; /* Reduced from 80px to bring the dropdown closer */
    margin-right: 3px; /* Reduced from 5px to minimize space between label and dropdown */
}

/* Ensure consistent alignment of radio buttons */
.chord-type-row {
    display: flex;
    gap: 0; /* Remove gap to control spacing manually */
    justify-content: flex-start;
}

/* Fine-tune chord-option for perfect vertical alignment */
.chord-option {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 55px; /* Adjusted width to ensure perfect alignment */
    justify-content: flex-start; /* Ensure consistent starting point */
}

/* Align the radio buttons with the dropdown */
.chord-type {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 63px; /* Align with the dropdown (label width 60px + margin 3px) */
}

/* Ensure radio buttons and labels are tightly aligned */
.chord-option label {
    font-size: 0.9em;
    color: #ccc;
    margin-right: 0;
    line-height: 1; /* Prevent extra vertical spacing */
}

/* Ensure radio buttons are vertically centered */
input[type="radio"] {
    margin-right: 5px;
    vertical-align: middle;
}

/* Ensure labels in chord-control-group are aligned with other control rows */
.chord-control-group .control-row label {
    width: 120px; /* Match the width of other labels for alignment */
}

/* Fine-tune radio button alignment */
input[type="radio"] {
    margin-right: 5px;
    vertical-align: middle;
}

.chord-option label {
    font-size: 0.9em;
    color: #ccc;
    margin-right: 0; /* Remove extra margin since gap is used */
}

/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body and global styles */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Logo styling */
.logo {
    text-align: left;
    padding: 15px 0;
    /* background: #222; */
    border-bottom: 2px solid #ff4500;
    font-size: 1.5em;
    letter-spacing: 1px;
}

.logo-black {
    color: #fff;
    font-weight: bold;
}

.logo-red {
    color: #ff4500;
    font-weight: bold;
}

.logo-title {
    color: #888;
    font-size: 0.8em;
    font-weight: normal;
}

/* Top controls container */
#top-controls {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    flex-wrap: nowrap;
    background: #252525;
    border-bottom: 1px solid #333;
    flex-grow: 0;
    align-items: stretch; /* Ensure all children stretch to the same height */
}

/* Control group styling */
.control-group, .middle-controls, .chord-wheel-container {
    background: #303030;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    margin-right: 15px;
}

.control-group:last-child, .middle-controls:last-child, .chord-wheel-container:last-child {
    margin-right: 0;
}

.control-row, .control-row-select {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.control-row > div, .chord-type {
    margin-right: 15px;
}

.control-row label, .control-row-select label {
    width: 120px; /* Fixed width for labels to ensure alignment */
    margin-right: 8px;
    font-size: 0.9em;
    color: #ccc;
}

select, input[type="number"], input[type="range"] {
    background: #404040;
    border: 1px solid #555;
    color: #fff;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

select:focus, input:focus {
    outline: none;
    border-color: #ff4500;
}

.narrow-dropdown {
    width: 120px;
}

input[type="radio"] {
    margin-right: 5px;
}

.chord-type-row {
    display: flex;
    gap: 10px;
}

.chord-option {
    display: flex;
    align-items: center;
}

/* Style the chord controls row to display Chord1 and Chord2 side by side */
.chord-controls-row {
    display: flex;
    gap: 20px;
}
/* Adjust chord-controls to add a gap between Chord 1 and Chord 2 */
.chord-controls {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Increased from 15px to 20px to create a noticeable gap between Chord 1 and Chord 2 */
}
.chord-control-group {
    flex: 1;
}

/* Backing track and audio controls */
.backing-track-container {
    flex-grow: 1;
}

#backing-track-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

button {
    background: #ff4500;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

button:hover {
    background: #e03d00;
}

#audio-player-container {
    background: #353535;
    padding: 10px;
    border-radius: 4px;
}

/* Basic audio player styling without custom controls */
audio {
    width: 100%;
    margin-top: 10px;
}

/* Remove ALL custom styling for audio controls */
audio::-webkit-media-controls-panel,
audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-play-button:hover,
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display,
audio::-webkit-media-controls-timeline,
audio::-webkit-media-controls-timeline::-webkit-slider-thumb,
audio::-webkit-media-controls-volume-slider,
audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb,
audio::-webkit-media-controls-mute-button,
audio::-webkit-media-controls-mute-button:hover,
audio::-webkit-media-controls-volume-control-container {
    /* Reset all properties to default */
    all: unset !important;
}

/* Middle controls (Circle of Fourths and Color Key) */
.middle-controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 600px;
}

.circle-of-fourths-container {
    margin-right: 20px;
    width: 200px;
    height: 200px;
}

.circle-of-fourths-svg {
    width: 100%;
    height: 100%;
}

.circle-note {
    fill: #404040;
    stroke: #fff;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 0.3s;
}

.circle-note.highlighted {
    fill: #ff4500;
}

.circle-note-label {
    fill: #fff;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

/* Key container */
.key-container {
    background: #303030;
    padding: 15px;
    border-radius: 8px;
    width: 300px;
}

.key-container h4 {
    margin-bottom: 10px;
    color: #ff4500;
}

.color-key {
    list-style: none;
}

.color-key li {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.color-box {
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 1px solid #555;
}

.root-color { background: #ff0000; }
.scale-color { background: #b4eeb4; }
.chord1-color { background: #0000ff; }
.chord2-color { background: #000000; }
.overlap-color { background: #800080; }
.accidental-color { background: #ffa500; }

.key-container div {
    display: flex;
    gap: 2px;
}

#colorOptionsBtn, #settingsOptionsBtn {
    flex: 1;
    padding: 8px 0;
    text-align: center;
}

/* Chord Wheel container */
.chord-wheel-container {
    flex-shrink: 0;
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chord-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #303030;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    width: 100%;
    height: 100%;
}

.chord-previous, .chord-next {
    font-size: 3.5em; /* Updated as per your change */
    margin: 5px 0;
    color: #fff;
}

.chord-current {
    font-size: 5.1em; /* Updated as per your change */
    color: #ff4500;
    font-weight: bold;
}

/* Fretboard container */
.fretboards-container {
    flex-grow: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.fretboard-container {
    margin-bottom: 2px;
}

.fretboard-label {
    font-size: 1.1em;
    color: #ff4500;
    margin-bottom: 10px;
}

.fretboard-svg {
    width: 100%;
    height: 289px;
    background: #353535;
    border: 1px solid #444;
    border-radius: 4px;
}

.fret {
    stroke: #666;
    stroke-width: 2;
}

.fret-highlight {
    stroke: #ff4500;
    stroke-width: 3;
}

.string {
    stroke: #999;
    stroke-width: 1;
}

.string-1, .string-6 { stroke-width: 2; }
.string-2, .string-5 { stroke-width: 1.5; }
.string-3, .string-4 { stroke-width: 1; }

.dot {
    fill: none;
    stroke: none;
    cursor: pointer;
}

.scale-highlight { fill: #b4eeb4; stroke: #9cb49c; }
.root-highlight { fill: #ff0000; stroke: #8b0000; }
.accidental-highlight { fill: #ffa500; stroke: #ff8c00; }
.chord-highlight-1 { fill: #0000ff; stroke: #8b3f2d; }
.chord-highlight-2 { fill: #000000; stroke: #333333; }
.overlap-highlight { fill: #800080; stroke: #800080; }

.note-label {
    fill: #000;
    font-size: 14px;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.root-note-label, .accidental-note-label, .chord1-note-label, .chord2-note-label, .overlap-note-label {
    fill: #fff;
}

.fret-marker {
    fill: #666;
    stroke: none;
}

.chord-line {
    stroke: #ff4500;
    stroke-width: 2;
    stroke-dasharray: 5,5;
}

/* Timeline */
#timeline-container {
    margin-top: 5px;
}

#timeline-svg {
    height: 30px;
    background: #353535;
    border: 1px solid #444;
    border-radius: 4px;
}

.timeline-chord-label {
    fill: #000;
    font-size: 12px;
    text-anchor: middle;
    dominant-baseline: middle;
}

.timeline-playhead {
    stroke: #ff0000;
    stroke-width: 2;
}

.timeline-offset {
    stroke: #00ff00;
    stroke-width: 2;
    stroke-dasharray: 5,5;
}

/* Audio controls */
#audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

#audio-controls button {
    background: #404040;
    padding: 5px;
    border-radius: 4px;
}

#audio-controls button:hover {
    background: #505050;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #303030;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #444;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.close, .settings-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover, .settings-close:hover {
    color: #fff;
}

.color-control, .settings-control {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.color-control label, .settings-control label {
    width: 150px;
}

h3, h4 {
    color: #ff4500;
    margin-bottom: 15px;
}

/* Animations */
.chord-change {
    animation: chordChange 0.5s ease-in-out;
}

@keyframes chordChange {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Print styles */
@media print {
    #top-controls, #audio-player-container, #audio-controls, #timeline-container, button {
        display: none !important;
    }

    .fretboards-container {
        padding: 0;
        margin: 0;
        height: auto;
        overflow: visible;
    }

    .fretboard-svg {
        width: 100%;
        height: auto;
    }
}

