/* ==========================================================================
   Voicing Recorder v2 - Modern Glassmorphic Stylesheet
   ========================================================================== */

:root {
    --bg-main: #090d16;
    --bg-card: rgba(19, 27, 46, 0.85);
    --bg-card-solid: #131b2e;
    --bg-surface: rgba(30, 41, 59, 0.7);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.35);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.35);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.35);
    --danger: #ef4444;
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.35);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 2rem;
}

/* Background atmospheric gradient */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 25%, rgba(139, 92, 246, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Header Navigation Bar
   ========================================================================== */
.v2-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(9, 13, 22, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.65rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
}

.v2-header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.v2-header-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.v2-header-title span.v2-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.song-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: var(--transition);
}

.song-badge:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Controls Bar */
.v2-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-v2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-v2:active {
    transform: scale(0.96);
}

.btn-back {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.25);
    color: var(--primary);
}
.btn-back:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #fff;
}

.btn-capture {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 16px var(--success-glow);
}
.btn-capture:hover {
    filter: brightness(1.1);
}
.btn-capture.ready-pulse {
    animation: capturePulse 1.2s infinite;
}

@keyframes capturePulse {
    0%, 100% { box-shadow: 0 0 15px var(--success-glow); transform: scale(1); }
    50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.7); transform: scale(1.03); }
}

.btn-play {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.3);
}
.btn-play:hover {
    filter: brightness(1.1);
}
.btn-play.playing {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.btn-undo {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}
.btn-undo:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-clear {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.btn-clear:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

.btn-export {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 0 16px var(--purple-glow);
}
.btn-export:hover {
    filter: brightness(1.1);
}

.btn-import {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-subtle);
    color: #cbd5e1;
}
.btn-import:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.btn-toggle {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-subtle);
    color: #94a3b8;
}
.btn-toggle.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: var(--primary);
    color: var(--primary);
}

