/* ════════════════════════════════════════════════════════════
   Guitarlingo · shared.css · V1.1
   Dark-first. System fonts only. No external font dependencies.
   Three card types. Four type scales. Gold is signal only.
   ════════════════════════════════════════════════════════════ */

/* ── SECTION INDEX ──────────────────────────────────────────
   1.  CSS Variables
   2.  Reset
   3.  Base
   4.  Type Scale
   5.  Header & Nav
   6.  Main Layout
   7.  Card System
   8.  Buttons
   9.  Forms
  10.  Badges & Pills
  11.  Progress Bar
  12.  Spinner · Divider · Empty State
  13.  Toast
  14.  Modal
  15.  Scrollbar
  16.  Lesson Content
  17.  SVG Fretboard Variables
  18.  Responsive
   ──────────────────────────────────────────────────────────── */


/* ════════════════════════════════════════════════════════════
   1. CSS VARIABLES
   ════════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:           #0c0c0d;
  --surface:      #161618;
  --surface2:     #1e1e21;
  --surface3:     #242428;

  /* Borders */
  --border:       #2a2a2f;
  --border-light: #333338;

  /* Guitar / fretboard */
  --wood:         #181310;
  --nut:          #8a7a5a;
  --string:       #b8a870;

  /* Signal colours — data only, never surfaces */
  --accent:       #e8a020;
  --accent-dim:   #3a2e14;
  --accent-light: #f0b840;
  --green:        #2a7a3b;
  --green-bright: #3cb054;
  --red:          #c0392b;
  --amber:        #d97706;

  /* Text hierarchy */
  --text-1:       #dddde0;
  --text-2:       #a0a0a8;
  --text-3:       #58585f;
  --text-4:       #3a3a40;

  /* Fretboard note colours */
  --root:         #e8a020;
  --tone:         #e8e8e8;

  /* XP / streak */
  --xp-green:     #2a7a3b;

  /* Radius */
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;

  /* Fonts — system only, no external dependencies */
  --font-ui:      -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* Layout */
  --header-h:     52px;
  --nav-h:        60px;
}


/* ════════════════════════════════════════════════════════════
   2. RESET
   ════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html { font-size: 16px; -webkit-text-size-adjust: 100%; }


/* ════════════════════════════════════════════════════════════
   3. BASE
   ════════════════════════════════════════════════════════════ */
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-weight: 400;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}


/* ════════════════════════════════════════════════════════════
   4. TYPE SCALE
   Display · Title · Label · Body — four scales only.
   ════════════════════════════════════════════════════════════ */

/* Display — Syne 800. Wordmark, lesson titles. One per screen. */
.type-display {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* Title — DM Sans 700, 16–18px. Section headers. */
.type-title {
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.1px;
  line-height: 1.3;
}

/* Label — DM Sans 600, 10–11px, uppercase, gold. Card headers. */
.type-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  line-height: 1;
}

/* Body — DM Sans 400, 13–14px. All content text. */
.type-body {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.65;
}

.type-mono {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-1);
}


/* ════════════════════════════════════════════════════════════
   5. HEADER & NAV
   ════════════════════════════════════════════════════════════ */
header {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
}

.logo-wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-sub {
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Bottom tab nav */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-3);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.15s;
  position: relative;
}

.nav-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s;
}

.nav-tab.active { color: var(--accent); }
.nav-tab.active::before { transform: scaleX(1); }

.nav-tab-icon { font-size: 20px; line-height: 1; }


/* ════════════════════════════════════════════════════════════
   6. MAIN LAYOUT
   ════════════════════════════════════════════════════════════ */
main {
  padding: 20px 16px calc(var(--nav-h) + 20px);
  max-width: 720px;
  margin: 0 auto;
}

.page-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.page-sub {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-ui);
  letter-spacing: 0.06em;
}


/* ════════════════════════════════════════════════════════════
   7. CARD SYSTEM — Three types only.
   ════════════════════════════════════════════════════════════ */

/* PRIMARY — Today's lesson, streak, key callouts.
   2px gold left border · surface bg */
.card-primary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

/* DATA — Lesson rows, progress stats, reference items.
   1px border all sides · surface bg · compact */
.card-data {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* SURFACE — Instructions, tips, supporting context.
   surface2 bg · no border */
.card-surface {
  background: var(--surface2);
  border-radius: var(--radius);
}

/* Card padding utilities */
.card-body  { padding: 16px; }
.card-body-lg { padding: 20px; }

/* Card header band */
.card-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-header-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}


