/* Interval Trainer Styles - Sunset Boulevard */

body {
  font-family: var(--font-stack);
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

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

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

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

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 60px);
}

/* Settings Sidebar */
.settings-sidebar {
  width: var(--sidebar-width);
  background: var(--glass-bg);
  padding: 1.5rem;
  border-right: 1px solid var(--glass-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-section h3 {
  font-size: 0.9rem;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.interval-btn {
  padding: 0.5rem 0.25rem;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.interval-btn:hover {
  background: rgba(255, 107, 53, 0.3);
}

.interval-btn.active {
  background: var(--accent-gradient);
  color: #0d0015;
  font-weight: 600;
}

.random-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.random-btn:hover {
  background: rgba(255, 107, 53, 0.3);
}

.random-btn.active {
  background: var(--accent-gradient);
  color: #0d0015;
  font-weight: 600;
}

/* Direction Grid */
.direction-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.direction-btn {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.direction-btn:hover {
  background: rgba(255, 107, 53, 0.3);
}

.direction-btn.active {
  background: var(--accent-gradient);
  color: #0d0015;
  font-weight: 600;
}

/* Range Row */
.range-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.range-row label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  min-width: 40px;
}

.range-row select {
  flex: 1;
  padding: 0.6rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.range-row select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Stats Section */
.stats-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 1rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.stat-row:last-child {
  border-bottom: none;
}

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

.stat-value {
  font-weight: 600;
  color: var(--accent-primary);
}

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

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

/* 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-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

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

.start-content {
  text-align: center;
  padding: 2rem;
}

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

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

.start-btn {
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-weight: 600;
  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 10px 30px rgba(255, 107, 53, 0.4);
}

/* Practice Content */
.practice-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

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

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

.interval-name {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

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

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

.note-card {
  background: var(--glass-bg);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  min-width: 140px;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.note-card.root {
  border-color: rgba(255, 107, 53, 0.3);
}

.note-card.target {
  border-color: rgba(255, 45, 85, 0.3);
}

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

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

.note-card.active {
  border-color: var(--warning-color);
  box-shadow: 0 0 20px rgba(255, 179, 71, 0.3);
}

.note-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

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

.note-card.root .note-name {
  color: var(--accent-primary);
}

.note-card.target .note-name {
  color: var(--accent-secondary);
}

.note-status {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.interval-arrow {
  font-size: 2rem;
  color: var(--text-secondary);
}

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

.detection-box {
  text-align: center;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  min-width: 120px;
}

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

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

.detected-cents {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--warning-color);
}

/* Feedback */
.feedback {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  padding: 1rem 2rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.feedback.correct {
  color: var(--correct-color);
  background: rgba(45, 212, 168, 0.1);
}

.feedback.incorrect {
  color: var(--wrong-color);
  background: rgba(255, 71, 87, 0.1);
}

.feedback.waiting {
  color: var(--text-secondary);
}

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

.control-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-btn:hover:not(:disabled) {
  background: rgba(255, 107, 53, 0.3);
}

.control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

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

.control-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

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

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

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

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

  .notes-display {
    flex-direction: column;
    gap: 1rem;
  }

  .interval-arrow {
    transform: rotate(90deg);
  }

  .detection-area {
    flex-direction: column;
    gap: 0.5rem;
  }

  .practice-controls {
    flex-direction: column;
    width: 100%;
  }

  .control-btn {
    width: 100%;
  }
}
