* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Piano Styles */
.piano-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.piano {
    display: flex;
    justify-content: center;
    position: relative;
    height: 200px;
    background: #f8f8f8;
    border-radius: 10px;
    padding: 10px;
    overflow: hidden;
}

.key {
    position: relative;
    cursor: pointer;
    transition: all 0.1s ease;
    border: 1px solid #ccc;
    user-select: none;
}

.key.white {
    width: 40px;
    height: 180px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);
    border-radius: 0 0 5px 5px;
    margin: 0 1px;
    z-index: 1;
}

.key.black {
    width: 25px;
    height: 120px;
    background: linear-gradient(to bottom, #333 0%, #111 100%);
    border-radius: 0 0 3px 3px;
    position: absolute;
    z-index: 2;
    margin-left: -12.5px;
}

.key.white:hover {
    background: linear-gradient(to bottom, #f0f0f0 0%, #e8e8e8 100%);
}

.key.black:hover {
    background: linear-gradient(to bottom, #555 0%, #333 100%);
}

.key.active {
    transform: scale(0.95);
}

.key.white.active {
    background: linear-gradient(to bottom, #4CAF50 0%, #45a049 100%);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.key.black.active {
    background: linear-gradient(to bottom, #2196F3 0%, #1976D2 100%);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
}

.key-label {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: bold;
    pointer-events: none;
}

.key.white .key-label {
    color: #666;
}

.key.black .key-label {
    color: #ccc;
}

/* Chord Display */
.chord-display {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.chord-display h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.chord-display p {
    font-size: 1.1rem;
    color: #666;
}

/* Chord Controls */
.chord-controls {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.chord-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.chord-btn {
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.chord-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.chord-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chord-btn.selected {
    background: linear-gradient(145deg, #4CAF50, #45a049);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.settings-btn {
    background: #ff7043;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.settings-btn:hover {
    background: #ff5722;
    transform: scale(1.05);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    color: #333;
    margin: 0;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
}

.available-chords {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.chord-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
}

.chord-option:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.chord-option.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.chord-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-footer button:first-child {
    background: #6c757d;
    color: white;
}

.modal-footer button:first-child:hover {
    background: #5a6268;
}

.modal-footer button:last-child {
    background: #667eea;
    color: white;
}

.modal-footer button:last-child:hover {
    background: #5a67d8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .piano {
        height: 150px;
        padding: 5px;
    }
    
    .key.white {
        width: 30px;
        height: 135px;
    }
    
    .key.black {
        width: 20px;
        height: 90px;
        margin-left: -10px;
    }
    
    .chord-buttons {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .chord-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        margin: 10% auto;
        max-width: 95%;
    }
    
    .available-chords {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .key.white {
        width: 25px;
        height: 120px;
    }
    
    .key.black {
        width: 15px;
        height: 80px;
        margin-left: -7.5px;
    }
    
    .chord-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .key-label {
        font-size: 8px;
        bottom: 5px;
    }
}
