/* Simple Tracks Stage Prompter · Styles */
:root {
  --bg-primary: #0e0f12;
  --bg-surface: #17181e;
  --bg-surface-elevated: #22242c;
  --accent-gold: #f5c76e;
  --accent-mint: #5ce6b0;
  --accent-blue: #7ac4f0;
  --text-primary: #f2f2f7;
  --text-secondary: #9a9aa8;
  --border-subtle: #2b2d37;
  --border-active: #f5c76e;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.4;
}

/* Join View */
.join-container {
  max-width: 420px;
  margin: 60px auto 40px;
  padding: 32px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.join-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.join-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.join-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-code {
  width: 100%;
  padding: 14px;
  font-size: 32px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 6px;
  text-align: center;
  color: var(--accent-gold);
  background: var(--bg-primary);
  border: 2px solid var(--border-subtle);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s;
}

.input-code:focus {
  border-color: var(--accent-gold);
}

.input-text {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  color: #fff;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  outline: none;
}

.input-text:focus {
  border-color: var(--accent-gold);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #0e0f12;
  background: var(--accent-gold);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-primary:active {
  transform: scale(0.98);
}

.error-banner {
  margin-top: 16px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.12);
  border-radius: 8px;
  display: none;
}

/* Stage Prompter View */
.prompter-view {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

/* Sticky Header */
.stage-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(23, 24, 30, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 16px;
}

.header-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.song-info-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.song-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.song-title {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.song-artist-meta {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(92, 230, 176, 0.15);
  color: var(--accent-mint);
  border: 1px solid var(--accent-mint);
}

.badge-paused {
  background: rgba(245, 199, 110, 0.15);
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.badge-stopped {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.connection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.connection-row[data-state="connected"] { color: var(--accent-mint); }
.connection-row[data-state="warning"] { color: var(--accent-gold); }
.connection-row[data-state="offline"] { color: #ff8585; }
.logout-btn { padding: 4px 9px; }

/* Header Controls Toolbar */
.header-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}

.tool-btn.active {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.stepper-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.stepper-btn {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

.stepper-val {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-gold);
}

/* Next Section Callout Banner */
.next-banner {
  background: rgba(245, 199, 110, 0.12);
  border-bottom: 1px solid rgba(245, 199, 110, 0.35);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.next-banner-tag {
  background: var(--accent-gold);
  color: #0e0f12;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.next-banner-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

/* Sections Feed */
.sections-feed {
  flex: 1;
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}

.section-card.active {
  border-color: var(--accent-mint);
  background: rgba(14, 38, 28, 0.9);
  box-shadow: 0 0 20px rgba(92, 230, 176, 0.25);
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.section-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  color: #0e0f12;
  text-transform: uppercase;
}

.section-status-pill {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--accent-mint);
  color: #0e0f12;
  display: none;
}

.section-card.active .section-status-pill {
  display: inline-block;
}

.chord-sheet {
  font-family: var(--font-mono);
  font-size: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.chord-line {
  color: var(--accent-gold);
  font-weight: 700;
}

.lyric-line {
  color: #fff;
  font-weight: 500;
}

.lyrics-only-sheet {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  color: #fff;
  white-space: pre-line;
}

/* Setlist Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.setlist-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  z-index: 101;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.drawer-overlay.open .setlist-drawer {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

.setlist-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.setlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 4px;
  background: transparent;
}

.setlist-item.selected {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-gold);
}

.setlist-item-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.setlist-item-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Floating Return Pill */
.return-live-pill {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gold);
  color: #0e0f12;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 20px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 60;
  display: none;
}
