/* Global Styles & Variables */
:root {
  --bg-dark: #0b0d10;
  --panel-bg: rgba(22, 26, 33, 0.88);
  --panel-border: rgba(255, 255, 255, 0.08);
  --accent-ember: #ff6b00;
  --accent-ember-glow: rgba(255, 107, 0, 0.4);
  --accent-cyan: #00f0ff;
  --accent-cyan-glow: rgba(0, 240, 255, 0.3);
  --accent-purple: #b026ff;
  --accent-purple-glow: rgba(176, 38, 255, 0.4);
  --accent-green: #00ff66;
  --accent-red: #ff3366;
  --text-main: #f0f4f8;
  --text-muted: #9ba8b8;
  --font-main: 'Outfit', -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--accent-ember-glow);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent-ember);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes bgMeshShift {
  0% { background-position: 0% 0%, 100% 100%; }
  50% { background-position: 5% -5%, 95% 105%; }
  100% { background-position: 0% 0%, 100% 100%; }
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 107, 0, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.05) 0%, transparent 40%);
  background-size: 150% 150%;
  animation: bgMeshShift 20s infinite alternate ease-in-out;
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header & Top Nav */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ember-flame {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #ff0055, #ff6b00, #ffcc00);
  border-radius: 50% 0 50% 50%;
  transform: rotate(-45deg);
  box-shadow: 0 0 20px var(--accent-ember-glow);
  animation: pulseFlame 2s infinite alternate ease-in-out;
}

@keyframes pulseFlame {
  0% { transform: rotate(-45deg) scale(0.95); opacity: 0.8; }
  100% { transform: rotate(-45deg) scale(1.1); opacity: 1; filter: drop-shadow(0 0 12px #ff6b00); }
}

.brand h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #ffffff, #ff9d5c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  display: block;
  font-weight: 700;
}

/* Global Vocal Mode Switcher (Male / Female Profiles) */
.vocal-mode-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-border);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}

.mode-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), #0088ff);
  color: #fff;
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.mode-btn.female-mode.active {
  background: linear-gradient(135deg, var(--accent-purple), #ff00ab);
  box-shadow: 0 0 15px var(--accent-purple-glow);
}

.top-nav {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  flex-wrap: wrap;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: linear-gradient(135deg, var(--accent-ember), #ff8800);
  color: #fff;
  box-shadow: 0 0 15px var(--accent-ember-glow);
}

.header-badges {
  display: flex;
  gap: 10px;
}

.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.badge-shinedown {
  border-color: rgba(255, 107, 0, 0.4);
  color: #ff9d5c;
  background: rgba(255, 107, 0, 0.1);
}

.badge-health {
  border-color: rgba(0, 240, 255, 0.4);
  color: #72f3ff;
  background: rgba(0, 240, 255, 0.1);
}

/* UTILITY BAR (PITCH PIPE & METRONOME) */
.utility-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 20px;
}

.utility-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.util-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auto-scale-select {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auto-scale-select:focus,
.auto-scale-select:hover {
  border-color: var(--accent-ember);
  outline: none;
}

.pitch-pipe-keyboard {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px 0;
}

.key-btn {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-bottom: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.78rem;
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 34px;
  text-align: center;
}

.key-btn:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(0, 240, 255, 0.25));
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.key-btn.accidental {
  background: rgba(0, 0, 0, 0.6);
  color: #ff9d5c;
  border-bottom: 3px solid rgba(0, 0, 0, 0.8);
}

.key-btn.playing {
  background: var(--accent-ember);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-ember-glow);
  transform: scale(0.92);
  border-bottom-width: 1px;
  margin-top: 2px;
}

/* Metronome Controls */
.metronome-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bpm-text {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 65px;
}

.bpm-pulse-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--panel-border);
  transition: all 0.05s ease;
}

.bpm-pulse-dot.pulse {
  background: var(--accent-ember);
  box-shadow: 0 0 15px var(--accent-ember-glow);
  transform: scale(1.3);
}

input[type='range'] {
  -webkit-appearance: none;
  width: 100px;
  background: transparent;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--accent-ember);
  box-shadow: 0 0 10px var(--accent-ember-glow);
  cursor: pointer;
  margin-top: -6px;
}

