/* Arpeggio Trainer Styles - Sunset Boulevard */

body {
  font-family: var(--font-stack);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
}

.home-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 1.5rem;
  transition: color 0.3s ease;
}

.home-link:hover {
  color: var(--accent-secondary);
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Settings Panel */
.settings-panel {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--bg-tertiary);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--bg-tertiary);
}

.settings-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

/* Setting Groups */
.setting-group {
  padding: 1rem;
  border-bottom: 1px solid var(--bg-tertiary);
}

.setting-group h3 {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}

/* Arpeggio Grid */
.arpeggio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.arpeggio-btn {
  padding: 0.5rem 0.25rem;
  border: 2px solid var(--bg-tertiary);
  background: transparent;
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.arpeggio-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(255, 107, 53, 0.2);
}

.arpeggio-btn.active {
  background: var(--accent-gradient);
  border-color: var(--accent-primary);
  color: #0d0015;
}

/* Note Grid */
.note-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.note-btn {
  padding: 0.5rem 0.25rem;
  border: 2px solid var(--bg-tertiary);
  background: transparent;
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.note-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(255, 107, 53, 0.2);
}

.note-btn.active {
  background: var(--accent-gradient);
  border-color: var(--accent-primary);
  color: #0d0015;
}

.selection-controls {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  justify-content: center;
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.text-btn:hover {
  color: var(--text-primary);
}

/* Setting Row */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.setting-row + .setting-row {
  margin-top: 0.75rem;
}

.setting-row label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Toggle Group */
.toggle-group {
  display: flex;
  gap: 0.25rem;
}

.toggle-btn {
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--bg-tertiary);
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(255, 107, 53, 0.2);
}

.toggle-btn.active {
  background: var(--accent-gradient);
  border-color: var(--accent-primary);
  color: #0d0015;
}

/* Checkbox Toggle */
.checkbox-toggle {
  appearance: none;
  width: 40px;
  height: 22px;
  background: var(--bg-tertiary);
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease;
}

.checkbox-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.checkbox-toggle:checked {
  background: var(--accent-gradient);
}

.checkbox-toggle:checked::after {
  left: 21px;
  background: white;
}

/* Mini Stats */
.stats-group {
  background: rgba(0, 0, 0, 0.2);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mini-stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent-primary);
}

.mini-stat-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Trouble Arpeggios */
.trouble-arpeggios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.trouble-arpeggio {
  background: var(--bg-tertiary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.trouble-arpeggio .miss-count {
  color: var(--wrong-color);
  font-weight: bold;
}

.no-trouble {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.8rem;
}

/* Practice Area */
.practice-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Start Overlay */
.start-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.start-overlay.hidden {
  display: none;
}

.start-content {
  text-align: center;
  max-width: 400px;
  padding: 2rem;
}

.start-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.start-content p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.start-btn {
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: #0d0015;
  background: var(--accent-gradient);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 107, 53, 0.4);
}

/* Practice Content */
.practice-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  overflow-y: auto;
}

.practice-content.hidden {
  display: none;
}

/* Arpeggio Header */
.arpeggio-header {
  text-align: center;
  margin-bottom: 2rem;
}

.arpeggio-name {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.arpeggio-name.hidden-name {
  color: var(--bg-tertiary);
  background: var(--bg-tertiary);
  border-radius: 8px;
  display: inline-block;
  padding: 0 1rem;
}

.arpeggio-formula {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Notes Display */
.notes-display {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.note-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 100px;
  background: var(--bg-secondary);
  border: 3px solid var(--bg-tertiary);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.note-card .position {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.note-card .note-name {
  font-size: 2rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.note-card .note-name.hidden-note {
  color: var(--bg-tertiary);
}

.note-card.given {
  border-color: var(--accent-primary);
  background: rgba(255, 107, 53, 0.15);
}

.note-card.given .position {
  color: var(--accent-primary);
}

.note-card.completed {
  border-color: var(--correct-color);
  background: rgba(45, 212, 168, 0.15);
}

.note-card.completed .note-name {
  color: var(--correct-color);
}

.note-card.wrong {
  border-color: var(--wrong-color);
  background: rgba(255, 71, 87, 0.15);
}

.note-card.active {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(45, 212, 168, 0.4);
}

/* Detection Area */
.detection-area {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.detected-note-box {
  text-align: center;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  min-width: 100px;
}

.detected-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.detected-note {
  font-size: 2rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

/* Feedback */
.feedback {
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  min-height: 2rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
}

.feedback.success {
  color: var(--correct-color);
}

.feedback.error {
  color: var(--wrong-color);
}

.feedback.info {
  color: var(--accent-primary);
}

/* Practice Controls */
.practice-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.control-btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn:hover {
  border-color: var(--text-secondary);
}

.control-btn.primary {
  background: var(--accent-gradient);
  border-color: var(--accent-primary);
  color: #0d0015;
}

.control-btn.primary:hover {
  opacity: 0.9;
}

.control-btn.hidden {
  display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
  }

  .settings-panel {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--bg-tertiary);
  }

  .practice-area {
    min-height: 60vh;
  }

  .arpeggio-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .note-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .mini-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .app-header h1 {
    font-size: 1.2rem;
  }

  .setting-group {
    padding: 0.75rem;
  }

  .arpeggio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .note-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .note-card {
    width: 60px;
    height: 80px;
  }

  .note-card .note-name {
    font-size: 1.5rem;
  }

  .arpeggio-name {
    font-size: 1.8rem;
  }

  .practice-content {
    padding: 1rem;
  }
}
