/**
 * Ear Training Tool - Styles
 * Clean, focused design for educational use
 */

/* Mode Tabs */
.mode-tab {
  color: #6b7280;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.mode-tab:hover {
  color: #374151;
  background: #f9fafb;
}

.mode-tab.active {
  color: #059669;
  border-bottom-color: #059669;
  background: #ecfdf5;
}

/* Difficulty Buttons */
.difficulty-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background: white;
  transition: all 0.2s;
  cursor: pointer;
}

.difficulty-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.difficulty-btn.active {
  background: #059669;
  color: white;
  border-color: #059669;
}

/* Direction Buttons */
.direction-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  background: white;
  transition: all 0.2s;
  cursor: pointer;
}

.direction-btn:hover {
  background: #f9fafb;
}

.direction-btn.active {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}

/* Chord Type Buttons */
.chord-type-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  background: white;
  transition: all 0.2s;
  cursor: pointer;
}

.chord-type-btn:hover {
  background: #f9fafb;
}

.chord-type-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* Scale Type Buttons */
.scale-type-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  background: white;
  transition: all 0.2s;
  cursor: pointer;
}

.scale-type-btn:hover {
  background: #f9fafb;
}

.scale-type-btn.active {
  background: #8b5cf6;
  color: white;
  border-color: #8b5cf6;
}

/* Quiz Area */
.quiz-area {
  min-height: 300px;
}

/* Play Button */
.play-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
}

.play-btn:active {
  transform: scale(0.98);
}

/* Answer Buttons */
.answer-grid {
  max-width: 600px;
  margin: 0 auto;
}

.answer-btn {
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.answer-btn:hover {
  border-color: #059669;
  background: #f0fdf4;
}

.answer-btn.selected {
  border-color: #6366f1;
  background: #eef2ff;
}

.answer-btn.correct {
  border-color: #059669;
  background: #d1fae5;
}

.answer-btn.incorrect {
  border-color: #ef4444;
  background: #fee2e2;
}

/* Piano Visual - Simplified Layout */
.piano-visual {
  display: flex;
  justify-content: center;
  background: #1f2937;
  padding: 4px;
  border-radius: 4px;
  max-width: 500px;
  margin: 0 auto;
  height: 100px;
  position: relative;
  overflow: hidden;
}

.key-container {
  position: relative;
  display: flex;
}

.key {
  cursor: default;
  transition: background 0.15s ease;
  border-radius: 0 0 2px 2px;
}

.key.white {
  width: 32px;
  height: 100%;
  background: white;
  border-right: 1px solid #d1d5db;
}

.key.white:last-child {
  border-right: none;
}

.key.white.active,
.key.white.target {
  background: #6ee7b7;
}

.key.black {
  width: 20px;
  height: 65%;
  background: #111827;
  position: absolute;
  z-index: 10;
  top: 0;
  border-radius: 0 0 3px 3px;
}

.key.black.active,
.key.black.target {
  background: #059669;
}

/* Feedback */
.feedback {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats */
.stats {
  color: #6b7280;
}

.stats strong {
  color: #111827;
}

/* Interval Checkboxes */
.interval-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #f9fafb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.interval-checkbox:hover {
  background: #f3f4f6;
}

.interval-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #059669;
}

/* Reference Table */
table tbody tr {
  transition: background 0.2s;
}

table tbody tr:hover {
  background: #f0fdf4;
}

table th,
table td {
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 640px) {
  .piano-visual {
    transform: scale(0.7);
    transform-origin: center;
  }
  
  .play-btn {
    width: 100px;
    height: 100px;
  }
  
  .answer-btn {
    padding: 0.75rem;
  }
  
  .mode-tab {
    font-size: 0.875rem;
    padding: 0.75rem 0.5rem;
  }
}

/* Mode Content Transition */
.mode-content {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Checkbox custom styling */
input[type="checkbox"] {
  accent-color: #059669;
}

/* Note Range Buttons */
.note-range-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background: white;
  transition: all 0.2s;
  cursor: pointer;
}

.note-range-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.note-range-btn.active {
  background: #059669;
  color: white;
  border-color: #059669;
}

/* Notes Piano Visual */
.notes-piano-visual {
  margin: 1rem auto;
}

.notes-key {
  cursor: pointer;
  user-select: none;
}

.notes-key:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.notes-key.active {
  background: #fef3c7 !important;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ── Per-note accuracy grid ── */
.note-per-note-grid {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 auto;
  max-width: 400px;
}

.note-acc-cell {
  width: 48px;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
  transition: all 0.2s;
}

.note-acc-cell.locked {
  background: #f3f4f6;
  border-color: #e5e7eb;
  opacity: 0.55;
}

.note-acc-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.note-acc-pct {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
}

.note-acc-count {
  font-size: 0.6rem;
  color: #9ca3af;
  line-height: 1.3;
}
