/* String Display & Tone Visualization */
.strings-display {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
  border-radius: 10px;
  padding: 0.5rem;
}

.string-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.625rem;
  background: linear-gradient(180deg, var(--bg-tertiary) 0%, #232328 100%);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  border: 1px solid transparent;
}

.string-row:hover {
  background: linear-gradient(180deg, #2f2f35 0%, #292930 100%);
  border-color: var(--border-hover);
}

.string-row.selected {
  border-color: var(--string-selected);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
  box-shadow: inset 0 0 12px rgba(59, 130, 246, 0.1);
}

.string-row.selected:hover {
  transform: scale(1.01);
}

/* Glassy style for selected non-chord-tone strings */
.string-row.selected-glassy {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.25);
  box-shadow: 0 2px 12px 0 rgba(255,255,255,0.12), 0 1.5px 8px 0 rgba(255,255,255,0.15) inset;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Chord tone highlighting styles */
.string-row.tone-root { border-color: var(--tone-root); background: linear-gradient(180deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%); box-shadow: inset 0 0 16px var(--tone-root-glow), 0 0 8px var(--tone-root-glow); }
.string-row.tone-root .string-current { color: var(--tone-root); text-shadow: 0 0 10px var(--tone-root-glow); }
.string-row.tone-third { border-color: var(--tone-third); background: linear-gradient(180deg, rgba(167, 139, 250, 0.2) 0%, rgba(167, 139, 250, 0.1) 100%); box-shadow: inset 0 0 16px var(--tone-third-glow), 0 0 8px var(--tone-third-glow); }
.string-row.tone-third .string-current { color: var(--tone-third); text-shadow: 0 0 10px var(--tone-third-glow); }
.string-row.tone-fifth { border-color: var(--tone-fifth); background: linear-gradient(180deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%); box-shadow: inset 0 0 16px var(--tone-fifth-glow), 0 0 8px var(--tone-fifth-glow); }
.string-row.tone-fifth .string-current { color: var(--tone-fifth); text-shadow: 0 0 10px var(--tone-fifth-glow); }
.string-row.tone-seventh { border-color: var(--tone-seventh); background: linear-gradient(180deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%); box-shadow: inset 0 0 16px var(--tone-seventh-glow), 0 0 8px var(--tone-seventh-glow); }
.string-row.tone-seventh .string-current { color: var(--tone-seventh); text-shadow: 0 0 10px var(--tone-seventh-glow); }
.string-row.tone-ninth { border-color: var(--tone-ninth); background: linear-gradient(180deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%); box-shadow: inset 0 0 16px var(--tone-ninth-glow), 0 0 8px var(--tone-ninth-glow); }
.string-row.tone-ninth .string-current { color: var(--tone-ninth); text-shadow: 0 0 10px var(--tone-ninth-glow); }
.string-row.tone-sixth { border-color: var(--tone-sixth); background: linear-gradient(180deg, rgba(249, 115, 22, 0.2) 0%, rgba(249, 115, 22, 0.1) 100%); box-shadow: inset 0 0 16px var(--tone-sixth-glow), 0 0 8px var(--tone-sixth-glow); }
.string-row.tone-sixth .string-current { color: var(--tone-sixth); text-shadow: 0 0 10px var(--tone-sixth-glow); }
.string-row.tone-eleventh { border-color: var(--tone-eleventh); background: linear-gradient(180deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%); box-shadow: inset 0 0 16px var(--tone-eleventh-glow), 0 0 8px var(--tone-eleventh-glow); }
.string-row.tone-eleventh .string-current { color: var(--tone-eleventh); text-shadow: 0 0 10px var(--tone-eleventh-glow); }
.string-row.tone-extension { border-color: var(--tone-extension); background: linear-gradient(180deg, rgba(236, 72, 153, 0.2) 0%, rgba(236, 72, 153, 0.1) 100%); box-shadow: inset 0 0 16px var(--tone-extension-glow), 0 0 8px var(--tone-extension-glow); }
.string-row.tone-extension .string-current { color: var(--tone-extension); text-shadow: 0 0 10px var(--tone-extension-glow); }

/* Tone labels */
.tone-label { font-size: 0.5625rem; padding: 0.125rem 0.375rem; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; min-width: 28px; text-align: center; }
.tone-label.root { background: rgba(59, 130, 246, 0.25); color: var(--tone-root); }
.tone-label.third { background: rgba(167, 139, 250, 0.25); color: var(--tone-third); }
.tone-label.fifth { background: rgba(6, 182, 212, 0.25); color: var(--tone-fifth); }
.tone-label.seventh { background: rgba(245, 158, 11, 0.25); color: var(--tone-seventh); }
.tone-label.ninth { background: rgba(34, 197, 94, 0.25); color: var(--tone-ninth); }
.tone-label.sixth { background: rgba(249, 115, 22, 0.25); color: var(--tone-sixth); }
.tone-label.eleventh { background: rgba(139, 92, 246, 0.25); color: var(--tone-eleventh); }
.tone-label.extension { background: rgba(236, 72, 153, 0.25); color: var(--tone-extension); }

/* Tone legend toggle */
.tone-legend-toggle { display: none; justify-content: center; margin-top: 0.5rem; margin-bottom: 0.25rem; }
.tone-legend-toggle.show { display: flex; }
.toggle-label { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; cursor: pointer; user-select: none; padding: 0.75rem 1rem; background: rgba(0,0,0,0.25); border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); }
.toggle-text { font-size: 0.6875rem; color: var(--text-muted); font-weight: 500; text-align: center; }
.toggle-switch-wrapper { position: relative; }
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider { position: relative; display: block; width: 36px; height: 20px; background: rgba(255,255,255,0.15); border-radius: 20px; transition: all 0.3s ease; border: 1px solid rgba(255,255,255,0.2); }
.toggle-slider::before { content: ''; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: rgba(255,255,255,0.6); border-radius: 50%; transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.toggle-input:checked + .toggle-slider { background: rgba(139, 92, 246, 0.35); border-color: rgba(139, 92, 246, 0.5); }
.toggle-input:checked + .toggle-slider::before { transform: translateX(16px); background: rgba(139, 92, 246, 0.9); }
.toggle-label:hover { background: rgba(0,0,0,0.3); }
.toggle-label:hover .toggle-slider { background: rgba(255,255,255,0.2); }
.toggle-input:checked + .toggle-slider:hover { background: rgba(139, 92, 246, 0.45); }

/* Tone legend */
.tone-legend { display: none; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.375rem; padding: 0.5rem; background: rgba(0, 0, 0, 0.2); border-radius: 8px; }
.tone-legend.show { display: flex; }
.tone-legend-item.hidden { display: none; }
.tone-legend-item { display: flex; align-items: center; gap: 0.25rem; font-size: 0.6875rem; color: var(--text-muted); }
.tone-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.tone-legend-dot.root { background: var(--tone-root); box-shadow: 0 0 6px var(--tone-root-glow); }
.tone-legend-dot.third { background: var(--tone-third); box-shadow: 0 0 6px var(--tone-third-glow); }
.tone-legend-dot.fifth { background: var(--tone-fifth); box-shadow: 0 0 6px var(--tone-fifth-glow); }
.tone-legend-dot.seventh { background: var(--tone-seventh); box-shadow: 0 0 6px var(--tone-seventh-glow); }
.tone-legend-dot.ninth { background: var(--tone-ninth); box-shadow: 0 0 6px var(--tone-ninth-glow); }
.tone-legend-dot.sixth { background: var(--tone-sixth); box-shadow: 0 0 6px var(--tone-sixth-glow); }
.tone-legend-dot.eleventh { background: var(--tone-eleventh); box-shadow: 0 0 6px var(--tone-eleventh-glow); }
.tone-legend-dot.extension { background: var(--tone-extension); box-shadow: 0 0 6px var(--tone-extension-glow); }

.string-num {
  font-size: 0.6875rem;
  color: #9898a3;
  width: 18px;
  text-align: center;
  font-weight: 500;
}

.string-open {
  font-size: 0.75rem;
  color: #9898a3;
  width: 26px;
  text-align: center;
  font-weight: 500;
}

.string-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(180, 180, 190, 0.35) 10%,
    rgba(180, 180, 190, 0.7) 50%,
    rgba(180, 180, 190, 0.35) 90%,
    transparent 100%);
  border-radius: 1px;
  position: relative;
  box-shadow: 0 0 4px rgba(180, 180, 190, 0.25);
}

