/* HAPPA Developer Docs */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #161616;
  --surface: #141414;
  --border: #1f1f1f;
  --border2: #262626;
  --text: #ffffff;
  --text2: #a3a3a3;
  --text3: #525252;
  --accent: #e53e3e;
  --accent-dim: rgba(229,62,62,0.12);
  --green: #22c55e;
  --blue: #3b82f6;
  --yellow: #eab308;
  --radius: 10px;
  --sidebar-w: 240px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 5%;
  background: rgba(10,10,10,0.9); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Sora', sans-serif; font-size: 1.3rem; font-weight: 800;
  color: var(--accent); text-decoration: none; letter-spacing: -0.5px;
}
.nav-links-wrap { display: flex; gap: 28px; }
.nav-links-wrap a {
  color: var(--text2); text-decoration: none; font-size: 0.875rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links-wrap a:hover, .nav-links-wrap a.active { color: var(--text); }
.nav-cta {
  background: var(--accent); color: #fff; padding: 8px 18px; border-radius: 8px;
  font-size: 0.875rem; font-weight: 600; text-decoration: none;
  transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.85; }

/* LAYOUT */
.docs-layout {
  display: flex;
  padding-top: 60px;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  border-right: 1px solid var(--border);
  padding: 32px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar-section { margin-bottom: 28px; padding: 0 20px; }
.sidebar-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3); margin-bottom: 10px;
}
.sidebar-link {
  display: block; padding: 6px 10px; border-radius: 6px;
  color: var(--text2); text-decoration: none; font-size: 0.875rem;
  transition: color 0.15s, background 0.15s; margin-bottom: 2px;
}
.sidebar-link:hover { color: var(--text); background: var(--bg3); }
.sidebar-link.active { color: var(--accent); background: var(--accent-dim); font-weight: 600; }

/* MAIN */
.docs-main {
  flex: 1;
  padding: 40px 56px;
  max-width: 860px;
}
.breadcrumb {
  font-size: 0.75rem; color: var(--text3); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: 0.8px;
}
h1 {
  font-family: 'Sora', sans-serif; font-size: 2.2rem; font-weight: 800;
  color: var(--text); margin-bottom: 16px; line-height: 1.2; letter-spacing: -0.5px;
}
h2 {
  font-size: 1.2rem; font-weight: 700; color: var(--text);
  margin-top: 48px; margin-bottom: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin-top: 28px; margin-bottom: 10px; }
p { color: var(--text2); margin-bottom: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.lead { font-size: 1.05rem; color: var(--text2); margin-bottom: 32px; }
ul, ol { color: var(--text2); padding-left: 24px; margin-bottom: 16px; }
li { margin-bottom: 6px; }

/* CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 28px 0 40px; }
.card {
  display: block; padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg2);
  text-decoration: none; transition: border-color 0.2s, background 0.2s;
}
.card:hover { border-color: var(--accent); background: var(--bg3); text-decoration: none; }
.card-primary { border-color: rgba(229,62,62,0.3); background: rgba(229,62,62,0.06); }
.card-icon { font-size: 1.5rem; margin-bottom: 10px; color: var(--accent); display: block; }
.card-title { font-weight: 700; color: var(--text); margin-bottom: 6px; }
.card-desc { font-size: 0.875rem; color: var(--text2); }

/* CODE */
code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
  background: var(--bg3); color: #e2b96f;
  padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
}
pre {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; overflow-x: auto;
  margin: 16px 0 24px; position: relative;
}
pre code {
  background: none; border: none; padding: 0; color: #e8e8e8;
  font-size: 0.875rem; line-height: 1.7;
}
.copy-btn {
  position: absolute; top: 10px; right: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text3); border-radius: 5px; padding: 4px 10px;
  font-size: 0.7rem; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: color 0.2s;
}
.copy-btn:hover { color: var(--text); }

/* TABLES */
.table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 0.875rem; }
.table th {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border2);
  color: var(--text3); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.6px;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text2); }
.table tr:last-child td { border-bottom: none; }
.table code { font-size: 0.8rem; }

/* CALLOUTS */
.callout {
  border-radius: var(--radius); padding: 16px 20px; margin: 24px 0;
  border-left: 3px solid;
}
.callout-info { background: rgba(59,130,246,0.08); border-color: var(--blue); }
.callout-warn { background: rgba(234,179,8,0.08); border-color: var(--yellow); }
.callout-success { background: rgba(34,197,94,0.08); border-color: var(--green); }
.callout p { margin-bottom: 0; color: var(--text2); }
.callout strong { color: var(--text); }

/* STEPS */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step; padding: 14px 14px 14px 52px; position: relative;
  border-left: 2px solid var(--border2); margin-left: 14px; margin-bottom: 4px;
  color: var(--text2);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: -14px; top: 12px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* BADGE */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 100px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-yellow { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-red { background: rgba(229,62,62,0.15); color: var(--accent); }

/* FOOTER */
footer {
  border-top: 1px solid var(--border); padding: 24px 5%;
  text-align: center; color: var(--text3); font-size: 0.875rem;
}
footer a { color: var(--text3); text-decoration: none; }
footer a:hover { color: var(--text2); }

/* COPY SCRIPT */
@media (max-width: 768px) {
  .docs-layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: unset; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .docs-main { padding: 24px 20px; }
  .cards-grid { grid-template-columns: 1fr; }
  .nav-links-wrap { display: none; }
}
