/* ============================================
   EDITOR DE PARTITURAS — Editor Styles
   ============================================ */

.score-header {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.score-title-input {
  background: transparent;
  border: 2px dashed transparent;
  color: var(--color-text);
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 1.5rem;
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  text-align: center;
  padding: var(--space-2) var(--space-4);
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
  outline: none;
}

.score-title-input:hover,
.score-title-input:focus {
  border-color: var(--color-border);
  background: var(--color-surface-hover);
}

.score-viewport {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block; /* Trocado flex por block para scroll não travar lado esquerdo */
  padding: var(--space-4);
  touch-action: auto;
}

.score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto; /* Centraliza sem cortar no overflow */
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
  width: 100%;
  max-width: 900px;
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-out);
}

.score-container:hover {
  box-shadow: var(--shadow-xl);
}

.score-wrapper {
  position: relative;
  cursor: crosshair;
}

#score-output {
  width: 100%;
  min-height: 300px;
}

#score-output svg {
  display: block;
  width: 100% !important;
  height: auto !important;
}

/* Override VexFlow SVG colors for dark theme */
[data-theme="dark"] #score-output svg path,
[data-theme="dark"] #score-output svg line {
  fill: var(--note-color);
  stroke: var(--note-color);
}

[data-theme="dark"] #score-output svg text {
  fill: var(--note-color);
  stroke: none;
}

[data-theme="dark"] #score-output svg .vf-stave path,
[data-theme="dark"] #score-output svg .vf-stave line {
  stroke: var(--staff-color);
  fill: none;
}

/* ── Ghost Note Preview ── */
.ghost-note {
  position: absolute;
  width: 14px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0.4;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: all 80ms ease-out;
  z-index: 5;
}

.ghost-note.hidden {
  opacity: 0;
}

.ghost-note-label {
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-accent);
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-accent);
  white-space: nowrap;
  pointer-events: none;
}

.ghost-note-label:empty {
  display: none;
}

/* ── Playback Cursor ── */
.playback-cursor {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--color-accent);
  box-shadow: 0 0 12px var(--color-accent),
              0 0 24px rgba(139, 92, 246, 0.3);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.playback-cursor.active {
  opacity: 1;
}

/* ── Note Highlight durante reprodução ── */
.note-highlight {
  position: absolute;
  background: rgba(139, 92, 246, 0.15);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-md);
  pointer-events: none;
  z-index: 4;
  animation: notePulse 0.3s var(--ease-out);
}

@keyframes notePulse {
  0% {
    transform: scale(1.3);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Note aparecendo ── */
.note-appear {
  animation: noteAppear 0.35s var(--ease-spring);
}

@keyframes noteAppear {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── Measure Number ── */
.measure-number {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  fill: var(--color-text-tertiary);
}

/* ── Score Title Area ── */
.score-title-area {
  text-align: center;
  margin-bottom: var(--space-6);
}

.score-title-area h2 {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-1);
}

.score-title-area .score-meta {
  font-size: var(--fs-sm);
  color: var(--color-text-tertiary);
}

/* ── Score Info Badge ── */
.score-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-hover);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Esconde a barrinha feia de scroll no badge */
.score-info::-webkit-scrollbar {
  display: none;
}

.score-info-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.score-info-divider {
  width: 1px;
  height: 14px;
  background: var(--color-border);
}

/* ── Empty Score State ── */
.empty-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
}

.empty-score svg {
  width: 80px;
  height: 80px;
  color: var(--color-text-tertiary);
  opacity: 0.4;
  margin-bottom: var(--space-6);
}

.empty-score h3 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.empty-score p {
  font-size: var(--fs-sm);
  color: var(--color-text-tertiary);
  max-width: 400px;
}
