@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* --- Reset & Base Variables --- */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains+Mono', monospace;

  /* HSL Color Palette - Premium Dark Stage first */
  --bg-dark: hsl(220, 24%, 7%);
  --bg-dark-secondary: hsl(222, 20%, 12%);
  --bg-card: rgba(22, 26, 35, 0.65);
  --bg-glass-heavy: rgba(13, 15, 20, 0.85);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 65%);
  --text-muted: hsl(215, 15%, 45%);

  --accent-cyan: hsl(180, 100%, 45%);
  --accent-cyan-glow: hsla(180, 100%, 45%, 0.3);
  --accent-purple: hsl(270, 95%, 65%);
  --accent-purple-glow: hsla(270, 95%, 65%, 0.3);
  --accent-amber: hsl(38, 100%, 55%);
  --accent-amber-glow: hsla(38, 100%, 55%, 0.25);
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(180, 100%, 45%, 0.15);
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Font Scaling Variables for performance reader */
  --reader-font-size: 16px;
  --chord-font-size: 14px;
  --reader-line-height: 2.8;
}

/* Light Theme Variables */
body.light-theme {
  --bg-dark: hsl(220, 20%, 97%);
  --bg-dark-secondary: hsl(220, 15%, 92%);
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-glass-heavy: rgba(255, 255, 255, 0.9);
  
  --text-primary: hsl(220, 30%, 15%);
  --text-secondary: hsl(220, 15%, 45%);
  --text-muted: hsl(220, 10%, 60%);

  --accent-cyan: hsl(195, 95%, 45%);
  --accent-cyan-glow: hsla(195, 95%, 45%, 0.2);
  --accent-purple: hsl(270, 80%, 55%);
  --accent-purple-glow: hsla(270, 80%, 55%, 0.15);
  --accent-amber: hsl(35, 90%, 45%);
  --accent-amber-glow: hsla(35, 90%, 45%, 0.2);

  --border-light: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 50% 0%, var(--bg-dark-secondary) 0%, var(--bg-dark) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- App Layout --- */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 24px;
  z-index: 10;
  transition: var(--transition-smooth);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--accent-cyan-glow);
}

.logo-icon svg {
  fill: #fff;
  width: 22px;
  height: 22px;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.nav-item button {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: left;
}

.nav-item button svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
  transition: var(--transition-smooth);
}

.nav-item.active button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-light);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-item.active button svg {
  stroke: var(--accent-cyan);
  filter: drop-shadow(0 0 5px var(--accent-cyan-glow));
}

.nav-item button:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.sidebar-divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  padding-left: 8px;
}

.setlist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex-grow: 1;
  max-height: 250px;
}

.setlist-item button {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setlist-item.active button {
  color: var(--accent-purple);
  font-weight: 600;
  background: rgba(168, 85, 247, 0.08);
}

.setlist-item button:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.add-setlist-btn {
  margin-top: 12px;
  padding: 8px;
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  transition: var(--transition-smooth);
}

.add-setlist-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

/* Sidebar Footer / Settings Toggle */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* --- Mobile/Tablet Bottom Navigation Bar --- */
.bottom-nav {
  display: none; /* Hidden by default on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 72px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(25px);
  border-top: 1px solid var(--border-light);
  z-index: 900;
  justify-content: space-around;
  align-items: center;
  padding: 0 12px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
}

.bottom-nav button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 70px;
  height: 100%;
}

.bottom-nav button svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-secondary);
  stroke-width: 2;
  fill: none;
  transition: var(--transition-smooth);
}

.bottom-nav button.active {
  color: var(--accent-cyan);
}

.bottom-nav button.active svg {
  stroke: var(--accent-cyan);
  filter: drop-shadow(0 0 5px var(--accent-cyan-glow));
}

/* --- Main Content Panel --- */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background: transparent;
  overflow: hidden;
}

/* Header bar */
.top-header {
  height: 80px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: rgba(13, 15, 20, 0.2);
  backdrop-filter: blur(10px);
  z-index: 5;
}

.header-title-area h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

.search-wrapper {
  position: relative;
  width: 300px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: var(--transition-smooth);
}

.search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  stroke-width: 2;
  fill: none;
}

.primary-btn {
  padding: 12px 24px;
  border-radius: 24px;
  border: none;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
  transition: var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.secondary-btn {
  padding: 12px 24px;
  border-radius: 24px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

/* Page Containers */
.page-view {
  flex-grow: 1;
  padding: 40px;
  overflow-y: auto;
  display: none;
}

.page-view.active {
  display: block;
}

/* --- Library Dashboard (Spacious & Clean) --- */
.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 24px;
}

.song-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 28px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-bounce);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 180px;
}

