@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body { font-family: 'Inter', sans-serif; overflow-x: hidden; }

/* Navegación unificada (Inicio · Tutorial · App) */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
}
.site-nav-inner {
    width: 100%;
    max-width: 96rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.site-nav-brand {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
    text-decoration: none;
}
.site-nav-brand:hover { color: #4f46e5; }
.site-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}
.site-nav-links a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}
.site-nav-links a:hover { color: #4f46e5; }
.site-nav-links [aria-current="page"] {
    color: #4f46e5;
}
.site-nav-cta {
    color: #fff !important;
    background: #4f46e5;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
}
.site-nav-cta:hover {
    background: #4338ca;
    color: #fff !important;
}
.site-nav-current {
    color: #4f46e5;
    background: #eef2ff;
    border: 1px solid #e0e7ff;
    padding: 0.375rem 0.65rem;
    border-radius: 0.5rem;
}

/* Animaciones Piano */
.piano-key { transition: background-color 0.1s; position: relative; border-radius: 0 0 4px 4px; border: 1px solid #e2e8f0; flex-shrink: 0; }
.piano-key.white-key { width: 28px; min-width: 28px; }
.piano-key.active-v1 { background-color: #3b82f6 !important; transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }
.piano-key.active-v2 { background-color: #a855f7 !important; transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }
.piano-key.active-v3 { background-color: #ec4899 !important; transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }

.black-key {
    background-color: #1e293b; height: 60%; width: 16px; position: absolute; z-index: 20;
    border-radius: 0 0 3px 3px;
}

/* Estilos Editor */
.editor-step-row {
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    scroll-margin: 80px;
    background: #fff;
    align-items: center;
}
.editor-step-row.playing { background-color: #f8fafc; }
.editor-step-row.drag-over { border-color: #3b82f6; background: #eff6ff; }

.voice-cell { background: #fff; transition: background-color 0.15s, box-shadow 0.15s; }
.voice-fields-row { flex-wrap: nowrap; }
.voice-fields-row .field-lyric { width: 3.25rem; min-width: 2.75rem; flex-shrink: 0; }
.voice-fields-row .field-note { flex: 1 1 4.5rem; max-width: 6.5rem; }
.voice-fields-row .field-dur { width: 2.75rem; }
.voice-fields-row .field-chord { width: 2.25rem; }

.editor-header-spacer { width: 2.5rem; }
.editor-row-controls { width: 2.5rem; }
.editor-column-header { position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 #e2e8f0; }

.col-header {
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
}
.col-header-title { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.col-header-hint { display: block; font-size: 8px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.col-header-v1 { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.col-header-v2 { color: #7e22ce; background: #faf5ff; border-color: #e9d5ff; }
.col-header-v3 { color: #db2777; background: #fdf2f8; border-color: #fbcfe8; }

.voice-cell-v1 { border-color: #bfdbfe; }
.voice-cell-v2 { border-color: #e9d5ff; }
.voice-cell-v3 { border-color: #fbcfe8; }
.voice-cell-v1.playing { background: #eff6ff; color: #3b82f6; box-shadow: inset 0 0 0 2px #3b82f6; }
.voice-cell-v2.playing { background: #faf5ff; color: #a855f7; box-shadow: inset 0 0 0 2px #a855f7; }
.voice-cell-v3.playing { background: #fdf2f8; color: #ec4899; box-shadow: inset 0 0 0 2px #ec4899; }
.voice-cell-v1.playing-lyrics { background: #f8fafc; color: #64748b; box-shadow: inset 0 0 0 1px #93c5fd; }
.voice-cell-v2.playing-lyrics { background: #faf5ff; color: #64748b; box-shadow: inset 0 0 0 1px #d8b4fe; }
.voice-cell-v3.playing-lyrics { background: #fdf2f8; color: #64748b; box-shadow: inset 0 0 0 1px #f9a8d4; font-style: italic; }
.editor-step-row.measure-start {
    border-top: 2px solid #94a3b8;
}
.editor-step-row.measure-overflow {
    background-color: #fef2f2;
    box-shadow: inset 0 0 0 1px #fca5a5;
}
.editor-step-row.measure-start .row-index {
    color: #64748b;
}

.drag-handle { cursor: grab; color: #94a3b8; }
.drag-handle:active { cursor: grabbing; }

.voices-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}
@media (max-width: 768px) {
    .voices-grid { grid-template-columns: 1fr; }
}

/* Partitura — negro en reposo; color de voz solo al sonar */
.score-note {
    transition: fill 0.12s ease, stroke 0.12s ease, filter 0.12s ease, transform 0.12s ease;
    transform-box: fill-box;
    transform-origin: center;
}
.score-note .note-head { fill: #1e293b; stroke: #1e293b; }
.score-note .note-head.hollow { fill: #fff; stroke: #1e293b; }
.score-note .note-stem,
.score-note .note-flag { stroke: #1e293b; }
.score-note .note-dot,
.score-note .note-acc { fill: #1e293b; }

.score-note.active-v1 { filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.95)); transform: scale(1.14); }
.score-note.active-v1 .note-head { fill: #3b82f6 !important; stroke: #2563eb !important; }
.score-note.active-v1 .note-head.hollow { fill: #fff !important; stroke: #3b82f6 !important; }
.score-note.active-v1 .note-stem,
.score-note.active-v1 .note-flag { stroke: #3b82f6 !important; }
.score-note.active-v1 .note-dot,
.score-note.active-v1 .note-acc { fill: #3b82f6 !important; }

.score-note.active-v2 { filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.95)); transform: scale(1.14); }
.score-note.active-v2 .note-head { fill: #a855f7 !important; stroke: #9333ea !important; }
.score-note.active-v2 .note-head.hollow { fill: #fff !important; stroke: #a855f7 !important; }
.score-note.active-v2 .note-stem,
.score-note.active-v2 .note-flag { stroke: #a855f7 !important; }
.score-note.active-v2 .note-dot,
.score-note.active-v2 .note-acc { fill: #a855f7 !important; }

.score-note.active-v3 { filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.95)); transform: scale(1.14); }
.score-note.active-v3 .note-head { fill: #ec4899 !important; stroke: #db2777 !important; }
.score-note.active-v3 .note-head.hollow { fill: #fff !important; stroke: #ec4899 !important; }
.score-note.active-v3 .note-stem,
.score-note.active-v3 .note-flag { stroke: #ec4899 !important; }
.score-note.active-v3 .note-dot,
.score-note.active-v3 .note-acc { fill: #ec4899 !important; }

.staff-line { stroke: #94a3b8; stroke-width: 1; }
.ledger-line { stroke: #94a3b8; stroke-width: 1; }

.staff-voice-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.staff-voice-label-v1 { fill: #2563eb; }
.staff-voice-label-v2 { fill: #9333ea; }
.staff-voice-label-v3 { fill: #db2777; }
.score-beat-line { stroke: #e2e8f0; stroke-width: 1; stroke-dasharray: 2 4; }
.score-measure-line { stroke: #64748b; stroke-width: 1.5; }
.score-measure-number { font-size: 10px; font-weight: 700; fill: #64748b; font-family: 'Inter', sans-serif; }
.score-clef { fill: #1e293b; font-family: 'Times New Roman', 'Noto Music', serif; }
.score-key-sig { font-weight: 700; fill: #1e293b; font-family: 'Times New Roman', 'Noto Music', serif; }
.score-time-sig-num {
    font-size: 18px;
    font-weight: 700;
    fill: #1e293b;
    font-family: 'Times New Roman', Georgia, serif;
}
.score-chord-label { font-size: 9px; font-weight: 700; fill: #6366f1; }
.score-col-active { fill: rgba(59, 130, 246, 0.08); }
.score-note.voice-muted { opacity: 0.12 !important; filter: grayscale(1); }
.voice-cell.voice-muted { opacity: 0.35; filter: grayscale(0.6); }

/* Panel izquierdo: partitura flexible + piano fijo + controles abajo */
#player-col {
    min-height: 0;
}
.player-stage {
    min-height: 0;
    flex: 1 1 auto;
}
#score-container {
    scroll-behavior: auto;
}
.score-container-pad {
    padding: 0.35rem 0.5rem 0.25rem;
}
#piano-scroll-wrapper {
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    overflow-y: hidden;
    flex-shrink: 0;
    min-height: 6.25rem;
}
#transport-mixer-panel {
    flex-shrink: 0;
}

/* Reproductor + mezclador */
.transport-mixer-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    gap: 0.4rem;
    align-items: center;
}
@media (max-width: 640px) {
    .transport-mixer-grid { grid-template-columns: 1fr; }
}
.player-transport {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.3rem 0.4rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
}
.transport-readout {
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    line-height: 1.35;
    margin: 0;
}
.transport-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.transport-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s;
    flex-shrink: 0;
}
.transport-btn:hover:not(:disabled) { background: #f1f5f9; color: #1e293b; }
.transport-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.transport-btn-main {
    width: 2.5rem;
    height: 2.5rem;
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.transport-btn-main:hover:not(:disabled) { background: #1d4ed8; color: #fff; }
.transport-btn-main.is-loading { background: #94a3b8; border-color: #94a3b8; box-shadow: none; }
.transport-btn-main.is-playing { background: #1d4ed8; }
.transport-btn-stop {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.45rem;
    margin-left: 0.15rem;
}
.transport-btn .icon-pause { display: none; }
.transport-btn-main.is-playing .icon-play { display: none; }
.transport-btn-main.is-playing .icon-pause { display: block; }
.transport-master {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.15rem;
}
.transport-master-label {
    font-size: 8px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}
.transport-master-slider {
    flex: 1;
    height: 4px;
    accent-color: #2563eb;
    cursor: pointer;
}

.mixer-console {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 0.25rem 0.35rem 0.3rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.mixer-console-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    padding: 0 0.15rem;
}
.mixer-console-title {
    font-size: 8px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.mixer-reset-btn {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.35rem;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
    transition: background 0.12s;
}
.mixer-reset-btn:hover { background: #e2e8f0; color: #334155; }
.mixer-strips-row {
    display: flex;
    gap: 0.3rem;
    align-items: flex-end;
    justify-content: stretch;
}

/* Mezclador — faders verticales */
.mixer-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.2rem 0.35rem;
    border-radius: 0.45rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: opacity 0.15s, box-shadow 0.15s;
    flex: 1;
    min-width: 0;
}
.mixer-fader {
    height: 66px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.mixer-vol-vert {
    width: 66px;
    height: 22px;
    transform: rotate(-90deg);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.mixer-v1 .mixer-vol-vert { accent-color: #2563eb; }
.mixer-v2 .mixer-vol-vert { accent-color: #9333ea; }
.mixer-v3 .mixer-vol-vert { accent-color: #db2777; }
.mixer-chords .mixer-vol-vert { accent-color: #6366f1; }
.mixer-click .mixer-vol-vert { accent-color: #0ea5e9; }
.mixer-label-chords { color: #4f46e5; }
.mixer-label-click { color: #0284c7; }
.mixer-click-toggle { width: auto; min-width: 1.65rem; padding: 0 0.2rem; font-size: 7px; }
.mixer-click-toggle.active { background: #0ea5e9; border-color: #0284c7; color: #fff; }
.mixer-strip.is-silent { opacity: 0.45; }
.mixer-v1 { border-color: #bfdbfe; }
.mixer-v2 { border-color: #e9d5ff; }
.mixer-v3 { border-color: #fbcfe8; }
.mixer-v1.is-solo { box-shadow: inset 0 0 0 2px #3b82f6; background: #eff6ff; }
.mixer-v2.is-solo { box-shadow: inset 0 0 0 2px #a855f7; background: #faf5ff; }
.mixer-v3.is-solo { box-shadow: inset 0 0 0 2px #ec4899; background: #fdf2f8; }
.mixer-label { font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.mixer-v1 .mixer-label { color: #1d4ed8; }
.mixer-v2 .mixer-label { color: #7e22ce; }
.mixer-v3 .mixer-label { color: #db2777; }
.mixer-buttons { display: flex; gap: 0.2rem; }
.mixer-btn {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.3rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 8px;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    transition: all 0.12s;
    line-height: 1;
}
.mixer-btn:hover { background: #e2e8f0; }
.mixer-btn.mixer-mute.active { background: #f97316; border-color: #ea580c; color: #fff; }
.mixer-btn.mixer-solo.active { background: #facc15; border-color: #eab308; color: #713f12; }

.tab-btn.active { border-bottom: 3px solid #3b82f6; color: #1e40af; font-weight: 800; }

#editor-col { overflow: hidden; }
#editor-column-header { flex-shrink: 0; }

.custom-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.custom-scroll { scroll-behavior: smooth; }

#toast-notification { opacity: 0; transition: opacity 0.3s ease; pointer-events: none; z-index: 100; }
#toast-notification.visible { opacity: 1; }
