/* Main CSS File */

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Code Editor Styles */
#code-editor {
    font-family: 'Fira Code', 'Courier New', monospace;
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
}

/* Virtual Piano Styles */
.piano-keyboard {
    position: relative;
    margin: 0 auto;
    border-radius: 4px;
}

.piano-key {
    position: absolute;
    top: 0;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.1s;
    user-select: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    font-weight: 500;
}

.piano-key span {
    pointer-events: none;
    font-size: 0.8rem;
    opacity: 0.7;
}

.piano-key.white {
    width: 40px;
    height: 160px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 4px 4px;
    z-index: 1;
    color: #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 -2px 5px rgba(0, 0, 0, 0.05);
}

.piano-key.white:hover {
    background: #f8f8f8;
}

.piano-key.white.active {
    background: #e2e8f0;
    box-shadow: 0 0px 2px rgba(0, 0, 0, 0.2), inset 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(2px);
    height: 158px;
}

.piano-key.black {
    width: 28px;
    height: 100px;
    background: linear-gradient(to bottom, #333, #000);
    border: 1px solid #000;
    border-radius: 0 0 3px 3px;
    z-index: 2;
    color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 -2px 5px rgba(255, 255, 255, 0.1);
}

.piano-key.black:hover {
    background: linear-gradient(to bottom, #444, #111);
}

.piano-key.black.active {
    background: linear-gradient(to bottom, #111, #000);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 2px 5px rgba(0, 0, 0, 0.5);
    transform: translateY(2px);
    height: 98px;
}

/* Exercise Mode Styles */
.piano-key.hint {
    box-shadow: 0 0 15px 5px rgba(59, 130, 246, 0.6), inset 0 0 10px rgba(59, 130, 246, 0.4);
    border-color: #3b82f6;
    z-index: 3;
}

.piano-key.error {
    background: #ef4444 !important;
    box-shadow: 0 0 15px 5px rgba(239, 68, 68, 0.6);
    transition: background-color 0.1s, box-shadow 0.1s;
}