/* ============================================================
   Claude Code Docs — Shared Base Styles
   All pages link this file. Page-specific CSS stays inline.
   ============================================================ */

/* ===== RESET & ROOT ===== */
:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #252838;
  --border: #2e3150;
  --accent: #6c63ff;
  --accent2: #ff6584;
  --accent3: #43e97b;
  --accent4: #f7971e;
  --text: #e2e8f0;
  --text2: #a0aec0;
  --text3: #718096;
  --code-bg: #1e2130;
  --sidebar-w: 280px;
  --warn: #ff9800;
  --danger: #f44336;
  --ok: #4caf50;
  --info: #2196f3;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 16px;
}
.header-logo {
  font-size: 1.3rem; font-weight: 700; color: var(--accent);
  text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.header-logo span { font-size: 1.5rem; }
.header-subtitle { color: var(--text2); font-size: 0.875rem; }
.header-spacer { flex: 1; }
.header-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white; padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
}
.header-breadcrumb { color: var(--text3); font-size: 0.875rem; }
.header-breadcrumb a { color: var(--accent); text-decoration: none; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 60px; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--bg2); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 16px 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: var(--bg2); }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section { margin-bottom: 8px; }
.nav-section-title {
  padding: 6px 20px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text3);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: var(--text2); text-decoration: none;
  font-size: 0.875rem; border-left: 3px solid transparent;
  transition: all 0.15s; cursor: pointer;
}
.nav-item:hover { background: var(--bg3); color: var(--text); border-left-color: var(--accent); }
.nav-item.active { background: rgba(108,99,255,0.1); color: var(--accent); border-left-color: var(--accent); }
.nav-item .icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-item .badge {
  margin-left: auto; background: var(--accent); color: white;
  font-size: 0.65rem; padding: 2px 6px; border-radius: 10px; font-weight: 600;
}
.nav-item .badge.new { background: var(--accent3); color: #000; }

/* ===== MAIN CONTENT ===== */
.main {
  margin-left: var(--sidebar-w); margin-top: 60px;
  padding: 32px 40px; max-width: 1200px;
}

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
h1 span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-desc { color: var(--text2); font-size: 1.05rem; margin-bottom: 32px; line-height: 1.6; }

h2 {
  font-size: 1.3rem; font-weight: 700; margin: 36px 0 16px;
  padding-top: 8px; display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--border);
}
h2:first-of-type { border-top: none; }
h3 { font-size: 1rem; font-weight: 600; margin: 20px 0 10px; color: var(--text2); }
h4 { font-size: 0.9rem; font-weight: 600; margin: 14px 0 8px; color: var(--text3); }

p { color: var(--text2); line-height: 1.7; margin-bottom: 12px; }

ul, ol { color: var(--text2); padding-left: 20px; margin-bottom: 12px; }
li { line-height: 1.7; margin-bottom: 4px; }

a { color: var(--accent); }

.section-title {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== INLINE CODE ===== */
code {
  background: var(--code-bg); color: #a6e22e;
  padding: 2px 6px; border-radius: 4px;
  font-family: 'Cascadia Code', monospace; font-size: 0.85em;
}

/* ===== CODE BLOCKS ===== */
.code-block {
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.83rem; color: #e2e8f0; overflow-x: auto;
  margin: 12px 0; line-height: 1.6;
}
.code-block::-webkit-scrollbar { height: 4px; }
.code-block::-webkit-scrollbar-track { background: var(--code-bg); }
.code-block::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Syntax token colors (used in code-block spans) */
.code-block .c  { color: #6a737d; font-style: italic; }  /* comment */
.code-block .s  { color: #e6db74; }  /* string */
.code-block .k  { color: #66d9ef; }  /* keyword */
.code-block .g  { color: #a6e22e; }  /* green/key */
.code-block .r  { color: #f92672; }  /* red */
.code-block .n  { color: #ae81ff; }  /* number/purple */
.code-block .fn { color: #a6e22e; }  /* function */
/* Older class names for backward compat */
.code-block .comment { color: #6a737d; }
.code-block .string  { color: #e6db74; }
.code-block .keyword { color: #66d9ef; }

/* ===== ALERTS ===== */
.alert {
  border-radius: 8px; padding: 14px 18px; margin: 16px 0;
  border-left: 4px solid; display: flex; gap: 12px;
}
.alert-icon { font-size: 1.2rem; flex-shrink: 0; }
.alert-body { font-size: 0.875rem; line-height: 1.6; }
.alert-body strong { display: block; margin-bottom: 4px; }
.alert.warn   { background: rgba(255,152,0,0.08);  border-color: var(--warn); }
.alert.danger { background: rgba(244,67,54,0.08);  border-color: var(--danger); }
.alert.ok     { background: rgba(76,175,80,0.08);  border-color: var(--ok); }
.alert.info   { background: rgba(33,150,243,0.08); border-color: var(--info); }

/* ===== TABLES ===== */
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.875rem; }
th {
  text-align: left; padding: 10px 14px; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text3); border-bottom: 2px solid var(--border);
}
td { padding: 10px 14px; border-bottom: 1px solid rgba(46,49,80,0.6); vertical-align: top; color: var(--text2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ===== CARDS ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 40px; }

.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; text-decoration: none; color: inherit;
  transition: all 0.2s; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(108,99,255,0.15); }
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--card-color, var(--accent)), transparent);
}
.card-icon { font-size: 2rem; }
.card-title { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-desc { color: var(--text2); font-size: 0.875rem; line-height: 1.6; flex: 1; }
.card-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.card-topic { background: var(--bg3); color: var(--text2); padding: 3px 8px; border-radius: 6px; font-size: 0.72rem; }
.card-arrow { color: var(--text3); font-size: 0.8rem; align-self: flex-end; margin-top: 4px; }

/* ===== FOOTER ===== */
.footer {
  margin-left: var(--sidebar-w); padding: 20px 40px;
  border-top: 1px solid var(--border); color: var(--text3);
  font-size: 0.8rem; display: flex; justify-content: space-between;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main, .footer { margin-left: 0; padding: 20px; }
}