.string-row:nth-child(-n+3) .string-line {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(210, 210, 220, 0.5) 10%,
    rgba(210, 210, 220, 0.85) 50%,
    rgba(210, 210, 220, 0.5) 90%,
    transparent 100%);
}

.string-row:nth-child(n+7) .string-line {
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(160, 160, 170, 0.45) 10%,
    rgba(160, 160, 170, 0.8) 50%,
    rgba(160, 160, 170, 0.45) 90%,
    transparent 100%);
}

.string-row:nth-child(n+9) .string-line {
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(150, 140, 110, 0.45) 10%,
    rgba(150, 140, 110, 0.8) 50%,
    rgba(150, 140, 110, 0.45) 90%,
    transparent 100%);
}

.string-row.selected .string-line {
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.string-current {
  font-size: 1rem;
  font-weight: 600;
  width: 36px;
  text-align: center;
  transition: all 0.15s;
  color: var(--text-primary);
}

.string-current.changed {
  color: var(--string-changed);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* Note scroll animation container */
.note-scroll-container {
  width: 36px;
  height: 1.25rem;
  overflow: hidden;
  position: relative;
}

.note-strip {
  display: flex;
  position: absolute;
  top: 0;
  height: 100%;
  align-items: center;
}

.note-strip-item {
  width: 36px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--text-primary);
}

.note-strip-item.changing {
  color: var(--string-changed);
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

/* Animation for raising pitch (scroll left, notes come from right) */
.note-strip.animate-raise {
  animation: noteScrollLeft var(--scroll-duration, 1.5s) ease-out forwards;
}

/* Animation for lowering pitch (scroll right, notes come from left) */
.note-strip.animate-lower {
  animation: noteScrollRight var(--scroll-duration, 1.5s) ease-out forwards;
}

@keyframes noteScrollLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(var(--scroll-distance));
  }
}

