* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.08);
    padding: 2rem;
    border-top: 2rem solid transparent; 
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #ffffff;
    font-weight: 500;
}

h2 {
    text-align: center;
    margin: 30px 0 20px;
    color: #ffffff;
    font-weight: 500;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Octave Controls */
.octave-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.octave-button {
    background-color: #4c4c4c2e;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 15px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.octave-button:hover {
    background-color: #2c3e50;
}

.octave-button:active {
    transform: scale(0.95);
}

#current-octave {
    font-size: 18px;
    font-weight: bold;
    color: #34495e;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Notes Container */
.notes-container {
    display: flex;
    flex-direction: row;
    width: auto;
    justify-content: space-evenly;
    margin-bottom: 30px;
    overflow-x: auto;
    padding: 10px 0;
}

.note-button {
    width: 100%;
    height: 60px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 5px;
    margin: 0 2px;
    background-color: #f8f8f8;
    color: #333;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.freq-label {
    font-size: 10px;
    opacity: 0.7;
    font-weight: normal;
    display: block;
    margin-top: 2px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Default black & white scheme */
.note-button {
    background-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #ffffff3f;

    font-weight: 500;
}

.note-button.accidental {
    background-color: rgba(0, 0, 0, 0.2);
    color: white;
}

/* Hover Colors (only on hover) */
.note-button:hover, .note-button.keyboard-pressed {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#note-C:hover, #note-C.keyboard-pressed { background: linear-gradient(145deg, #e74c3c, #c0392b); color: white; }
#note-C\#:hover, #note-C\#.keyboard-pressed { background: linear-gradient(145deg, #e67e22, #d35400); }
#note-D:hover, #note-D.keyboard-pressed { background: linear-gradient(145deg, #f1c40f, #f39c12); color: white; }
#note-D\#:hover, #note-D\#.keyboard-pressed { background: linear-gradient(145deg, #27ae60, #2ecc71); }
#note-E:hover, #note-E.keyboard-pressed { background: linear-gradient(145deg, #1abc9c, #16a085); color: white; }
#note-F:hover, #note-F.keyboard-pressed { background: linear-gradient(145deg, #3498db, #2980b9); color: white; }
#note-F\#:hover, #note-F\#.keyboard-pressed { background: linear-gradient(145deg, #2c3e50, #34495e); }
#note-G:hover, #note-G.keyboard-pressed { background: linear-gradient(145deg, #9b59b6, #8e44ad); color: white; }
#note-G\#:hover, #note-G\#.keyboard-pressed { background: linear-gradient(145deg, #8e44ad, #9b59b6); }
#note-A:hover, #note-A.keyboard-pressed { background: linear-gradient(145deg, #2980b9, #3498db); color: white; }
#note-A\#:hover, #note-A\#.keyboard-pressed { background: linear-gradient(145deg, #16a085, #1abc9c); }
#note-B:hover, #note-B.keyboard-pressed { background: linear-gradient(145deg, #f39c12, #f1c40f); color: white; }
#note-C2:hover, #note-C2.keyboard-pressed { background: linear-gradient(145deg, #e74c3c, #c0392b); color: white; }

.note-button.active {
    transform: translateY(0);
    opacity: 0.9;
}

/* Chord Library */
.chord-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.chord-group {
    background-color: rgba(255, 255, 255, 0);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #ffffff3f;
}

h3 {
    margin-bottom: 12px;
    font-size: 16px;
    color: #ffffff;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.chord-buttons {
    display: flex;
    flex-direction: row;
    width: auto;
    gap: 10px;
}

.chord-button {
    font-weight: 500;
    min-width: 70px;
    padding: 10px 15px;
    width: 100%;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: rgba(0, 0, 0, 0.152);
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.chord-button:hover, .chord-button.active {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.chord-button:active {
    transform: translateY(0);
}

/* Chord Type Styling */
.chord-button.minor {
    background-color: rgba(0, 0, 0, 0.152);
    border-left: 3px solid #00000045;
}

.chord-button.seventh {
    background-color: rgba(0, 0, 0, 0.152);
    border-left: 3px solid #00000045;
}

.chord-button.extended {
    background-color: rgba(0, 0, 0, 0.152);
    border-left: 3px solid #00000045;
}

/* Chord Hover Colors */
#chord-Cmaj:hover, #chord-Cmaj.active { background: linear-gradient(145deg, #e74c3c, #c0392b); color: white; }
#chord-Dmaj:hover, #chord-Dmaj.active { background: linear-gradient(145deg, #f1c40f, #f39c12); color: white; }
#chord-Emaj:hover, #chord-Emaj.active { background: linear-gradient(145deg, #1abc9c, #16a085); color: white; }
#chord-Fmaj:hover, #chord-Fmaj.active { background: linear-gradient(145deg, #3498db, #2980b9); color: white; }
#chord-Gmaj:hover, #chord-Gmaj.active { background: linear-gradient(145deg, #9b59b6, #8e44ad); color: white; }
#chord-Amaj:hover, #chord-Amaj.active { background: linear-gradient(145deg, #2980b9, #3498db); color: white; }
#chord-Bmaj:hover, #chord-Bmaj.active { background: linear-gradient(145deg, #f39c12, #f1c40f); color: white; }

.chord-button.minor:hover, .chord-button.minor.active {
    background: linear-gradient(145deg, #7f8c8d, #95a5a6);
    color: white;
    border-left: 3px solid #e74c3c;
}

.chord-button.seventh:hover, .chord-button.seventh.active {
    background: linear-gradient(145deg, #34495e, #2c3e50);
    color: white;
    border-left: 3px solid #3498db;
}

.chord-button.extended:hover, .chord-button.extended.active {
    background: linear-gradient(145deg, #8e44ad, #9b59b6);
    color: white;
    border-left: 3px solid #9b59b6;
}



.control-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

label {
    margin-right: 10px;
    min-width: 100px;
    font-weight: bold;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

select, input[type="range"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex: 1;
    max-width: 300px;
}

#duration-value {
    margin-left: 10px;
    font-weight: bold;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Scales & Modes */
.scale-container {
    display: flex;
    flex-direction: column;
    gap: 20px;  
    margin-bottom: 30px;
}

.scale-group {
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #ffffff3f;
}

.scale-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-direction: row;
    width: auto;
    justify-content: space-evenly;
}

.scale-button {
    min-width: 150px;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    background-color: rgba(255, 0, 0, 0.152);
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.scale-button:hover, .scale-button.active {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.scale-button:active {
    transform: translateY(0);
}

/* Scale Type Styling */
.scale-button.major {
    background-color: rgba(0, 0, 0, 0.152);
    border-left: 3px solid #00000045;
}

.scale-button.minor {
    background-color: rgba(0, 0, 0, 0.152);
    border-left: 3px solid #00000045;
}

.scale-button.mode {
    background-color: rgba(0, 0, 0, 0.152);
    border-left: 3px solid #00000045;
}

.scale-button.pentatonic {
    background-color: rgba(0, 0, 0, 0.152);
    border-left: 3px solid #00000045;
}

/* Scale Hover Colors */
.scale-button.major:hover, .scale-button.major.active {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    border-left: 3px solid #3498db;
}

.scale-button.minor:hover, .scale-button.minor.active {
    background: linear-gradient(145deg, #9b59b6, #8e44ad);
    color: white;
    border-left: 3px solid #9b59b6;
}

.scale-button.mode:hover, .scale-button.mode.active {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    color: white;
    border-left: 3px solid #2ecc71;
}

.scale-button.pentatonic:hover, .scale-button.pentatonic.active {
    background: linear-gradient(145deg, #f39c12, #e67e22);
    color: white;
    border-left: 3px solid #f39c12;
}

/* Scale Options */
.scale-options {
    background-color: rgba(0, 0, 0, 0.152);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.scale-direction-control, .scale-speed-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

#scale-direction {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    width: 150px;
}

#scale-speed {
    width: 300px;
}

#scale-speed-value {
    font-weight: bold;
    min-width: 70px;
}

/* Mini Keyboard */
.mini-keyboard-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.709);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    z-index: 1000;
    width: 280px;
    border: 1px solid #c7c7c7;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mini-keyboard-container:hover {
    transform: scale(1.05);
}

/* Octave Controls in Mini Keyboard */
.mini-keyboard-container .octave-controls {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.mini-keyboard-container .octave-button {
    padding: 5px 10px;
    font-size: 14px;
    margin: 0 8px;
}

.mini-keyboard-container #current-octave {
    font-size: 14px;
}

h4 {
    text-align: center;
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #555;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.mini-keyboard {
    display: flex;
    position: relative;
    height: 60px;
}

.mini-note {
    flex: 1;
    height: 100%;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5px;
    font-size: 10px;
    color: #777;
    position: relative;
    transition: all 0.1s;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.mini-note.accidental {
    position: absolute;
    width: 14px;
    height: 60%;
    background-color: #333;
    color: white;
    z-index: 1;
    border-radius: 0 0 3px 3px;
}

/* Position the accidentals */
#mini-C\# { left: 8.9%; }
#mini-D\# { left: 22.5%; }
#mini-F\# { left: 50%; }
#mini-G\# { left: 64%; }
#mini-A\# { left: 77.5%; }

/* Active state for mini keyboard notes */
.mini-note.active {
    transform: scale(0.95);
    box-shadow: none
}

/* Colors for active mini notes (match the main keyboard colors) */
#mini-C.active { background: linear-gradient(145deg, #e74c3c, #c0392b); color: white; }
#mini-C\#.active { background: linear-gradient(145deg, #e67e22, #d35400); }
#mini-D.active { background: linear-gradient(145deg, #f1c40f, #f39c12); color: white; }
#mini-D\#.active { background: linear-gradient(145deg, #27ae60, #2ecc71); }
#mini-E.active { background: linear-gradient(145deg, #1abc9c, #16a085); color: white; }
#mini-F.active { background: linear-gradient(145deg, #3498db, #2980b9); color: white; }
#mini-F\#.active { background: linear-gradient(145deg, #2c3e50, #34495e); }
#mini-G.active { background: linear-gradient(145deg, #9b59b6, #8e44ad); color: white; }
#mini-G\#.active { background: linear-gradient(145deg, #8e44ad, #9b59b6); }
#mini-A.active { background: linear-gradient(145deg, #2980b9, #3498db); color: white; }
#mini-A\#.active { background: linear-gradient(145deg, #16a085, #1abc9c); }
#mini-B.active { background: linear-gradient(145deg, #f39c12, #f1c40f); color: white; }
#mini-C2.active { background: linear-gradient(145deg, #e74c3c, #c0392b); color: white; } 

@media screen and (max-width: 768px){
    .chord-container, .notes-container {
        flex-direction: column;
    }
    .chord-group {
        width: 100%;
    }
    .chord-buttons, .notes-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .chord-button, .note-button {
        min-width: 20px;
    }
}

/* Recording Controls */
.recording-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background-color: transparent;
}

.record-button, .stop-button {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.record-button {
    background-color: #e74c3c;
    color: white;
}

.record-button:hover {
    background-color: #c0392b;
}

.record-button.recording {
    background-color: #c0392b;
    animation: pulse 1.5s infinite;
}

.stop-button {
    background-color: #34495e;
    color: white;
}

.stop-button:hover:not([disabled]) {
    background-color: #2c3e50;
}

.stop-button[disabled] {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.recording-indicator {
    display: flex;
    align-items: center;
    margin: 0 15px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
}

.recording-indicator.active {
    opacity: 1;
}

.rec-dot {
    width: 12px;
    height: 12px;
    background-color: #e74c3c;
    border-radius: 50%;
    margin-left: 10px;
    animation: pulse 1.5s infinite;
}

/* Recordings Container */
.recordings-container {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.recording-item {
    display: flex;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.42);
    gap: 0.5rem;
    border-radius: 5px;
    padding-top: 12px;
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 6px;
    border: 1px solid #ffffff1b;
}

.recording-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.recording-title {
    font-weight: bold;
    font-size: 14px;
    color: #ffffff;
    font-weight: 400;
    margin: 0;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recording-info {
    font-size: 12px;
    color: #ffffff8c;
    margin: 0;
    padding: 2px 4px;
    background-color: #0000001e;
    border-radius: 3px;
    border: 0.5px solid #ffffff1b;
}


.recording-play,
.recording-download,
.recording-delete {
    flex: 1;
    height: 2.5rem;
    border: none;
    padding: 8px 5px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: 500;
}

audio {
    width: 100%;
    height: 0px;
    visibility: hidden;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Controls Panel */
.controls-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 300px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    z-index: 1000;
    border: 1px solid #ffffff21;
    max-height: 80vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.controls-panel:hover {
    transform: scale(1.02);
}

.controls-header {
    padding-bottom: 10px;
}

.controls-header h3 {
    margin: 0;
    color: #ffffff;
    text-align: left;
    font-weight: 500;
}

/* Options Section */
.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: rgba(0, 0, 0, 0.152);
    padding: 20px;
    font-weight: 500;
    border-radius: 8px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}



.options h4 {
    color: #ffffff;
    font-weight: 500;
}

/* Recording Section */
.recording-section {
    margin-top: 20px;
}

.recording-section h4 {
    margin: 0 0 15px 0;
    color: #e74c3c;
}

.record-toggle {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: none;
    border-radius: 5px;
    background-color: #e74c3c;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.record-toggle:hover {
    background-color: #c0392b;
}

.record-toggle.recording {
    background-color: #c0392b;
    animation: pulse 1.5s infinite;
}

.record-toggle.recording::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 1.5s infinite;
}

/* Recording button styles */
.recording-play {
    background-color: transparent;
    color: #ffffffe6;
    border: 1px solid #ffffffe6;
}

.recording-play:hover {
    background-color: #ffffff;
    color: rgb(0, 0, 0);
    border: 1px solid #ffffff;
}

.recording-download {
    background-color: transparent;
    color: #ffffffe6;
    border: 1px solid #ffffffe6;
}

.recording-download:hover {
    background-color: #ffffff;
    color: rgb(0, 0, 0);
    border: 1px solid #ffffff;
}

.recording-delete {
    color: rgb(255, 43, 43);
    background-color: transparent;
    border: 1px solid rgb(255, 43, 43);
}

.recording-delete:hover {
    background-color: rgb(255, 43, 43);
    color: rgb(255, 255, 255);
} 

.no-recordings {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 10px;
}

/* Media Queries */
@media (max-width: 768px) {
    .controls-panel {
        width: 90%;
        left: 5%;
        bottom: 10px;
    }
}