/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #000000;
  --surface: rgba(255,255,255,0.06);
  --surface-hover: rgba(255,255,255,0.10);
  --border: rgba(255,255,255,0.10);
  --border-focus: #00d4ff;
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.55);
  --text-dim: rgba(255,255,255,0.30);
  --accent: #00d4ff;
  --accent-glow: rgba(0,212,255,0.35);
  --green: #00e676;
  --red: rgba(255,82,82,0.85);
  --radius: 12px;
  --radius-sm: 8px;
}

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 600px;
  height: 600px;
  position: relative;
  overflow: hidden;
}

/* ── Splash Screen ── */
.splash-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: absolute;
  inset: 0;
  z-index: 100;
}
.splash-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #1a1a1a 0%, #000 100%);
}
.splash-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: splashFadeIn 0.5s ease both;
}
@keyframes splashFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.splash-logo-wrap {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.25);
  animation: splashSpin 1.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes splashSpin {
  from { opacity: 0; transform: scale(0.6) rotate(-15deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
.splash-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.splash-name {
  margin-top: 20px;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.splash-tagline {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.01em;
}
.splash-screen.fade-out {
  animation: splashOut 0.45s ease forwards;
}
@keyframes splashOut {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}

/* ── Screens ── */
.screen {
  width: 600px;
  height: 600px;
  position: absolute;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}
.screen.hidden { display: none; }

/* ── Header ── */
.screen-header {
  padding: 20px 20px 16px;
  flex-shrink: 0;
}
.screen-header.compact {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Search Bar ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 12px 18px;
  cursor: pointer;
  transition: all 150ms ease;
  min-height: 52px;
}
.search-bar:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 20px var(--accent-glow);
  background: var(--surface-hover);
}
.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.search-placeholder {
  color: var(--text-secondary);
  font-size: 15px;
}
.search-query {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
}

/* ── Empty State ── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 40px;
}
.empty-icon {
  font-size: 48px;
  opacity: 0.2;
  margin-bottom: 4px;
}
.empty-label {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 500;
}
.empty-sub {
  font-size: 13px;
  color: var(--text-dim);
}

/* ── Search Results ── */
.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 12px;
}
.search-results.hidden { display: none; }

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 150ms ease;
  min-height: 60px;
}
.result-item:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 16px var(--accent-glow);
  background: var(--surface-hover);
}
.result-item:last-child { margin-bottom: 0; }

.result-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}
.result-avatar svg { width: 18px; height: 18px; }
.result-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.result-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.result-arrow {
  margin-left: auto;
  color: var(--text-dim);
}
.result-arrow svg { width: 16px; height: 16px; }

/* ── Artist Hero ── */
.artist-hero {
  position: relative;
  width: 600px;
  height: 160px;
  flex-shrink: 0;
  overflow: hidden;
  background: #0a0a0a;
}
.artist-hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transition: opacity 400ms ease;
  opacity: 0;
}
.artist-hero-img.loaded { opacity: 1; }
.artist-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.25) 0%,
    rgba(0,0,0,0.15) 40%,
    rgba(0,0,0,0.75) 80%,
    rgba(0,0,0,0.95) 100%
  );
}
.hero-back {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border-color: rgba(255,255,255,0.15);
}
.artist-hero-info {
  position: absolute;
  bottom: 14px;
  left: 18px;
  right: 18px;
  z-index: 2;
}
.artist-hero-info .artist-name,
.artist-hero-info .setlist-venue {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist-hero-info .artist-meta,
.artist-hero-info .setlist-date {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* ── Back Button ── */
.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 150ms ease;
}
.back-btn svg { width: 16px; height: 16px; }
.back-btn:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ── Artist Header ── */
.artist-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.artist-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(0,212,255,0.05));
  border: 1px solid rgba(0,212,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.artist-avatar svg { width: 20px; height: 20px; }
.artist-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* ── Setlist List ── */
.setlist-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 4px;
}

.setlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 150ms ease;
  min-height: 70px;
}
.setlist-item:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 20px var(--accent-glow);
  background: var(--surface-hover);
}
.setlist-item:last-child { margin-bottom: 0; }

.setlist-cal-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.setlist-cal-icon svg { width: 16px; height: 16px; }

.setlist-info { flex: 1; min-width: 0; }
.setlist-venue-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.setlist-city {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.setlist-date-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.18);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.setlist-arrow { color: var(--text-dim); flex-shrink: 0; }
.setlist-arrow svg { width: 14px; height: 14px; }

.empty-setlists {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── Pagination ── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 10px 20px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 150ms ease;
}
.page-btn svg { width: 16px; height: 16px; }
.page-btn:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 16px var(--accent-glow);
}
.page-btn:disabled {
  opacity: 0.25;
  pointer-events: none;
}
.page-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

/* ── Setlist Detail ── */
.setlist-header-info { flex: 1; min-width: 0; }
.setlist-venue {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.setlist-date {
  font-size: 12px;
  color: var(--accent);
  margin-top: 2px;
}

.song-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 4px;
}

.set-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 8px 4px 6px;
}

.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  margin-bottom: 3px;
  transition: all 150ms ease;
  min-height: 48px;
}
.song-item:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 14px var(--accent-glow);
  background: var(--surface-hover);
}
.song-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}
.song-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.song-cover-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
  background: rgba(0,230,118,0.08);
  border: 1px solid rgba(0,230,118,0.2);
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}
.song-tape-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 2px 4px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.setlist-footer {
  padding: 10px 20px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.song-count {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* ── Keyboard Overlay ── */
.overlay {
  position: absolute;
  top: 0; left: 0;
  width: 600px;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  z-index: 100;
  backdrop-filter: blur(8px);
}
.overlay.hidden { display: none; }

.keyboard-container {
  width: 560px;
  background: rgba(15,15,15,0.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.kb-display {
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 12px;
}
.kb-cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

.kb-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.kb-row {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.kb-key {
  width: 46px;
  height: 40px;
  border-radius: 7px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 120ms ease;
  flex-shrink: 0;
}
.kb-key:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 14px var(--accent-glow);
  background: rgba(0,212,255,0.12);
}

.kb-actions {
  display: flex;
  gap: 6px;
}
.kb-action-btn {
  height: 40px;
  border-radius: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
  transition: all 120ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kb-action-btn:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 14px var(--accent-glow);
}
.kb-space { flex: 1; }
.kb-submit {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}
.kb-submit:focus {
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ── Loading Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