input[type='range']::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Album Track Cards */
.album-track-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.track-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: fadeSlideIn 0.3s ease-out backwards;
}

.track-card:nth-child(1) { animation-delay: 0.05s; }
.track-card:nth-child(2) { animation-delay: 0.1s; }
.track-card:nth-child(3) { animation-delay: 0.15s; }
.track-card:nth-child(4) { animation-delay: 0.2s; }
.track-card:nth-child(5) { animation-delay: 0.25s; }
.track-card:nth-child(6) { animation-delay: 0.3s; }
.track-card:nth-child(7) { animation-delay: 0.35s; }
.track-card:nth-child(8) { animation-delay: 0.4s; }
.track-card:nth-child(9) { animation-delay: 0.45s; }

.track-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-cyan);
}

.track-card.active {
  border-color: var(--accent-ember);
  border-left: 4px solid var(--accent-ember);
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(0, 240, 255, 0.05));
}

.track-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.track-meta h4 {
  font-size: 0.88rem;
  font-weight: 700;
}

.track-range {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

.track-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Main Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 340px 1fr 320px;
  gap: 16px;
  align-items: start;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-section {
  display: none;
}

.nav-section.active {
  display: block;
  animation: fadeSlideIn 0.4s ease-out forwards;
}

/* Panels & Cards */
.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 255, 255, 0.03);
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.panel-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Vowel Cards */
.vowel-card-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vowel-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vowel-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-cyan);
}

.vowel-btn.active {
  border-color: var(--accent-ember);
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.15), rgba(0, 240, 255, 0.05));
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.2);
}

.vowel-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent-ember);
}

.vowel-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Air Support Meter */
.air-support-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.air-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.air-status-badge {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
}

.air-meter-bar {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 8px;
}

.air-meter-fill {
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #ff6b00, #b026ff);
  border-radius: 7px;
  transition: width 0.3s ease;
}

.air-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Extended Passaggio Glide Path Display C4 -> F#4 -> A4 -> C5 */
.glide-path-display {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 16px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  flex-wrap: wrap;
  gap: 6px;
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 107, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

@keyframes pulseRingCyan {
  0% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(0, 240, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

.path-node {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 10px 14px;
  border-radius: 10px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
}

.path-node.highlight {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-cyan-glow);
  animation: pulseRingCyan 2s infinite;
}

.path-node.accent {
  border-color: var(--accent-ember);
  color: var(--accent-ember);
  box-shadow: 0 0 15px var(--accent-ember-glow);
  animation: pulseRing 2s infinite;
}

.path-node.c5-node {
  border-color: var(--accent-purple);
  color: #d880ff;
}

.path-node.c5-node.accent {
  box-shadow: 0 0 20px var(--accent-purple-glow);
  background: rgba(176, 38, 255, 0.15);
}

.path-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
}

/* B4 to C5 Specific Cue Card */
.b4c5-cue-card {
  border-color: rgba(176, 38, 255, 0.4);
  background: linear-gradient(135deg, rgba(176, 38, 255, 0.1), rgba(0, 240, 255, 0.05));
}

.b4c5-cue-card h3 {
  color: #d880ff;
}

/* Grit Steps */
.grit-step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grit-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  padding: 12px;
  border-radius: 10px;
}

.grit-step.active {
  border-color: var(--accent-ember);
  background: rgba(255, 107, 0, 0.08);
}

.step-num {
  background: var(--accent-ember);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
}

.grit-step h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.grit-step p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Throat Safety Gauge */
.safety-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.safety-indicator {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
}

.safety-indicator.safe {
  background: rgba(0, 255, 102, 0.08);
  border-color: rgba(0, 255, 102, 0.4);
}

.safety-icon {
  font-size: 2rem;
}

.safety-text h3 {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--accent-green);
}

.safety-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.distortion-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grit-test-display {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  padding: 10px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--accent-cyan);
  text-align: center;
}

/* Interval Visualizer */
.interval-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.interval-controls select {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: inherit;
}

.interval-visual-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  padding: 24px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.interval-note-card {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 900;
}

.interval-note-card.highlight {
  border-color: var(--accent-ember);
  color: var(--accent-ember);
  box-shadow: 0 0 20px var(--accent-ember-glow);
}

