/* ========================================
   PIANO ROLL & VOICE CARDS STYLES
   Beautiful modern design for oscillator editor
   ======================================== */

/* ====== PIANO ROLL CONTAINER ====== */
.piano-roll-container {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 217, 255, 0.1);
}

.piano-roll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.piano-roll-header h3 {
  color: #00D9FF;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.piano-roll-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.piano-control-btn {
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.3);
  color: #00D9FF;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.piano-control-btn:hover {
  background: rgba(0, 217, 255, 0.2);
  border-color: #00D9FF;
  transform: translateY(-1px);
}

.piano-control-label {
  font-size: 11px;
  color: #999;
  margin: 0 4px;
}

.piano-roll-canvas {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  cursor: grab;
  background: #0a0a0a;
  border: 2px solid #333;
  display: block;
  transition: border-color 0.3s;
}

.piano-roll-canvas:hover {
  border-color: #00D9FF;
}

.piano-roll-canvas:active {
  cursor: grabbing;
}

.chord-info-bar {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(0, 217, 255, 0.1);
  border-radius: 6px;
  border-left: 4px solid #00D9FF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chord-info-label {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.chord-info-notes {
  font-size: 12px;
  color: #00D9FF;
  font-family: 'Courier New', monospace;
}

/* ====== VOICE CARDS HORIZONTAL LAYOUT ====== */
.voice-cards-horizontal {
  display: flex;
  gap: 16px;
  overflow-x: visible;
  padding: 20px;
  background: linear-gradient(to right, #1a1a2e 0%, #2a2a4e 50%, #1a1a2e 100%);
  border-radius: 12px;
  scroll-snap-type: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 217, 255, 0.3) rgba(0, 0, 0, 0.2);
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.voice-cards-horizontal::-webkit-scrollbar {
  height: 8px;
}

.voice-cards-horizontal::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.voice-cards-horizontal::-webkit-scrollbar-thumb {
  background: rgba(0, 217, 255, 0.3);
  border-radius: 4px;
}

.voice-cards-horizontal::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 217, 255, 0.5);
}

.voice-card {
  flex: 1 1 0;
  min-width: 0;
  flex-shrink: 1;
  flex-grow: 1;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
  border: 2px solid #333;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-snap-align: none;
  position: relative;
  overflow: hidden;
}

.voice-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, var(--voice-color, #FF6B35) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.voice-card:hover {
  transform: translateY(-6px);
  border-color: var(--voice-color, #FF6B35);
  box-shadow: 0 12px 40px rgba(255, 107, 53, 0.3);
}

.voice-card:hover::before {
  opacity: 0.1;
}

.voice-card.playing-pulse {
  animation: voicePulse 1.5s ease-in-out infinite;
  border-color: var(--voice-color, #FF6B35);
}

@keyframes voicePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
  }
  50% {
    box-shadow: 0 0 30px 15px rgba(255, 107, 53, 0);
  }
}

.voice-card-header {
  border-left: 4px solid #FF6B35;
  padding-left: 12px;
  margin-bottom: 12px;
}

.voice-name {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.voice-number {
  font-size: 11px;
  color: #999;
  font-weight: 500;
}

.voice-role {
  font-size: 12px;
  color: #00D9FF;
  margin-bottom: 16px;
  text-align: center;
  font-weight: 500;
  padding: 6px;
  background: rgba(0, 217, 255, 0.05);
  border-radius: 4px;
}

.voice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #555;
  transition: all 0.3s;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
}

.voice-status.playing .status-indicator {
  animation: statusBlink 1s ease-in-out infinite;
}

@keyframes statusBlink {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.1);
  }
}

.status-text {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #999;
  letter-spacing: 0.5px;
}

.voice-status.playing .status-text {
  color: #00FF88;
}

.voice-note-info {
  text-align: center;
  margin: 16px 0;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.note-name {
  font-size: 28px;
  font-weight: bold;
  color: #666;
  font-family: 'Courier New', monospace;
  margin-bottom: 4px;
  transition: color 0.3s;
}

.note-freq {
  font-size: 13px;
  color: #00D9FF;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

.stereo-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.stereo-layer {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.layer-label {
  font-size: 8px;
  color: #999;
  text-align: center;
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mini-waveform {
  width: 100%;
  height: 24px;
  border-radius: 4px;
  background: #000;
  display: block;
  margin-bottom: 6px;
}

.layer-source {
  font-size: 10px;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.btn-edit-voice {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8C61 100%);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-edit-voice:hover {
  background: linear-gradient(135deg, #FF8C61 0%, #FFA887 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.btn-edit-voice:active {
  transform: translateY(0);
}

/* ====== RESPONSIVE ADJUSTMENTS ====== */
@media (max-width: 768px) {
  .piano-roll-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .piano-roll-controls {
    width: 100%;
    justify-content: space-between;
  }

  .voice-card {
    min-width: 180px;
  }

  .chord-info-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ====== ACCESSIBILITY ====== */
.voice-card:focus-visible {
  outline: 2px solid var(--voice-color, #FF6B35);
  outline-offset: 4px;
}

.piano-control-btn:focus-visible {
  outline: 2px solid #00D9FF;
  outline-offset: 2px;
}

/* ====== HIDE OLD OSCILLATOR GRID ====== */
.osc-grid[style*="display: none"] {
  /* Completely hidden - can be removed after testing */
}