.song-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--accent-cyan), var(--accent-purple));
  opacity: 0;
  transition: var(--transition-smooth);
}

.song-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

.song-card:hover::before {
  opacity: 1;
}

.song-card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.song-card-artist {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
}

.song-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.song-card-key {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 4px 10px;
  border-radius: 6px;
}

.song-card-tempo {
  font-size: 13px;
  color: var(--text-muted);
}

.song-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  color: var(--text-secondary);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  stroke: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* --- Performance Reader View (Spacious stages) --- */
.reader-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
  position: relative;
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: rgba(13, 15, 20, 0.3);
  border-bottom: 1px solid var(--border-light);
}

.reader-song-info h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.reader-song-info p {
  font-size: 15px;
  color: var(--text-secondary);
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Reader & chord sheet container ── */
.chord-sheet-container {
  flex-grow: 1;
  padding: 40px 8%;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: var(--bg-dark);
}

.chord-sheet-content {
  max-width: 900px;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: var(--reader-font-size, 16px);
  line-height: 1;            /* tight — blocks manage their own spacing */
  color: var(--text-primary);
  user-select: none;
  padding-bottom: 200px;
}

/* ── Section labels  e.g. "Verse 1", "Chorus" ── */
.section-label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(0, 230, 210, 0.08);
  border: 1px solid rgba(0, 230, 210, 0.18);
  border-radius: 6px;
  padding: 3px 10px;
  margin: 28px 0 14px;
}

/* ── A row that contains chord+lyric blocks ── */
.chord-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;       /* lyrics on the same baseline */
  margin-bottom: 0;
  padding-top: 28px;           /* room above for the chord name */
  line-height: 1.5;
}

/* ── One chord + the syllables beneath it ── */
.chord-block {
  display: inline-flex;
  flex-direction: column;
  position: relative;
  margin-right: 0;
}

/* The chord name sits in a coloured pill above the lyric */
.chord-name {
  position: absolute;
  bottom: 100%;
  left: 0;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: calc(var(--chord-font-size, 14px) * 0.92);
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 230, 210, 0.10);
  border: 1px solid rgba(0, 230, 210, 0.22);
  border-radius: 5px;
  padding: 1px 7px 1px 6px;
  margin-bottom: 3px;
  line-height: 1.6;
  user-select: none;
}

/* The lyric text that sits under the chord */
.chord-lyrics {
  font-family: var(--font-mono);
  font-size: var(--reader-font-size, 16px);
  color: var(--text-primary);
  white-space: pre;
  line-height: 1.5;
}

/* ── Plain lyric lines (no chord above) ── */
.lyrics-only {
  font-family: var(--font-mono);
  font-size: var(--reader-font-size, 16px);
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 2px 0;
  white-space: pre-wrap;
}

/* ── Guitar tab blocks ── */
.tab-block {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 20px;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 14px 0;
  white-space: pre;
  overflow-x: auto;
}

/* ── Legacy chordpro section wrappers (kept for backward compat) ── */
.chordpro-section {
  margin-bottom: 32px;
  background: rgba(255, 255, 255, 0.015);
  border-radius: 14px;
  border-left: 4px solid var(--border-light);
  padding: 16px 24px;
}
.chordpro-section.verse  { border-left-color: var(--accent-cyan); }
.chordpro-section.chorus { border-left-color: var(--accent-purple); background: rgba(168,85,247,0.025); }
.chordpro-section.bridge { border-left-color: var(--accent-amber); }

.chordpro-section-header {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  letter-spacing: 1.8px;
}

.chordpro-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  padding-top: 26px;
  margin-bottom: 0;
  line-height: 1.5;
}

.chordpro-block {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  margin-right: 0;
}

.chordpro-chord {
  position: absolute;
  bottom: 100%;
  left: 0;
  white-space: nowrap;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: calc(var(--chord-font-size, 14px) * 0.92);
  user-select: none;
  pointer-events: none;
  line-height: 1.6;
  background: rgba(0, 230, 210, 0.10);
  border: 1px solid rgba(0, 230, 210, 0.22);
  padding: 1px 7px 1px 6px;
  border-radius: 5px;
  margin-bottom: 3px;
}

.chordpro-text {
  font-family: var(--font-mono);
  font-size: var(--reader-font-size, 16px);
  color: var(--text-primary);
  white-space: pre;
  line-height: 1.5;
}

/* Floating Performance Controller (Spacious pill) */
.floating-control-bar {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 15, 20, 0.88);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border-light);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  z-index: 100;
  transition: var(--transition-bounce);
  flex-wrap: wrap;
  justify-content: center;
}

.floating-control-bar:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 1px solid var(--border-light);
  padding-right: 24px;
}

