/* ============================================
   MAJOR SCALES - PAGE SPECIFIC STYLES
   ============================================ */

/* Root Selector */
.root-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.root-btn {
    padding: 8px 14px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.root-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.root-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Scale Info Panel */
.scale-info-panel {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(8, 145, 178, 0.05));
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.scale-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.scale-signature {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Keyboard Section */
.keyboard-section {
    padding: 24px 20px;
}

.keyboard-wrapper {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 10px 0;
}

.keyboard {
    display: flex;
    position: relative;
    height: 160px;
    background: var(--bg);
    border-radius: 0 0 8px 8px;
    padding: 0 4px 4px;
}

/* Piano Keys */
.white-key {
    width: 48px;
    height: 150px;
    background: linear-gradient(180deg, #fafafa 0%, #e8e8e8 100%);
    border: 1px solid #aaa;
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 10px;
    position: relative;
    z-index: 1;
    margin-right: -1px;
}

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

.white-key.in-scale {
    background: linear-gradient(180deg, #99f6e4 0%, #5eead4 100%);
    border-color: #14b8a6;
}

.white-key.root {
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
    border-color: #0d9488;
}

.white-key.root .key-label {
    color: white;
}

.white-key.playing {
    transform: translateY(2px);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.1);
}

.black-key {
    width: 32px;
    height: 100px;
    background: linear-gradient(180deg, #333 0%, #111 100%);
    border-radius: 0 0 4px 4px;
    position: absolute;
    z-index: 2;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
}

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

.black-key.in-scale {
    background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
}

.black-key.root {
    background: linear-gradient(180deg, #0f766e 0%, #0d6d64 100%);
}

.black-key .key-label {
    color: white;
    font-size: 10px;
}

.black-key.playing {
    transform: translateY(2px);
}

.key-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-align: center;
}

.key-label .degree {
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

body.dark-mode .white-key {
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #94a3b8;
}

body.dark-mode .white-key:hover {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

body.dark-mode .white-key .key-label {
    color: #334155;
}

/* Pattern Display */
.pattern-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.pattern-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
}

.pattern-steps {
    display: flex;
    gap: 4px;
}

.step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
}

.step:nth-child(odd) {
    background: var(--primary);
    color: white;
}

.step:nth-child(even) {
    background: var(--primary);
    color: white;
}

.step:nth-child(3),
.step:nth-child(7) {
    background: #f59e0b;
    color: white;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.play-scale-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.play-scale-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.play-scale-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.play-scale-btn.playing {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Notes Panel */
.notes-panel {
    padding: 16px 20px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.scale-notes-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.scale-note-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 50px;
}

.scale-note-item.root {
    background: var(--primary);
    border-color: var(--primary);
}

.scale-note-item.root .note-name,
.scale-note-item.root .note-degree {
    color: white;
}

.note-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.note-degree {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* Formula Section */
.formula-section {
    padding: 0 20px 24px;
}

.formula-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

.formula-card h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin: 0 0 20px;
}

.formula-visual {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.formula-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary);
    border-radius: 10px;
    min-width: 60px;
}

.formula-step.half {
    background: #f59e0b;
}

.step-interval {
    font-size: 20px;
    font-weight: 800;
    color: white;
}

.step-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}

.step-semitones {
    font-size: 9px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

.formula-note {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .keyboard {
        height: 140px;
    }

    .white-key {
        width: 40px;
        height: 130px;
    }

    .black-key {
        width: 26px;
        height: 85px;
    }

    .root-selector {
        justify-content: center;
    }

    .root-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .formula-step {
        padding: 10px 12px;
        min-width: 50px;
    }

    .step-interval {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .keyboard {
        height: 120px;
        transform: scale(0.9);
        transform-origin: center;
    }

    .audio-controls {
        flex-wrap: wrap;
    }

    .play-scale-btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .scale-notes-row {
        gap: 6px;
    }

    .scale-note-item {
        padding: 10px 12px;
        min-width: 42px;
    }

    .note-name {
        font-size: 16px;
    }

    .formula-visual {
        gap: 6px;
    }

    .formula-step {
        padding: 8px 10px;
        min-width: 40px;
    }

    .step-interval {
        font-size: 16px;
    }

    .step-label {
        font-size: 9px;
    }

    .step-semitones {
        display: none;
    }
}
