/* IntelliTabs Performance & Stage Stylesheet */

:root {
  --bg-stage: #090d16;
  --bg-stage-card: #0f172a;
  --bg-stage-card-hover: #17223b;
  --stage-border: #1e293b;
  --stage-border-light: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --color-chord: #38bdf8;
  --color-chord-hover: #7dd3fc;
  --color-section: #c084fc;
  --tab-font: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
}

/* Base resets & typography */
html, body {
  background-color: var(--bg-stage);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Sticky top navigation */
.navbar-sticky {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(15, 23, 42, 0.94);
  border-bottom: 1px solid var(--stage-border);
}

/* Flash alerts */
.alert-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.4); color: #a7f3d0; }
.alert-error { background: rgba(244, 63, 94, 0.15); border: 1px solid rgba(244, 63, 94, 0.4); color: #fecdd3; }
.alert-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.4); color: #fde68a; }
.alert-info { background: rgba(56, 189, 248, 0.15); border: 1px solid rgba(56, 189, 248, 0.4); color: #bae6fd; }

/* Grid of Song Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.song-card {
  background: var(--bg-stage-card);
  border: 1px solid var(--stage-border);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
}

.song-card:hover {
  transform: translateY(-2px);
  border-color: var(--stage-border-light);
  background: var(--bg-stage-card-hover);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6);
}

/* Instrument Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-guitar { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.35); }
.badge-bass { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-ukulele { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.35); }
.badge-piano { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.35); }

/* TAB VIEWER CONTAINER */
.tab-viewer-container {
  background: #0b0f19;
  border: 1px solid var(--stage-border);
  border-radius: 1.25rem;
  padding: 2.25rem 2rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow-x: auto;
}

/* Monospace Tab Sheet Engine (Guarantees exact chord/lyric column alignment) */
.tab-sheet {
  font-family: var(--tab-font);
  font-variant-ligatures: none;
  font-size: 1.05rem;
  line-height: 1.65;
  white-space: pre;
  color: #e2e8f0;
  tab-size: 4;
  letter-spacing: 0px;
}

/* Chords: strictly inline to prevent horizontal shifting */
.chord-token {
  display: inline;
  color: var(--color-chord);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: color 0.15s ease, text-shadow 0.15s ease;
  user-select: none;
}

.chord-token:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Section Markers */
.section-badge {
  display: inline-block;
  color: var(--color-section);
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-weight: 700;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 0.5rem;
  margin: 1.25rem 0 0.5rem 0;
}

/* Tablature Block */
.tab-block {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #1e293b;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-family: var(--tab-font);
  color: #38bdf8;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.45;
  font-size: 0.95rem;
}

/* Floating Auto-Scroll Controls */
.autoscroll-bar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--stage-border-light);
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  transition: all 0.2s ease;
}

.autoscroll-bar input[type="range"] {
  accent-color: #6366f1;
  width: 90px;
  cursor: pointer;
}

/* Chord Reference Ribbon */
.chord-ribbon {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--stage-border);
  margin-bottom: 1.5rem;
}

.chord-chip {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid var(--stage-border);
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-family: var(--tab-font);
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-chord);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chord-chip:hover, .chord-chip.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
}

/* Chord Tooltip Popup Diagram Card */
#chord-tooltip {
  position: absolute;
  z-index: 100;
  display: none;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.85rem;
  padding: 0.85rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  min-width: 140px;
  text-align: center;
}

/* Fullscreen Stage Mode */
body.fullscreen-mode {
  background-color: #000000 !important;
}

body.fullscreen-mode .navbar-sticky,
body.fullscreen-mode footer,
body.fullscreen-mode .hide-fullscreen {
  display: none !important;
}

body.fullscreen-mode .tab-viewer-container {
  max-width: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: #000000 !important;
  padding: 2rem 5% !important;
  min-height: 100vh;
}

/* Print Friendly Stylesheet */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .navbar-sticky, footer, .autoscroll-bar, .song-toolbar, .no-print, .chord-ribbon {
    display: none !important;
  }
  .tab-viewer-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .tab-sheet {
    color: #000000 !important;
  }
  .chord-token {
    color: #000000 !important;
    font-weight: 800 !important;
  }
  .section-badge {
    color: #333333 !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
  }
}