.control-group:last-child {
  border-right: none;
  padding-right: 0;
}

.control-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Transpose pill controls */
.transpose-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
  color: var(--accent-cyan);
}

.pill-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--text-secondary);
}

/* Play/Pause controls for Autoscroll */
.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px var(--accent-cyan-glow);
  transition: var(--transition-bounce);
}

.play-btn:hover {
  transform: scale(1.1);
}

.play-btn svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.range-slider {
  -webkit-appearance: none;
  width: 100px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-cyan-glow);
  transition: var(--transition-smooth);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Metronome Controls */
.metronome-bpm {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  min-width: 38px;
  text-align: center;
  color: var(--accent-purple);
}

/* Metronome Visual Flash Ring */
.metronome-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  box-shadow: 0 0 0 rgba(168, 85, 247, 0);
  transition: background 0.1s ease;
}

.metronome-indicator.flash {
  background: var(--accent-purple);
  box-shadow: 0 0 15px 6px var(--accent-purple-glow);
  animation: pulse-out 0.2s ease-out;
}

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

/* --- Editor Mode Split Layout --- */
.editor-container {
  display: flex;
  height: calc(100vh - 80px);
  width: 100%;
}

.editor-sidebar {
  width: 50%;
  height: 100%;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  background: rgba(13, 15, 20, 0.4);
}

.editor-toolbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
}

.editor-meta-inputs {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid var(--border-light);
}

.editor-input {
  flex-grow: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
}

.editor-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.editor-textarea-wrapper {
  flex-grow: 1;
  position: relative;
}

.editor-textarea {
  width: 100%;
  height: 100%;
  padding: 24px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  outline: none;
}

.editor-preview {
  width: 50%;
  height: 100%;
  overflow-y: auto;
  background: var(--bg-dark);
  padding: 40px;
}

/* --- Setlist Manage Screen --- */
.setlist-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.setlist-song-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.setlist-song-row {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.setlist-song-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--accent-purple);
}

.song-row-info {
  display: flex;
  align-items: center;
  gap: 24px;
}

.song-row-index {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
  width: 28px;
}

.song-row-details h4 {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
}

.song-row-details p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.song-row-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-glass-heavy);
  border: 1px solid var(--border-light);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  border-radius: 20px;
  width: 480px;
  padding: 36px;
  transform: translateY(20px);
  transition: var(--transition-bounce);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.modal-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* File Import Drag Zone */
.import-zone:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

/* Add Song to Setlist Selector */
.song-selector-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.song-select-item {
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.song-select-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-cyan);
}

.song-select-item.selected {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--accent-cyan);
}

/* Toast Messages */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--bg-glass-heavy);
  border-left: 4px solid var(--accent-cyan);
  border: 1px solid var(--border-light);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 14px 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  transform: translateY(20px);
  opacity: 0;
  animation: slide-in 0.3s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slide-in {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast.success {
  border-left-color: var(--accent-cyan);
}

.toast.error {
  border-left-color: hsl(355, 85%, 60%);
}

.toast.info {
  border-left-color: var(--accent-purple);
}

/* Quick Setlist Performance Panel */
.setlist-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(13, 15, 20, 0.5);
  border-top: 1px solid var(--border-light);
  padding: 16px 40px;
}

.setlist-nav-info {
  font-size: 14px;
  color: var(--text-secondary);
}

/* --- Secure Login Overlay --- */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 30%, hsl(222, 20%, 15%) 0%, var(--bg-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s ease;
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 400px;
  padding: 40px;
  backdrop-filter: blur(20px);
}

/* --- Responsive Layout Rules --- */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  
  .bottom-nav {
    display: flex;
  }
  
  .main-content {
    height: calc(100vh - 72px);
  }
  
  .top-header {
    height: auto;
    padding: 16px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .header-controls {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .search-wrapper {
    flex-grow: 1;
    width: auto;
  }
  
  .page-view {
    padding: 24px;
  }
  
  .song-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .song-card {
    padding: 24px;
    min-height: 140px;
  }
  
  .song-card-title {
    font-size: 18px;
  }
  
  .floating-control-bar {
    bottom: 84px;
    width: 90%;
    padding: 10px 16px;
    gap: 12px;
  }
  
  .control-group {
    border-right: none;
    padding-right: 0;
    justify-content: center;
    width: 100%;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
  }
  
  .control-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .chord-sheet-container {
    padding: 24px 6%;
  }

  .chord-sheet-content {
    padding-bottom: 240px;
  }

  .modal-content {
    width: 90%;
    padding: 24px;
  }
  
  .editor-container {
    flex-direction: column;
  }
  .editor-sidebar, .editor-preview {
    width: 100%;
    height: 50%;
  }
}