@keyframes noteScrollRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(var(--scroll-distance));
  }
}

.string-indicator {
  font-size: 0.5625rem;
  color: var(--text-muted);
  width: 40px;
  text-align: right;
}

/* Chord Display */
.chord-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  min-height: 56px;
  margin-bottom: 1rem;
}

.chord-display-top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.chord-label {
  font-size: 0.8125rem;
  color: #9898a3;
}

.chord-name {
  font-size: 1.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent) 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-height: 2rem;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.3));
  transition: transform 0.15s, opacity 0.15s;
}

.chord-name.updating {
  transform: scale(1.05);
}

.chord-alt {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--pro-purple);
}

.chord-notes {
  font-size: 0.875rem;
  color: #9898a3;
  font-family: 'SF Mono', 'Fira Code', monospace;
  letter-spacing: 0.05em;
}

/* Chord Palette */
.chord-palette {
  margin-bottom: 0.75rem;
}

.chord-palette-label {
  font-size: 0.6875rem;
  color: #9898a3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.625rem;
  text-align: center;
  font-weight: 500;
}

.chord-palette-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  padding: 0.75rem;
}

.chord-btn {
  padding: 0.4rem 0.7rem;
  background: linear-gradient(180deg, var(--bg-tertiary) 0%, #1f1f23 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #b4b4bc;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.chord-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.chord-btn.active {
  background: linear-gradient(180deg, var(--accent) 0%, #2563eb 100%);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chord-btn.highlight-primary {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5), inset 0 0 8px rgba(59, 130, 246, 0.1);
}

.chord-btn.highlight-alt {
  border-color: var(--pro-purple);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.5), inset 0 0 8px rgba(167, 139, 250, 0.1);
}

/* Lock Chord Toggle */
.lock-chord-container {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0.75rem 0.5rem;
}

.lock-chord-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0,0,0,0.25);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.lock-chord-btn:hover {
  background: rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.lock-chord-btn.locked {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.1));
  border-color: rgba(236, 72, 153, 0.4);
  color: var(--tone-extension);
}

.lock-chord-btn.locked:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.15));
  border-color: rgba(236, 72, 153, 0.5);
}

.lock-icon {
  width: 18px;
  height: 18px;
  transition: all 0.25s ease;
}

.lock-open {
  display: block;
}

.lock-closed {
  display: none;
}

.lock-chord-btn.locked .lock-open {
  display: none;
}

.lock-chord-btn.locked .lock-closed {
  display: block;
  animation: lockClick 0.3s ease;
}

@keyframes lockClick {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.lock-label {
  user-select: none;
}
