/* Chord Tutorial Styles */

.chord-tutorial {
    padding: 2rem 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.tutorial-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tutorial-title {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.tutorial-description {
    font-size: 1.25rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

/* Chord Selector */
.chord-selector {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chord-selector h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.chord-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.chord-category h3 {
    font-size: 1.25rem;
    color: #34495e;
    margin-bottom: 1rem;
    text-align: center;
}

.chord-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.chord-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
}

.chord-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.chord-btn.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    transform: scale(1.05);
}

/* Piano Section */
.piano-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.piano-section h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.piano-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    overflow-x: auto;
}

#piano-keyboard {
    max-width: 100%;
    height: auto;
}

/* Piano Keys */
.piano-key {
    cursor: pointer;
    transition: all 0.2s ease;
    stroke: #2c3e50;
    stroke-width: 1;
}

.white-key {
    fill: #ffffff;
}

.white-key:hover {
    fill: #f8f9fa;
}

.white-key.active {
    fill: #ff6b6b;
    stroke: #e74c3c;
    stroke-width: 2;
}

.black-key {
    fill: #2c3e50;
}

.black-key:hover {
    fill: #34495e;
}

.black-key.active {
    fill: #ff6b6b;
    stroke: #e74c3c;
    stroke-width: 2;
}

.key-label {
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    fill: #2c3e50;
    pointer-events: none;
    user-select: none;
}

.black-label {
    fill: #ffffff;
    font-size: 10px;
}

/* Chord Info */
.chord-info {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.chord-info h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.current-chord {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.chord-name {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.chord-notes {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.chord-note {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tutorial-title {
        font-size: 2rem;
    }
    
    .tutorial-description {
        font-size: 1rem;
    }
    
    .chord-categories {
        grid-template-columns: 1fr;
    }
    
    .chord-buttons {
        justify-content: center;
    }
    
    .chord-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .piano-container {
        padding: 0 1rem;
    }
    
    #piano-keyboard {
        width: 100%;
        min-width: 600px;
    }
    
    .key-label {
        font-size: 10px;
    }
    
    .black-label {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .chord-tutorial {
        padding: 1rem 0;
    }
    
    .chord-selector,
    .piano-section {
        padding: 1rem;
    }
    
    .tutorial-title {
        font-size: 1.5rem;
    }
    
    .chord-name {
        font-size: 1.5rem;
    }
    
    #piano-keyboard {
        min-width: 500px;
    }
}

/* Animation for chord highlighting */
@keyframes chordHighlight {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.piano-key.chord-highlight {
    animation: chordHighlight 0.5s ease-in-out;
}

/* Loading state */
.chord-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.chord-btn.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