.interval-arrow {
  font-size: 1.6rem;
  color: var(--accent-cyan);
}

/* 4-Bar Phrase Timeline */
.phrase-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.bar-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  padding: 14px 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.bar-card span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
}

.bar-card strong {
  font-size: 0.85rem;
}

.bar-card small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.bar-card.clean strong { color: var(--accent-cyan); }
.bar-card.build strong { color: #ffcc00; }
.bar-card.grit strong { color: var(--accent-ember); }

.bar-card.active-bar {
  border-color: var(--accent-ember);
  box-shadow: 0 0 20px var(--accent-ember-glow);
  transform: translateY(-4px);
}

/* Studio Routines */
.routine-step-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.routine-step-card.recovery {
  border-color: rgba(0, 240, 255, 0.3);
}

.routine-time {
  background: rgba(255, 107, 0, 0.2);
  color: var(--accent-ember);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.routine-step-card.recovery .routine-time {
  background: rgba(0, 240, 255, 0.2);
  color: var(--accent-cyan);
}

.routine-step-card h4 {
  font-size: 0.88rem;
  font-weight: 700;
}

.routine-step-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Common UI Controls */
.btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-ember), #ff8800);
  color: #fff;
}

.btn-primary:hover {
  box-shadow: 0 0 15px var(--accent-ember-glow);
  transform: translateY(-1px);
}

.btn-glow {
  box-shadow: 0 0 20px var(--accent-ember-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-accent {
  background: linear-gradient(135deg, #00c3ff, #0077ff);
  color: #fff;
}

.btn-accent:hover {
  box-shadow: 0 0 15px var(--accent-cyan-glow);
  transform: translateY(-1px);
}

.guide-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  padding: 14px;
  border-radius: 12px;
}

.guide-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.guide-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.guide-card ul li strong { color: var(--text-main); }

.accent-card {
  border-color: rgba(255, 107, 0, 0.3);
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.05), transparent);
}

.main-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 14px 0;
  border-top: none;
  background: linear-gradient(to top, transparent, rgba(255, 255, 255, 0.02));
  position: relative;
}

.main-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Visualizer / Tuner Area */
.visualizer-container {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.visualizer-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 8px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeSlideIn 0.3s ease forwards; }

.mic-tuner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.mic-status {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mic-status::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan-glow);
}

.pitch-meter {
  width: 100%;
  max-width: 300px;
  text-align: center;
}

.pitch-gauge {
  position: relative;
  height: 30px;
  background: linear-gradient(90deg, rgba(255,51,102,0.5), rgba(0,255,102,0.5) 50%, rgba(255,51,102,0.5));
  border-radius: 15px;
  margin: 10px 0;
  overflow: hidden;
  border: 1px solid var(--panel-border);
}

.pitch-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
  transition: left 0.1s ease-out;
}

.pitch-target, .pitch-freq {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.visual-note-display {
  text-align: center;
  margin-top: 10px;
}

.current-note {
  font-size: 3rem;
  font-family: var(--font-heading);
  font-weight: 900;
  color: var(--accent-ember);
  text-shadow: 0 0 20px var(--accent-ember-glow);
}

/* Band Hub / Spotify Section */
.band-hero-banner {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.2), rgba(0, 0, 0, 0.8)), url('https://placeholder.image') center/cover;
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 20px;
  border: 1px solid var(--panel-border);
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-ember);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 900;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.band-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.spotify-panel, .practice-panel {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px;
}

.spotify-embed-wrap {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
}

.video-card-header {
  margin-bottom: 10px;
}

.video-responsive {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 10px;
}