.input-number-v2 {
    width: 62px;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.v2-main-container {
    max-width: 1440px;
    width: 96%;
    margin: 1rem auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Song Progression Stepper Ribbon
   ========================================================================== */
.progression-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.progression-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progression-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progression-stats {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.progression-nav-buttons {
    display: flex;
    gap: 6px;
}

.progression-ribbon {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-behavior: smooth;
}

.step-card {
    flex-shrink: 0;
    min-width: 92px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: center;
    user-select: none;
    position: relative;
}

.step-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.step-card.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-2px);
}

.step-card.recorded {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
}

.step-card.playing {
    background: #10b981 !important;
    color: #fff !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
    transform: scale(1.08);
    z-index: 5;
}

.step-card-num {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.step-card.active .step-card-num {
    color: var(--primary);
}

.step-card.recorded .step-card-num {
    color: var(--success);
}

.step-card-chord {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}

.step-card-status {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step-card.recorded .step-card-status {
    color: #34d399;
}

/* ==========================================================================
/* ==========================================================================
   Unified Grand-Staff Section (Current Chord, Live MIDI, Next Chord)
   ========================================================================== */
.v2-unified-staff-section,
.v2-grand-staff-comparison {
    width: 100%;
    display: block;
}

.unified-staff-card {
    width: 100%;
}

.staff-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    transition: var(--transition);
}

.staff-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.staff-container-wrap {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 0.6rem 0.8rem 0.4rem 0.8rem;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 15px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 235px;
}

.staff-legend {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    padding-bottom: 4px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.staff-legend.triple-legend {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    align-items: center;
    width: 100%;
}

.staff-legend.triple-legend .legend-col.target {
    text-align: left;
}

.staff-legend.triple-legend .legend-col.live {
    text-align: center;
}

.staff-legend.triple-legend .legend-col.next {
    text-align: right;
}

.grand-staff-mount {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    user-select: none;
}

.grand-staff-mount svg {
    max-width: 100%;
    height: auto;
    overflow: visible;
}

.next-preview-pill {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--warning);
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.step-pill {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.target-notes-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.note-pill-tag {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.live-notes-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
}

.live-chip {
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.live-chip.match {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
    color: #34d399;
}

.live-chip.mismatch {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: #fca5a5;
}

.card-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.card-bottom-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}

/* Info Grids within Cards */
.unified-step-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
}

@media (max-width: 900px) {
    .unified-step-info-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
    .info-column.target-side,
    .info-column.live-side {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 0.75rem;
    }
}

.current-step-info-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 0.85rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.95rem;
}

@media (max-width: 600px) {
    .current-step-info-grid {
        grid-template-columns: 1fr;
    }
}

.next-step-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.95rem;
    min-height: 110px;
    justify-content: center;
}

.info-column {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: center;
}

.info-column.target-side {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding-right: 0.85rem;
}

.unified-step-info-grid .info-column.live-side {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding-right: 0.85rem;
}

.column-subtitle {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.card-bottom-hint {
    background: rgba(56, 189, 248, 0.08);
    border: 1px dashed rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.step-pill.next {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.12);
}

.v2-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.v2-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.card-top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chord-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chord-badge.current {
    background: rgba(16, 185, 129, 0.18);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.chord-badge.next {
    background: rgba(245, 158, 11, 0.18);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.chord-badge.live {
    background: rgba(56, 189, 248, 0.18);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.chord-display-title {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin: 0;
}

.chord-display-title.current {
    color: var(--success);
}
.chord-display-title.next {
    color: var(--warning);
}
.chord-display-title.live {
    color: #fff;
}

.lyric-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
    font-style: italic;
    color: #fef08a;
    min-height: 2.2rem;
    display: flex;
    align-items: center;
}

/* Reference mini-piano container in card */
.visualizer-piano-wrap {
    display: flex;
    justify-content: center;
    position: relative;
    margin: 0.25rem 0;
}

.required-notes-info {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.required-notes-info .note-tag {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #fff;
}

/* Live MIDI Card & Harmonic Arbitration Engine */
.live-monitor-card {
    border-color: rgba(56, 189, 248, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.live-chord-hero {
    text-align: center;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.live-chord-name-huge {
    font-size: 2.2rem;
    font-weight: 900;
    color: #fff;
    min-height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.live-notes-list {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-height: 1.3rem;
}

/* Harmonic Match Feedback Box */
.validation-feedback-box {
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.validation-feedback-box.status-waiting {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-subtle);
}

.validation-feedback-box.status-match {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    box-shadow: 0 0 20px var(--success-glow);
}

.validation-feedback-box.status-mismatch {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
}

.validation-feedback-box.status-incomplete {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
}

.validation-title {
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.validation-feedback-box.status-waiting .validation-title { color: var(--text-muted); }
.validation-feedback-box.status-match .validation-title { color: var(--success); }
.validation-feedback-box.status-mismatch .validation-title { color: var(--danger); }
.validation-feedback-box.status-incomplete .validation-title { color: var(--warning); }

.validation-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   Full Interactive 88-Key Piano
   ========================================================================== */
.full-piano-section {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.piano-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.piano-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.v2-keyboard-container {
    position: relative;
    width: 100%;
    height: 160px;
    background: #111827;
    border: 2px solid #1f2937;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
    display: flex;
    user-select: none;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);
}

.v2-key {
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.5);
    border-top: none;
    transition: background-color 0.05s ease, box-shadow 0.05s ease;
}

.v2-key.white {
    flex: 1;
    background: linear-gradient(to bottom, #ffffff 0%, #e2e8f0 100%);
    z-index: 1;
    border-radius: 0 0 4px 4px;
    height: 100%;
}

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

.v2-key.black {
    position: absolute;
    width: 1.15%;
    height: 60%;
    background: linear-gradient(to bottom, #1f2937 0%, #000000 100%);
    z-index: 2;
    border-radius: 0 0 3px 3px;
    transform: translateX(-50%);
    box-shadow: 2px 3px 6px rgba(0,0,0,0.6);
}

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

/* Real-time MIDI Active states */
.v2-key.white.active {
    background: linear-gradient(to bottom, #38bdf8 0%, #0284c7 100%) !important;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.4), 0 0 15px var(--primary-glow) !important;
}

.v2-key.black.active {
    background: linear-gradient(to bottom, #0284c7 0%, #0369a1 100%) !important;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 0 15px var(--primary-glow) !important;
}

/* Playback highlight states */
.v2-key.white.playback-active {
    background: linear-gradient(to bottom, #34d399 0%, #059669 100%) !important;
    box-shadow: 0 0 15px var(--success-glow) !important;
}

.v2-key.black.playback-active {
    background: linear-gradient(to bottom, #059669 0%, #047857 100%) !important;
    box-shadow: 0 0 15px var(--success-glow) !important;
}

.v2-key-label {
    position: absolute;
    bottom: 6px;
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    pointer-events: none;
}

/* ==========================================================================
   Voicings List Table / Sequencer Overview
   ========================================================================== */
.voicings-table-section {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.voicings-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voicings-list-scroll {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 4px;
}

.recorded-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: var(--transition);
}

.recorded-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.recorded-row.playing {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
    box-shadow: 0 0 12px var(--success-glow);
}

.row-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.row-step-num {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-chord-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    min-width: 65px;
}

.row-notes-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.note-chip {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
}

.row-lyric {
    font-size: 0.82rem;
    font-style: italic;
    color: var(--text-muted);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-mini {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-mini:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-mini.danger:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-color: var(--danger);
}

/* ==========================================================================
   Song Selector Modal
   ========================================================================== */
.v2-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.v2-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.v2-modal {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: translateY(20px);
    transition: var(--transition);
}

.v2-modal-overlay.active .v2-modal {
    transform: translateY(0);
}

.v2-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.v2-modal-header h3 {
    font-size: 1.25rem;
    color: #fff;
    font-weight: 800;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}
.btn-close-modal:hover { color: #fff; }

.modal-search-input {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 0.95rem;
    outline: none;
}
.modal-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.modal-songs-list {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.modal-song-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.modal-song-item:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--primary);
    transform: translateX(4px);
}

.modal-song-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.modal-song-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.modal-song-chords-badge {
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    color: var(--primary);
}
