/* Modern Piano Interface /* Piano Section */
.piano-section {
    background: linear-gradient(135deg, #2a2a3a 0%, #1a1a2a 100%);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
}overflow: hidden;
}

.piano-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Digital Display */
.piano-display {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    border: 2px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    position: relative;
    z-index: 2;
}

.piano-display-note {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3rem;
    font-weight: 700;
    color: #8b5cf6;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.piano-display-instrument {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Piano Controls */
.piano-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.piano-control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.piano-control-group label {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-select {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    color: #ffffff;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 140px;
    transition: all 0.3s ease;
}

.control-select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.control-select option {
    background: #2a2a2a;
    color: #ffffff;
}

/* Volume Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 6px;
    background: linear-gradient(to right, #8b5cf6 0%, #8b5cf6 80%, rgba(255, 255, 255, 0.2) 80%, rgba(255, 255, 255, 0.2) 100%);
    border-radius: 3px;
    outline: none;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.8);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: all 0.3s ease;
}

/* Checkbox Toggle - Only for specific piano controls */
#key-label-toggle {
    appearance: none;
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#key-label-toggle:checked {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-color: #8b5cf6;
}

#key-label-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#key-label-toggle:checked::before {
    transform: translateX(24px);
}

/* Standard checkboxes for settings */
.settings-grid input[type="checkbox"],
.settings-options input[type="checkbox"],
.select-all-checkbox {
    appearance: auto;
    width: auto;
    height: auto;
    background: initial;
    border-radius: initial;
    position: initial;
}

/* Piano Keys Container */
.piano {
    display: flex;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    border-radius: 15px;
    padding: 3rem 2rem;
    box-shadow: inset 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 280px;
}

