@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #0f0f11;
  --surface: #18181c;
  --surface2: #222228;
  --border: #2e2e38;
  --accent: #cc785c;
  --accent2: #e8a87c;
  --accent-glow: rgba(204, 120, 92, 0.18);
  --text: #f0ede8;
  --text-muted: #8c8a87;
  --text-dim: #5a5855;
  --tag-bg: #2a2028;
  --tag-text: #cc785c;
  --green: #5cb88a;
  --blue: #5b8dee;
  --purple: #9b72cf;
  --gold: #d4a843;
}

/* Base resets & Print optimization */
body {
  background-color: var(--bg);
  color: var(--text);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  scroll-behavior: smooth;
}

@media print {
  .no-print {
    display: none !important;
  }
  .page-break {
    page-break-after: always;
  }
}

/* Custom Gradients & Text Effects */
.text-gradient {
  background: linear-gradient(135deg, #f0ede8 0%, #cc785c 50%, #e8a87c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Notion-style grid background for cover */
.grid-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ── LEGACY COMPONENT FALLBACKS ── */
.chapter-divider {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 40vh;
  padding: 80px 60px;
  page-break-before: always;
  page-break-after: always;
  max-width: 900px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.chapter-divider .chapter-num {
  font-size: 80px;
  font-weight: 900;
  font-family: "JetBrains Mono", monospace;
  color: var(--surface2);
  line-height: 1;
  margin-bottom: 8px;
}

.chapter-divider h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
}

.chapter-divider p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 480px;
}

.tricks-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 60px 80px;
}

.trick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  margin-bottom: 28px;
  page-break-inside: avoid;
  position: relative;
  overflow: hidden;
}

.trick-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), transparent);
  border-radius: 3px 0 0 3px;
}

.trick-card.blue::before { background: linear-gradient(180deg, var(--blue), transparent); }
.trick-card.green::before { background: linear-gradient(180deg, var(--green), transparent); }
.trick-card.purple::before { background: linear-gradient(180deg, var(--purple), transparent); }
.trick-card.gold::before { background: linear-gradient(180deg, var(--gold), transparent); }

.trick-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.trick-num {
  font-size: 11px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
  margin-top: 3px;
}

.trick-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
}

.summary-card {
  background: rgba(204, 120, 92, 0.08);
  border: 1px solid rgba(204, 120, 92, 0.2);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent2);
}

.summary-card.blue { background: rgba(91, 141, 238, 0.08); border-color: rgba(91, 141, 238, 0.2); color: #7aaef5; }
.summary-card.green { background: rgba(92, 184, 138, 0.08); border-color: rgba(92, 184, 138, 0.2); color: #7ccfa4; }
.summary-card.purple { background: rgba(155, 114, 207, 0.08); border-color: rgba(155, 114, 207, 0.2); color: #b48ee0; }
.summary-card.gold { background: rgba(212, 168, 67, 0.08); border-color: rgba(212, 168, 67, 0.2); color: #e0c06a; }

.deep-dive h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
  margin-top: 20px;
}

.deep-dive p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

.prompt-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: #b0c4e8;
  line-height: 1.7;
  position: relative;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.prompt-label {
  position: absolute;
  top: -1px;
  right: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 2px 10px;
}

.pro-tip {
  display: flex;
  gap: 12px;
  background: rgba(212, 168, 67, 0.06);
  border: 1px solid rgba(212, 168, 67, 0.18);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 16px;
  font-size: 13px;
  color: #c9b068;
}

.use-cases { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.use-case { font-size: 12px; color: var(--text-muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 12px; }

.tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid rgba(204, 120, 92, 0.2);
  margin-right: 6px;
}

.tag.blue { color: var(--blue); background: rgba(91, 141, 238, 0.08); border-color: rgba(91, 141, 238, 0.2); }
.tag.green { color: var(--green); background: rgba(92, 184, 138, 0.08); border-color: rgba(92, 184, 138, 0.2); }
.tag.purple { color: var(--purple); background: rgba(155, 114, 207, 0.08); border-color: rgba(155, 114, 207, 0.2); }
.tag.gold { color: var(--gold); background: rgba(212, 168, 67, 0.08); border-color: rgba(212, 168, 67, 0.2); }
