:root {
  --bg: #0b0f14;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-hover: rgba(255, 255, 255, 0.08);
  --panel-active: rgba(255, 255, 255, 0.12);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-glow: rgba(124, 196, 255, 0.3);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #7cc4ff;
  --accent2: #9bffcf;
  --accent3: #ffd27a;
  --accent-pink: #f472b6;
  --root-color: #f59e0b;
  --chord-color: #3b82f6;
  --scale-color: #10b981;
  --muted-color: #475569;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --radius: 14px;
}

body {
  margin: 0;
  background: 
    radial-gradient(circle at 0% 0%, rgba(124, 196, 255, 0.08), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(155, 255, 207, 0.06), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.mainContent {
  max-width: 1360px;
  margin: 24px auto 60px;
  padding: 0 18px;
}

h2 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

h3 {
  font-size: 1.05rem;
  margin: 0;
  color: #fff;
}

p {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Info Callout */
.infoCallout {
  background: rgba(124, 196, 255, 0.06);
  border: 1px solid rgba(124, 196, 255, 0.15);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.infoCallout .calloutHeader {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--accent);
}

.infoCallout p {
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.infoCallout p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

/* Grid Layout */
.theoryGrid {
  display: grid;
  grid-template-columns: 1fr minmax(640px, 1.45fr);
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
}

.visualizerPanel {
  position: sticky;
  top: 96px;
  align-self: start;
}

@media (max-width: 1180px) {
  .theoryGrid {
    grid-template-columns: 1fr;
  }
  
  .visualizerPanel {
    position: relative;
    top: 0;
  }
}

/* ==========================================================================
   Consolidated Workstation Header
   ========================================================================== */
.workstationHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--stroke);
  flex-wrap: wrap;
}

.controlGroupRow {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.rightControls {
  justify-content: flex-end;
  flex: 1;
}

.controlItem {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.controlItem label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

select {
  background: var(--bg);
  border: 1px solid var(--stroke);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

select option {
  background: var(--bg);
  color: #fff;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 196, 255, 0.2);
}

/* Volume Slider */
.sliderWrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sliderWrap input[type="range"] {
  width: 80px;
  background: rgba(255, 255, 255, 0.1);
  height: 5px;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.sliderWrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(124, 196, 255, 0.5);
  transition: transform 0.1s ease;
}

.sliderWrap input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.sliderWrap span {
  font-size: 0.8rem;
  font-family: monospace;
  color: var(--muted);
  width: 32px;
  text-align: right;
}

/* Buttons */
.primaryBtn {
  background: var(--accent);
  color: #0b0f14;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(124, 196, 255, 0.25);
}

.primaryBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124, 196, 255, 0.35);
  filter: brightness(1.05);
}

.primaryBtn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.compactPlayBtn {
  height: 38px;
  padding: 0 14px;
}

/* ==========================================================================
   Scale Degrees Rows (Sidebar List)
   ========================================================================== */
.rowsPanel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panelHeader h2 {
  margin-bottom: 4px;
}

.panelHeader .instructions {
  font-size: 0.8rem;
  color: var(--muted);
}

.rowsContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scaleRow {
  display: grid;
  grid-template-columns: 50px 1.5fr auto;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.scaleRow:hover, .scaleRow.active {
  background: var(--panel-hover);
  border-color: rgba(124, 196, 255, 0.3);
  transform: translateX(4px);
}

.scaleRow.active {
  border-color: var(--accent);
  background: rgba(124, 196, 255, 0.04);
}

.rowDegree {
  font-family: serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

.rowChord {
  display: flex;
  flex-direction: column;
}

.rowChordName {
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}

.rowChordFormula {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.rowAction {
  display: flex;
  align-items: center;
}

.playBtn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.playBtn:hover {
  background: var(--accent);
  color: #0b0f14;
  border-color: var(--accent);
  transform: scale(1.08);
}

.playBtn svg {
  fill: currentColor;
}

/* ==========================================================================
   Voicings Selection Panel
   ========================================================================== */
.voicingsSelector {
  margin-top: 10px;
  padding: 16px;
  border-top: 1px dashed var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.voicingsSelector .subHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.voicingsSelector .subHeader h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.voicingsSelector .subHeader span {
  font-size: 0.78rem;
}

.voicingsList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

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

.voicingBtn:hover {
  background: var(--panel-hover);
  border-color: rgba(124, 196, 255, 0.2);
}

.voicingBtn.active {
  border-color: var(--chord-color);
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.voicingName {
  font-weight: 600;
  color: #fff;
  font-size: 0.85rem;
}

.voicingFrets {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

.voicingBtn.active .voicingFrets {
  color: var(--accent);
}

.voicingDesc {
  font-size: 0.65rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Drone Dashboard (Analysis of Open Strings)
   ========================================================================== */
.droneDashboard {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

.dashboardTitle {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboardTitle h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.dashboardTitle span {
  font-size: 0.75rem;
}

.droneIndicators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
  gap: 10px;
}

.droneCard {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.droneCardString {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.droneCardPitch {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  font-family: monospace;
}

.droneStatusBadge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.droneStatusBadge.perfect {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.droneStatusBadge.harmonic {
  background: rgba(124, 196, 255, 0.2);
  color: var(--accent);
  border: 1px solid rgba(124, 196, 255, 0.4);
}

.droneStatusBadge.neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--stroke);
}

.droneStatusBadge.avoid {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   Fretboard Styling
   ========================================================================== */
.fretboardWrapper {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.fretboardHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.fretboardHeader h2 {
  margin: 0;
  font-size: 1.05rem;
}

.fretboardControls {
  display: flex;
  gap: 10px;
}

.guitarContainer {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 8px;
}

/* D3 Fretboard SVG Styles */
.fretboard-bg {
  fill: #1a2330;
}

.fretboard-nut {
  stroke: #cbd5e1;
  stroke-width: 4px;
}

.fret-line {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.5px;
}

.fret-marker {
  fill: rgba(255, 255, 255, 0.25);
}

.string-line {
  stroke: rgba(255, 255, 255, 0.38);
}

.fretboard-note-marker {
  cursor: pointer;
}

.fretboard-note-marker circle {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.fretboard-note-marker:hover circle {
  filter: brightness(1.2) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  stroke-width: 3px;
}

.fretboard-label {
  font-family: monospace;
  font-weight: bold;
  text-anchor: middle;
  dominant-baseline: middle;
  user-select: none;
  pointer-events: none;
}

/* Legend colors */
.wheelLegend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted);
}

.legendItem {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legendColor {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.legendColor.rootColor { background: var(--root-color); }
.legendColor.chordColor { background: var(--chord-color); }
.legendColor.scaleColor { background: rgba(16, 185, 129, 0.4); border: 1px solid var(--scale-color); }
.legendColor.mutedColor { background: var(--muted-color); }

/* ==========================================================================
   Continuous Practice Drone Pad
   ========================================================================== */
.dronePadPanel {
  background: linear-gradient(135deg, rgba(124, 196, 255, 0.08) 0%, rgba(155, 255, 207, 0.04) 100%);
  border: 1px solid rgba(124, 196, 255, 0.2);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.dronePadLeft {
  flex: 1;
}

.dronePadLeft h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.dronePadLeft p {
  margin: 0;
  font-size: 0.82rem;
}

.dronePadBtn {
  background: var(--accent);
  color: #0b0f14;
  border: none;
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(124, 196, 255, 0.3);
}

.dronePadBtn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(124, 196, 255, 0.45);
}

.dronePadBtn.playing {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.dronePadBtn.playing:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.55);
}

.dronePadBtn svg {
  fill: currentColor;
}

/* ==========================================================================
   Educational Section
   ========================================================================== */
.educationalPanel {
  margin-top: 24px;
}

.eduGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 18px;
}

.eduCard {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
}

.eduCard h3 {
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--accent3);
}

.eduCard p {
  line-height: 1.6;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.eduCard p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  margin-top: 40px;
  border-top: 1px solid var(--stroke);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.footInner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footLinks {
  display: flex;
  gap: 20px;
}

.footLinks a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footLinks a:hover {
  color: #fff;
}

/* ==========================================================================
   Flat Visual Header Layout overrides
   ========================================================================== */
.visualHeader {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 8px 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(11, 15, 20, 0.95), rgba(11, 15, 20, 0.85));
  border-bottom: 1px solid var(--stroke);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 64px;
  box-sizing: border-box;
}

.leftHead {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.leftHead .titleblock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.leftHead h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.leftHead .mutedLine {
  margin: 2px 0 0 0 !important;
  font-size: 0.8rem !important;
  color: var(--muted) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.visualHeader .burgerWrap {
  position: relative;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   Responsive Overrides
   ========================================================================== */
@media (max-width: 768px) {
  .scaleRow {
    grid-template-columns: 40px 1.5fr auto;
    padding: 10px 12px;
  }
  
  .voicingsList {
    grid-template-columns: 1fr 1fr;
  }

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