/* ══════════════════════════════════════════════════════════════
   DrawChord shared site styles — used by index.html, showchord.html,
   findchord.html, about.html. Keep visual language consistent across
   pages by editing here rather than duplicating rules per-page.
   ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #252836;
  --surface3: #2f3347;
  --accent: #7c6af7;
  --accent2: #a78bfa;
  --danger: #f87171;
  --success: #34d399;
  --text: #e8eaf6;
  --text-muted: #8b8fa8;
  --border: #2f3347;
  --radius: 10px;
}
/* ── Light theme overrides ── */
[data-theme="light"] {
  --bg: #f0f2f8;
  --surface: #ffffff;
  --surface2: #eef0f7;
  --surface3: #e3e6f1;
  --text: #1e2040;
  --text-muted: #585e80;
  --border: #d5d9ec;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header + nav ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 13px 24px;
  display: flex; align-items: center; gap: 14px;
}
.logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #7c6af7, #a78bfa);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
h1 {
  font-size: 1.65rem; font-weight: 800; letter-spacing: -0.04em;
  background: linear-gradient(130deg, #a78bfa, #7c6af7 60%, #60a5fa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tagline { color: var(--text-muted); font-size: 0.8rem; margin-top: 1px; }

.top-nav {
  margin-left: auto;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.top-nav a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.85rem; font-weight: 600;
  padding: 8px 14px; border-radius: 8px;
  transition: all 0.13s;
}
.top-nav a:hover { background: var(--surface2); color: var(--text); }
.top-nav a.active { background: var(--accent); color: white; }

/* ── Layout ── */
.app {
  display: flex; gap: 18px; padding: 18px;
  max-width: 1140px; margin: 0 auto;
  align-items: flex-start;
}
.page {
  max-width: 900px; margin: 0 auto;
  padding: 32px 24px 60px;
}
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
}
.editor-panel { flex: 1; min-width: 0; }
.preview-panel { width: 288px; flex-shrink: 0; }

/* ── Typography helpers ── */
.section-label {
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); margin-bottom: 9px;
}
.hint {
  font-size: 0.71rem; color: var(--text-muted);
  font-weight: 400; text-transform: none; letter-spacing: 0;
}
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.fl { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; }

/* ── Inputs ── */
input[type="text"], input[type="number"], select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px; color: var(--text);
  padding: 7px 10px; font-size: 0.875rem; outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus { border-color: var(--accent); }
input.title-input { font-size: 1rem; width: 100%; margin-bottom: 14px; }
input[type="range"] { accent-color: var(--accent); flex: 1; cursor: pointer; min-width: 0; }
select { cursor: pointer; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 14px; border-radius: 8px; border: none;
  cursor: pointer; font-size: 0.835rem; font-weight: 600;
  transition: all 0.13s; white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn-ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface3); }
.copy-btn {
  width: 100%;
  background: linear-gradient(135deg, #7c6af7, #a78bfa);
  color: white; padding: 10px;
}
.copy-btn:hover { filter: brightness(1.1); }
.copy-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

/* ── Toggle group ── */
.toggle-group { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.toggle-btn {
  flex: 1;
  padding: 6px 13px; background: transparent; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 0.8rem; font-weight: 600;
  text-align: center; white-space: nowrap;
  transition: all 0.12s;
}
.toggle-btn.active { background: var(--accent); color: white; }
.toggle-btn:hover:not(.active) { background: var(--surface2); color: var(--text); }

/* ── Preview surface (white chord-diagram background) ── */
.chord-surface {
  background: white; border-radius: 10px; padding: 10px;
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; width: 100%;
}
.chord-surface svg { display: block; max-width: 100%; height: auto; }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--success); color: #0f1117;
  padding: 9px 22px; border-radius: 100px;
  font-size: 0.875rem; font-weight: 700;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  transition: transform 0.28s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none; z-index: 9999;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Copyright footer ── */
.copyright {
  position: fixed; bottom: 10px; right: 14px;
  font-size: 0.72rem; color: var(--text-muted); pointer-events: none;
}

/* ── Theme toggle ── */
.theme-toggle {
  position: fixed; bottom: 10px; left: 14px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 100px;
  padding: 5px 11px; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s, color 0.15s; z-index: 100;
}
.theme-toggle:hover { background: var(--surface3); color: var(--text); }

/* ── Prose content (About page etc.) ── */
.prose h2 { font-size: 1.15rem; margin: 28px 0 10px; color: var(--text); }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--text-muted); line-height: 1.65; margin-bottom: 12px; font-size: 0.92rem; }
.prose ul { margin: 0 0 12px 20px; color: var(--text-muted); line-height: 1.65; font-size: 0.92rem; }
.prose li { margin-bottom: 4px; }
.prose strong { color: var(--text); }
.prose a { color: var(--accent2); }
.prose a:hover { color: var(--accent); }

@media (max-width: 760px) {
  .app { flex-direction: column; padding: 10px; gap: 12px; }
  .preview-panel { width: 100%; }
  header { flex-wrap: wrap; }
  .top-nav { margin-left: 0; width: 100%; }
}