.video-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--panel-bg);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-cyan-glow);
  z-index: 1000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Mobile & Responsive Layout Polish */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .phrase-timeline {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 10px;
    gap: 12px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .main-header {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 12px;
  }

  .brand h1 {
    font-size: 1.2rem;
  }

  .vocal-mode-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .mode-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .nav-tab {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* Sticky Utility Bar on Phone Viewport */
  .utility-bar {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(15, 18, 24, 0.96);
    backdrop-filter: blur(16px);
    border-color: rgba(255, 107, 0, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  }

  .utility-section {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .auto-scale-select {
    flex: 1;
    max-width: none;
    font-size: 0.78rem;
  }

  #btnAutoScaleToggle {
    min-height: 44px;
    font-size: 0.85rem;
    font-weight: 700;
  }

  .key-btn {
    padding: 10px 12px;
    min-width: 44px;
    font-size: 0.82rem;
  }

  .glide-path-display {
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start;
  }

  .band-grid {
    grid-template-columns: 1fr;
  }

  .phrase-timeline {
    grid-template-columns: 1fr 1fr;
  }
}

/* Daily Warm-Up Step Buttons & Active Visual Activation State */
.daily-step-item .btn {
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid var(--panel-border);
  position: relative;
}

.daily-step-item .btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.daily-step-item .btn.active {
  background: linear-gradient(135deg, var(--accent-ember), #ff0055) !important;
  color: #ffffff !important;
  border-color: #ff9d5c !important;
  font-weight: 800 !important;
  box-shadow: 0 0 20px var(--accent-ember-glow), 0 0 10px rgba(255, 107, 0, 0.8) !important;
  transform: scale(1.05) translateY(-2px);
  animation: activePulseGlow 1.8s infinite alternate ease-in-out;
}

@keyframes activePulseGlow {
  0% {
    box-shadow: 0 0 12px var(--accent-ember-glow), 0 0 5px rgba(255, 107, 0, 0.6);
    border-color: rgba(255, 157, 92, 0.8);
  }
  100% {
    box-shadow: 0 0 24px var(--accent-ember-glow), 0 0 15px rgba(255, 107, 0, 1);
    border-color: #ffffff;
  }
}

/* Exact Reference Image Match: Sleek Ember Neon Pill Banner Tag */
.ember-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  border-radius: 9999px;
  background: rgba(30, 10, 2, 0.85);
  border: 1.5px solid #ff7700;
  box-shadow: 0 0 16px rgba(255, 119, 0, 0.4), inset 0 0 12px rgba(255, 119, 0, 0.15);
  backdrop-filter: blur(12px);
  color: #ff8800;
  font-family: 'Space Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  margin-bottom: 14px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ember-pill-tag:hover {
  box-shadow: 0 0 25px rgba(255, 119, 0, 0.7), inset 0 0 16px rgba(255, 119, 0, 0.3);
  transform: translateY(-1px) scale(1.02);
  border-color: #ffa500;
  color: #ffa500;
}

.ember-pill-tag .pill-flame {
  font-size: 1.1rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 119, 0, 0.8));
  animation: flamePulse 1.5s infinite alternate ease-in-out;
}

@keyframes flamePulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(255, 119, 0, 0.6)); }
  100% { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(255, 119, 0, 1)); }
}

/* Fixed Mobile Function Action Bar */
.mobile-function-bar {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 74px !important;
  }

  .mobile-function-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(11, 13, 16, 0.96);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 107, 0, 0.4);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: space-around;
    align-items: center;
    padding: 4px 6px;
  }

  .mobile-func-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 6px 2px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
  }

  .mobile-func-btn:active {
    transform: scale(0.92);
  }

  .mobile-func-btn .m-icon {
    font-size: 1.25rem;
    line-height: 1;
    margin-bottom: 2px;
  }

  .mobile-func-btn .m-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mobile-func-btn.active {
    color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
  }

  .mobile-func-btn.active-ember {
    color: var(--accent-ember);
    background: rgba(255, 107, 0, 0.15);
    border: 1px solid rgba(255, 107, 0, 0.5);
    box-shadow: 0 0 12px var(--accent-ember-glow);
  }
}

/* Mobile Mic Settings Modal Sheet */
.mobile-mic-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 10001;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease-out;
}

.mobile-mic-modal.show {
  display: flex;
}

.mobile-mic-content {
  width: 100%;
  max-width: 480px;
  background: rgba(15, 18, 24, 0.98);
  border: 1px solid var(--accent-cyan);
  border-radius: 20px 20px 16px 16px;
  box-shadow: 0 -10px 40px rgba(0, 240, 255, 0.3);
  padding: 20px;
  transform: translateY(0);
  animation: slideUpModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
