/* General styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f0f8ff;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

/* Header styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.home-button, .sound-toggle {
    font-size: 24px;
    color: #4a6ea9;
    cursor: pointer;
    transition: color 0.3s;
}

.home-button:hover, .sound-toggle:hover {
    color: #7a9ed9;
}

h1 {
    color: #4a6ea9;
    text-align: center;
}

h1 small {
    font-size: 0.6em;
    color: #7a9ed9;
}

/* Piano container */
.piano-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    flex-grow: 1;
}

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

.octave-btn {
    background-color: #4a6ea9;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    margin: 0 15px;
    transition: background-color 0.3s;
}

.octave-btn:hover {
    background-color: #7a9ed9;
}

#octave-display {
    font-size: 18px;
    font-weight: bold;
    color: #4a6ea9;
    min-width: 100px;
    text-align: center;
}

/* Add styles for octave control feedback */
.octave-btn.active {
    background-color: #7a9ed9;
    transform: scale(0.95);
}

.octave-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

#octave-display.highlight {
    color: #ff6b6b;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Add transition for smoother animations */
.octave-btn, #octave-display {
    transition: all 0.2s ease;
}

/* Piano keys */
.piano {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: 250px;
    margin: 0 auto;
}

.white-keys {
    display: flex;
    height: 100%;
    position: relative;
    z-index: 1;
}

.black-keys {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    height: 60%;
    width: 100%;
    z-index: 2;
    pointer-events: none;
}

.key {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.1s;
    position: relative;
}

.white {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 0 0 5px 5px;
    flex: 1;
    color: #888;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.white:hover, .white.active {
    background-color: #f0f0f0;
}

.black {
    background-color: #333;
    width: 8%;
    height: 100%;
    position: absolute;
    border-radius: 0 0 5px 5px;
    color: #ccc;
    font-size: 0.8em;
    pointer-events: auto;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Position black keys correctly */
.black:nth-child(1) {
    left: 10.7%; /* C# */
}
.black:nth-child(2) {
    left: 25%; /* D# */
}
.black:nth-child(3) {
    left: 53.6%; /* F# */
}
.black:nth-child(4) {
    left: 67.9%; /* G# */
}
.black:nth-child(5) {
    left: 82.1%; /* A# */
}

.black:hover, .black.active {
    background-color: #555;
}

.spacer {
    display: none;
}

/* Instructions */
.instructions {
    text-align: center;
    margin: 20px 0;
    color: #666;
    font-size: 18px;
}

/* Footer */
footer {
    margin-top: auto;
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 14px;
}

footer a {
    color: #4a6ea9;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.version-info {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .piano {
        height: 200px;
    }
    
    .key {
        padding-bottom: 5px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .piano {
        height: 150px;
    }
    
    .key {
        font-size: 0.8em;
    }
    
    h1 {
        font-size: 1.5em;
    }
}

/* Make white keys clickable through their full height */
.white::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    z-index: 1;
}

/* Add sustain button styles */
.sound-toggle {
    font-size: 24px;
    color: #4a6ea9;
    cursor: pointer;
    transition: all 0.3s;
    padding: 8px;
    border-radius: 50%;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-toggle::after {
    content: 'Sustain: OFF';
    position: absolute;
    font-size: 10px;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0.7;
    display: block;
    width: 80px;
    text-align: center;
}

.sound-toggle.sustain-active::after {
    content: 'Sustain: ON';
    font-weight: bold;
    opacity: 1;
}

.sound-toggle.sustain-active {
    background-color: #4a6ea9;
    color: white;
    box-shadow: 0 0 10px rgba(74, 110, 169, 0.5);
}

/* Add sustained key style */
.key.sustained {
    background-color: #e6f0ff;
    box-shadow: inset 0 0 10px rgba(74, 110, 169, 0.3);
}

.black.sustained {
    background-color: #444;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Improve button feedback */
.pressed {
    transform: scale(0.95) !important;
    transition: transform 0.1s !important;
}

/* Add keyboard pressed state */
.key.keyboard-pressed {
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.3);
}

.white.keyboard-pressed {
    background-color: #ffe0e0;
}

.black.keyboard-pressed {
    background-color: #550000;
}

/* Add loading message styles */
.loading-message {
    text-align: center;
    padding: 20px;
    font-size: 18px;
    color: #4a6ea9;
    animation: pulse 1.5s infinite;
}

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

/* Add start message styles */
.start-message {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 18px;
    color: #4a6ea9;
    background-color: rgba(74, 110, 169, 0.1);
    border-radius: 8px;
    animation: pulse 1.5s infinite;
}

/* Add controls wrapper for multiple buttons */
.controls-wrapper {
    display: flex;
    align-items: center;
    gap: 25px;
}

/* Style for black keys toggle button */
.black-keys-toggle {
    font-size: 24px;
    color: #4a6ea9;
    cursor: pointer;
    transition: all 0.3s;
    padding: 8px;
    border-radius: 50%;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.black-keys-toggle::after {
    content: 'Black Keys: ON';
    position: absolute;
    font-size: 10px;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0.7;
    display: block;
    width: 80px;
    text-align: center;
}

.black-keys-toggle.hide-black-keys::after {
    content: 'Black Keys: OFF';
    font-weight: bold;
    opacity: 1;
}

.black-keys-toggle.hide-black-keys {
    background-color: #4a6ea9;
    color: white;
    box-shadow: 0 0 10px rgba(74, 110, 169, 0.5);
}

/* Add class for hiding black keys */
.black-keys.hidden {
    display: none;
}

/* Sound selector styles */
.sound-selector-container {
    position: relative;
    margin: 20px auto;
    width: 200px;
    z-index: 10;
}

.sound-selector-button {
    width: 100%;
    padding: 10px 15px;
    background-color: #4a6ea9;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-selector-button:hover {
    background-color: #5a7eb9;
    transform: translateY(-2px);
    box-shadow: 0 5px 8px rgba(0, 0, 0, 0.2);
}

.sound-selector-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
}

.sound-selector-button::after {
    content: '\f078'; /* Font Awesome down arrow */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 10px;
    font-size: 12px;
    transition: transform 0.3s;
}

.sound-selector-button.active::after {
    transform: rotate(180deg);
}

.sound-selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s;
    z-index: 20;
}

.sound-selector-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.sound-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: #333;
}

.sound-option:hover {
    background-color: #f0f8ff;
}

.sound-option.active {
    background-color: #e6f0ff;
    color: #4a6ea9;
    font-weight: bold;
}

/* Add animation for sound change */
@keyframes soundChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.piano.sound-changing {
    animation: soundChange 0.5s ease;
} 