/* White Keys */
.white-key {
    width: 60px;
    height: 220px;
    background: linear-gradient(to bottom, 
        #ffffff 0%, 
        #f8f8f8 20%, 
        #f0f0f0 40%, 
        #e8e8e8 60%, 
        #e0e0e0 80%, 
        #d8d8d8 100%);
    border: 3px solid #c0c0c0;
    border-top: 4px solid #ffffff;
    border-left: 4px solid #f0f0f0;
    border-right: 4px solid #c0c0c0;
    border-bottom: 4px solid #a0a0a0;
    border-radius: 0 0 12px 12px;
    margin: 0 1px;
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.8),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.white-key:hover {
    background: linear-gradient(to bottom, 
        #f0f0f0 0%, 
        #e8e8e8 20%, 
        #e0e0e0 40%, 
        #d8d8d8 60%, 
        #d0d0d0 80%, 
        #c8c8c8 100%);
    transform: translateY(3px);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.7),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.white-key:active,
.white-key.key-pressed {
    background: linear-gradient(to bottom, 
        #e0e0e0 0%, 
        #d8d8d8 20%, 
        #d0d0d0 40%, 
        #c8c8c8 60%, 
        #c0c0c0 80%, 
        #b8b8b8 100%);
    transform: translateY(8px);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.7),
        inset 0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 -1px 2px rgba(255, 255, 255, 0.3);
    border-top: 2px solid #d0d0d0;
    border-left: 2px solid #c0c0c0;
    border-right: 2px solid #a0a0a0;
    border-bottom: 2px solid #808080;
}

/* Black Keys */
.black-key {
    width: 36px;
    height: 140px;
    background: linear-gradient(to bottom, 
        #4a4a4a 0%, 
        #3a3a3a 20%, 
        #2a2a2a 40%, 
        #1a1a1a 60%, 
        #0a0a0a 80%, 
        #000000 100%);
    border: 3px solid #000000;
    border-top: 3px solid #666666;
    border-left: 3px solid #444444;
    border-right: 3px solid #000000;
    border-bottom: 3px solid #000000;
    border-radius: 0 0 8px 8px;
    position: absolute;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.8),
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.black-key:hover {
    background: linear-gradient(to bottom, 
        #5a5a5a 0%, 
        #4a4a4a 20%, 
        #3a3a3a 40%, 
        #2a2a2a 60%, 
        #1a1a1a 80%, 
        #0a0a0a 100%);
    transform: translateY(3px);
    box-shadow: 
        0 12px 24px rgba(0, 0, 0, 0.9),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.9);
}

.black-key:active,
.black-key.key-pressed {
    background: linear-gradient(to bottom, 
        #2a2a2a 0%, 
        #1a1a1a 20%, 
        #0a0a0a 40%, 
        #000000 60%, 
        #000000 80%, 
        #000000 100%);
    transform: translateY(6px);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 1.0),
        inset 0 4px 8px rgba(0, 0, 0, 0.9),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1);
    border-top: 2px solid #333333;
    border-left: 2px solid #222222;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
}

/* Key Labels */
.key-label {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #666;
    display: none;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.black-key .key-label {
    color: #ccc;
    bottom: 15px;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Show labels when toggle is active */
.show-labels .key-label {
    display: block;
}

/* Active key highlighting */
.key-active {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
    border-color: #8b5cf6;
}

.white-key.key-active {
    /* Stronger purple tint for active white keys */
    background: linear-gradient(to bottom, #ede9fe 0%, #ddd6fe 50%, #c4b5fd 100%);
}

.black-key.key-active {
    /* Opaque brand purple to avoid underlying gaps showing through */
    background: linear-gradient(to bottom, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .piano-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .piano-control-group {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }
    
    .piano-display-note {
        font-size: 2rem;
    }
    
    .white-key {
        width: 45px;
        height: 180px;
    }
    
    .black-key {
        width: 28px;
        height: 110px;
    }
    
    .piano {
        padding: 2rem 1rem;
        min-height: 240px;
    }
}

/* Legacy styles for compatibility */
.progress-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    min-height: 4px;
}

.progress-line {
    width: 20px;
    height: 4px;
    background-color: #555;
    margin: 0 2px;
    border-radius: 2px;
}

.progress-step.correct {
    background-color: #22c55e;
}

.progress-step.incorrect {
    background-color: #ef4444;
}

.progress-step.player1-first {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #16a34a;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}

.progress-step.player2-second {
    background: linear-gradient(135deg, #f97373, #dc2626);
    border-color: #dc2626;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
}

.progress-step.player1-first.player2-second {
    background: linear-gradient(135deg, #22c55e 0%, #22c55e 50%, #dc2626 50%, #dc2626 100%);
    border-color: #dc2626;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

.ear-symbol {
    font-size: 5rem;
    color: #777;
    animation: none;
}

.ear-symbol.playing {
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.ear-training-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, #444, #333);
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
    min-height: 60px;
}

.ear-training-btn {
    background-color: #555;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin: 0 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.ear-training-btn:hover {
    background-color: #777;
}

.ear-training-btn:active {
    transform: scale(0.95);
}

.ear-training-btn.new-question {
    background-color: #f59e0b;
}

.ear-training-btn.new-question:hover {
    background-color: #d97706;
}

.answer-btn {
    background-color: #8b5cf6;
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    margin: 0.3rem 0.3rem;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, border 0.2s;
    font-size: 1rem;
    min-width: 50px;
    text-align: center;
    border: 2px solid transparent;
}

.answer-btn.comparison {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    margin: 0 1rem;
}

.answer-btn:hover {
    background-color: #22c55e;
}

.answer-btn:active {
    transform: scale(0.95);
}

.answer-btn.answer-feedback-correct {
    background-color: #16a34a;
    border-color: #bbf7d0;
    transform: scale(1.05);
}

.answer-btn.answer-feedback-incorrect {
    background-color: #dc2626;
    border-color: #fecaca;
    animation: shake 0.5s;
}

.answer-btn.answer-feedback-reveal {
    border-color: #16a34a;
    box-shadow: 0 0 10px #16a34a;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.instrument-btn {
    background-color: #666;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 0.3rem;
    margin: 0 0.3rem;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.instrument-btn:hover {
    background-color: #8b5cf6;
}

.instrument-btn.active {
    background-color: #8b5cf6;
}

.settings-modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    padding-top: 60px;
}

.settings-modal-content {
    background-color: #2d2d2d;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 700px;
    border-radius: 1rem;
    color: white;
}

.settings-close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.settings-close-btn:hover,
.settings-close-btn:focus {
    color: #fff;
    text-decoration: none;
}

.settings-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #3a3a3a;
    border-radius: 0.5rem;
}

.settings-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.settings-grid label {
    display: flex;
    align-items: center;
    background-color: #4a4a4a;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.settings-grid input[type="checkbox"],
.settings-options input[type="checkbox"],
.select-all-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

.settings-options label {
    margin-right: 15px;
}

.settings-slider-container {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.settings-slider-container label {
    width: 120px;
    margin-right: 10px;
}

.settings-slider-container input[type="range"] {
    flex-grow: 1;
}

.settings-slider-container span {
    margin-left: 10px;
    min-width: 60px;
    text-align: right;
}

.settings-button-container {
    text-align: right;
    margin-top: 20px;
}

.settings-button {
    background-color: #555;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s;
}

.settings-button:hover {
    background-color: #777;
}

.settings-button.primary {
    background-color: #3b82f6;
}

.settings-button.primary:hover {
    background-color: #2563eb;
}

.settings-gear-icon {
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 10px;
    color: #ccc;
    transition: color 0.2s;
}

.settings-gear-icon:hover {
    color: white;
}

.notation-section svg {
    max-width: 100%;
    height: auto;
    background-color: white;
    border-radius: 4px;
    padding: 10px;
}

.navbar-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    max-width: 95% !important;
    margin: 0 auto !important;
    gap: 1.5rem !important;
}

.navbar-links {
    display: flex !important;
    justify-content: flex-end !important;
    flex-grow: 1 !important;
    gap: 2rem !important;
    flex-wrap: wrap !important;
    padding: 0rem 1rem !important;
    margin: 0 !important;
}
