/* Visual Keyboard Styles */

/* Keyboard Mode Section */
.keyboard-mode-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.keyboard-mode-section:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.keyboard-mode-section h3 {
    margin: 0 0 15px 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.keyboard-mode-section h3::before {
    content: '🎼';
    font-size: 20px;
}

.keyboard-toggle {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    width: 100%;
    font-size: 17px;
    font-weight: 600;
    padding: 16px 24px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
}

.keyboard-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.keyboard-toggle:hover::before {
    left: 100%;
}

.keyboard-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #7c8ff5, #8e5bb0) !important;
}

.keyboard-toggle.active {
    background: linear-gradient(135deg, #48bb78, #38a169) !important;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.keyboard-toggle.active:hover {
    background: linear-gradient(135deg, #5dcd88, #4ab179) !important;
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5);
}

.keyboard-icon {
    font-size: 22px;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
    animation: gentle-bounce 2s ease-in-out infinite;
}

@keyframes gentle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.mode-status {
    margin: 12px 0 0 0;
    font-size: 14px;
    color: #cbd5e0;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-status.playing-mode {
    color: #48bb78;
    font-weight: 600;
    font-size: 15px;
    text-shadow: 0 0 10px rgba(72, 187, 120, 0.3);
}

/* Visual Keyboard Container */
.visual-keyboard {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    z-index: 200;
}

.visual-keyboard.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.visual-keyboard.hidden {
    display: none;
}

.keyboard-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keyboard-close:hover {
    background: rgba(255, 0, 0, 0.3);
    transform: scale(1.1);
}

/* Keyboard Wrapper */
.keyboard-wrapper {
    text-align: center;
}

.keyboard-wrapper h4 {
    margin: 0 0 15px 0;
    color: #00ff88;
    font-size: 18px;
}

/* Piano Keys Container */
.keys-container {
    position: relative;
    height: 120px;
    width: 550px;
    margin: 0 auto;
}

/* Piano Keys */
.piano-key {
    position: absolute;
    cursor: pointer;
    user-select: none;
    transition: all 0.05s ease;
}

.white-key {
    width: 48px;
    height: 120px;
    background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%);
    border: 1px solid #333;
    border-radius: 0 0 5px 5px;
    z-index: 1;
}

.white-key:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
}

.white-key.active {
    background: linear-gradient(180deg, #00ff88 0%, #00cc6a 100%);
    transform: translateY(2px);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.black-key {
    width: 30px;
    height: 80px;
    background: linear-gradient(180deg, #333 0%, #000 100%);
    border-radius: 0 0 3px 3px;
    z-index: 2;
}

.black-key:hover {
    background: linear-gradient(180deg, #444 0%, #111 100%);
}

.black-key.active {
    background: linear-gradient(180deg, #0080ff 0%, #0060cc 100%);
    transform: translateY(2px);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Key Labels */
.key-label {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: bold;
    color: #333;
    pointer-events: none;
}

.black-key .key-label {
    color: #fff;
    bottom: 8px;
    font-size: 10px;
}

.white-key.active .key-label {
    color: #000;
}

/* Drum Pads */
.drum-pads h4 {
    margin: 20px 0 15px 0;
    color: #ff6600;
    font-size: 18px;
}

.pads-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.drum-pad {
    background: linear-gradient(135deg, #333 0%, #222 100%);
    border: 2px solid #555;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.1s ease;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drum-pad:hover {
    background: linear-gradient(135deg, #444 0%, #333 100%);
    transform: scale(1.05);
}

.drum-pad.active {
    background: linear-gradient(135deg, #ff6600 0%, #cc4400 100%);
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
}

.drum-pad span:first-child {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.drum-pad .key-label {
    position: static;
    transform: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .visual-keyboard {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: translateX(0) translateY(100%);
        width: auto;
        padding: 15px;
    }
    
    .visual-keyboard.visible {
        transform: translateX(0) translateY(0);
    }
    
    .keys-container {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .pads-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