/* ════════════════════════════════════════════════════════════
   8. BUTTONS
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Primary — gold fill */
.btn-primary {
  background: var(--accent);
  color: #0c0c0d;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-light); }

/* Secondary — bordered */
.btn-secondary {
  background: var(--surface2);
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Ghost */
.btn-ghost {
  background: none;
  color: var(--text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover:not(:disabled) { color: var(--text-1); background: var(--surface2); }

/* ════════════════════════════════════════════════════════════
   9. FORMS
   ════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  font-family: var(--font-ui);
}

.form-input, .form-select {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-3); }


/* ════════════════════════════════════════════════════════════
   10. BADGES & PILLS
   ════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-ui);
  letter-spacing: 0.04em;
}

.badge-gold    { background: var(--accent-dim);          color: var(--accent); }
.badge-green   { background: rgba(42,122,59,0.15);       color: var(--green-bright); }
.badge-red     { background: rgba(192,57,43,0.12);       color: var(--red); }
.badge-neutral { background: var(--surface2);            color: var(--text-3); }

/* Chapter pill */
.chapter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ════════════════════════════════════════════════════════════
   11. PROGRESS BAR
   ════════════════════════════════════════════════════════════ */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  height: 5px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.progress-bar-fill.green { background: var(--green-bright); }


/* ════════════════════════════════════════════════════════════
   12. SPINNER · DIVIDER · EMPTY STATE
   ════════════════════════════════════════════════════════════ */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px; gap: 10px; text-align: center;
}
.empty-icon  { font-size: 32px; opacity: 0.3; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.empty-sub   { font-size: 12px; color: var(--text-3); max-width: 260px; line-height: 1.6; }


/* ════════════════════════════════════════════════════════════
   13. TOAST
   ════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: calc(var(--nav-h) + 12px); right: 16px;
  z-index: 999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; max-width: calc(100vw - 32px);
}
.toast {
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  max-width: 300px;
  animation: toastIn 0.2s ease;
  font-family: var(--font-ui);
  pointer-events: all;
  border: 1px solid transparent;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast-success { background: rgba(42,122,59,0.15);  color: var(--green-bright); border-color: rgba(42,122,59,0.3); }
.toast-error   { background: rgba(192,57,43,0.12);  color: var(--red);          border-color: rgba(192,57,43,0.3); }
.toast-info    { background: var(--accent-dim);      color: var(--accent);       border-color: rgba(232,160,32,0.3); }


/* ════════════════════════════════════════════════════════════
   14. MODAL
   ════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.7);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  border-radius: var(--radius-lg); padding: 24px;
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  position: relative; max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.2s cubic-bezier(0.16,1,0.3,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.modal-sub   { font-size: 12px; color: var(--text-3); margin-bottom: 20px; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--text-3);
  cursor: pointer; font-size: 18px; padding: 4px 8px;
  border-radius: 4px; transition: all 0.15s;
}
.modal-close:hover { color: var(--text-1); background: var(--surface2); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }


/* ════════════════════════════════════════════════════════════
   15. SCROLLBAR
   ════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }


/* ════════════════════════════════════════════════════════════
   16. LESSON CONTENT
   ════════════════════════════════════════════════════════════ */
.lesson-content { line-height: 1.7; }
.lesson-content h3 {
  font-size: 14px; font-weight: 700;
  color: var(--accent); margin: 20px 0 8px;
  text-transform: uppercase; letter-spacing: 0.06em;
  font-family: var(--font-ui);
}
.lesson-content p  { font-size: 14px; color: var(--text-2); margin: 0 0 12px; }
.lesson-content ul { padding-left: 18px; margin: 0 0 12px; }
.lesson-content li { font-size: 14px; color: var(--text-2); margin-bottom: 5px; }
.lesson-content strong { color: var(--text-1); font-weight: 600; }

.callout {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.6;
}
.callout-gold  { background: var(--accent-dim); border-left: 3px solid var(--accent); color: var(--text-2); }
.callout-green { background: rgba(42,122,59,0.1); border-left: 3px solid var(--green-bright); color: var(--text-2); }

/* Block timing pill */
.block-timing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
}


/* ════════════════════════════════════════════════════════════
   17. SVG FRETBOARD VARIABLES
   ════════════════════════════════════════════════════════════ */
:root {
  --svg-wood:   #181310;
  --svg-fret:   #2a2318;
  --svg-string: #b8a870;
  --svg-nut:    #8a7a5a;
  --svg-root:   #e8a020;
  --svg-tone:   #e8e8e8;
  --svg-dot:    #4a3e28;
  --svg-bg:     #161618;
}


/* ════════════════════════════════════════════════════════════
   18. RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  main { padding: 16px 12px calc(var(--nav-h) + 16px); }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-card { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-width: 100%; max-height: 88vh; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; justify-content: center; padding: 13px; }
  #toast-container { left: 12px; right: 12px; max-width: none; }
  .toast { max-width: 100%; }
}
