/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  height: 52px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  position: relative;
  overflow: hidden;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.5);
  background: #22f3ff;
}

.btn-secondary {
  background: var(--surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-idle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.status-warn {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

/* Inputs / Selects */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

select {
  height: 48px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0 16px;
  font-family: inherit;
  font-size: 0.95rem;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

select:focus, select:hover {
  border-color: var(--border-active);
  outline: none;
}

/* Nav Tabs */
.step-nav {
  display: flex;
  background: rgba(0,0,0,0.2);
  padding: 6px;
  border-radius: var(--radius-pill);
  gap: 4px;
  margin-bottom: 32px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.step-tab {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
}

.step-tab.active {
  background: var(--surface-raised);
  color: var(--accent-cyan);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Data Cards */
.data-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.data-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-card .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.data-card.highlight-cyan .value { color: var(--accent-cyan); }
.data-card.highlight-green .value { color: var(--accent-green); }
.data-card.highlight-orange .value { color: var(--accent-orange); }

/* Global Tuner (Compact & Sticky) */
.global-tuner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
  gap: 24px;
  position: sticky;
  top: 16px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tuner-info {
  display: flex;
  flex-direction: column;
  min-width: 90px;
}

.note-large {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.note-detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tuner-meter-container {
  flex: 1;
  width: 100%;
}

.tuner-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tuner-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, 
    rgba(239, 68, 68, 0.6) 0%, 
    rgba(249, 115, 22, 0.6) 25%, 
    rgba(16, 185, 129, 0.8) 50%, 
    rgba(249, 115, 22, 0.6) 75%, 
    rgba(239, 68, 68, 0.6) 100%
  );
  position: relative;
}

.tuner-center {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 50%;
  width: 2px;
  background: #fff;
  transform: translateX(-50%);
}

.tuner-needle {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 4px;
  height: 20px;
  background: #fff;
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(255,255,255,0.8);
  transition: left 0.1s ease-out;
}

@media (max-width: 600px) {
  .global-tuner {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }
  .tuner-info {
    align-items: center;
  }
}

/* Canvas */
.canvas-container {
  width: 100%;
  height: 200px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-top: 16px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.show .modal-content {
  transform: translateY(0) scale(1);
}

.modal-content h2 {
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.modal-content p, .modal-content li {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.modal-content ul {
  padding-left: 20px;
  margin-bottom: 24px;
}

/* Pills for notes/scores */
.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.note-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.note-pill:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}

.note-pill small {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.note-pill.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.note-pill.success {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.note-pill.fail {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.ear-answer-btn {
  width: 100%;
  height: auto;
  padding: 12px;
  flex-direction: row;
  justify-content: space-between;
  text-align: left;
}
