/* AI Tools Directory — API Documentation Shared Styles */
:root {
  --bg: #0f1117;
  --bg-card: #161b27;
  --bg-code: #1a1f2e;
  --bg-sidebar: #0d1018;
  --border: #252d3d;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --text-dim: #4a5568;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --green: #10b981;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --red: #ef4444;
  --purple: #a855f7;
  --cyan: #06b6d4;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  --sidebar-w: 280px;
  --header-h: 60px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px;
  gap: 16px;
}
.site-header .logo { font-size: 18px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.site-header .logo span { color: var(--accent); }
.site-header .version { background: var(--bg-code); border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; padding: 2px 8px; border-radius: 4px; font-family: var(--font-mono); }
.site-header nav { margin-left: auto; display: flex; gap: 6px; }
.site-header nav a { color: var(--text-muted); font-size: 13px; padding: 6px 12px; border-radius: 6px; transition: all .15s; }
.site-header nav a:hover, .site-header nav a.active { color: var(--text); background: var(--border); text-decoration: none; }

/* ── Layout ─────────────────────────────────────────────── */
.layout { display: flex; margin-top: var(--header-h); min-height: calc(100vh - var(--header-h)); }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 20px 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section { margin-bottom: 8px; }
.sidebar-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  color: var(--text-dim); text-transform: uppercase;
  padding: 8px 20px 4px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 20px; font-size: 13px;
  color: var(--text-muted); cursor: pointer;
  transition: all .15s; border-left: 2px solid transparent;
  text-decoration: none;
}
.sidebar-item:hover { color: var(--text); background: rgba(99,102,241,.06); text-decoration: none; }
.sidebar-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(99,102,241,.08); }
.sidebar-item .method { font-size: 10px; font-family: var(--font-mono); font-weight: 700; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.sidebar-item .endpoint-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Main Content ───────────────────────────────────────── */
.main { flex: 1; min-width: 0; padding: 40px 48px 80px; max-width: 860px; }

/* ── Page Header ────────────────────────────────────────── */
.page-header { margin-bottom: 40px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.page-header p { color: var(--text-muted); font-size: 15px; line-height: 1.7; max-width: 640px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-dim); }

/* ── Endpoint Card ──────────────────────────────────────── */
.endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 24px;
  overflow: hidden;
}
.endpoint-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; cursor: pointer;
  transition: background .15s;
  user-select: none;
}
.endpoint-header:hover { background: rgba(255,255,255,.02); }
.endpoint-header h3 { font-size: 15px; font-weight: 600; flex: 1; }
.endpoint-header .badge-auth { font-size: 10px; font-family: var(--font-mono); padding: 2px 7px; border-radius: 3px; background: rgba(168,85,247,.15); color: #a855f7; border: 1px solid rgba(168,85,247,.25); flex-shrink: 0; }
.endpoint-header .badge-admin { background: rgba(245,158,11,.12); color: var(--orange); border: 1px solid rgba(245,158,11,.25); }
.endpoint-header .chevron { color: var(--text-dim); transition: transform .2s; flex-shrink: 0; font-size: 12px; }
.endpoint.open .endpoint-header .chevron { transform: rotate(90deg); }

.endpoint-body { display: none; padding: 0 20px 20px; border-top: 1px solid var(--border); }
.endpoint.open .endpoint-body { display: block; }

.route-line {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px 16px;
  margin: 16px 0 20px;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ── Method Badges ──────────────────────────────────────── */
.method { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; letter-spacing: .03em; flex-shrink: 0; min-width: 52px; }
.GET    { background: rgba(16,185,129,.15); color: var(--green);  border: 1px solid rgba(16,185,129,.3); }
.POST   { background: rgba(59,130,246,.15); color: var(--blue);   border: 1px solid rgba(59,130,246,.3); }
.PUT    { background: rgba(245,158,11,.15); color: var(--orange); border: 1px solid rgba(245,158,11,.3); }
.PATCH  { background: rgba(245,158,11,.12); color: #fb923c;       border: 1px solid rgba(245,158,11,.25); }
.DELETE { background: rgba(239,68,68,.12);  color: var(--red);    border: 1px solid rgba(239,68,68,.25); }

/* ── Sections inside endpoint body ─────────────────────── */
.section-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; margin-top: 20px; }
.section-title:first-child { margin-top: 0; }

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

/* ── Parameter Table ────────────────────────────────────── */
.param-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.param-table th { text-align: left; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); padding: 6px 10px; border-bottom: 1px solid var(--border); font-weight: 600; }
.param-table td { padding: 8px 10px; border-bottom: 1px solid rgba(37,45,61,.5); vertical-align: top; color: var(--text-muted); }
.param-table tr:last-child td { border-bottom: none; }
.param-table td:first-child { font-family: var(--font-mono); font-size: 12px; color: var(--cyan); }
.param-table td:nth-child(2) { color: var(--purple); font-size: 12px; font-family: var(--font-mono); }
.param-table .req { color: var(--red); font-size: 10px; }
.param-table .opt { color: var(--text-dim); font-size: 10px; }

/* ── Code Block ─────────────────────────────────────────── */
.code-block { background: var(--bg-code); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; margin-bottom: 12px; }
.code-block-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.code-block-header .lang { font-size: 11px; font-family: var(--font-mono); color: var(--text-dim); }
.code-block-header .copy-btn { font-size: 11px; color: var(--text-dim); background: none; border: none; cursor: pointer; padding: 2px 6px; border-radius: 3px; transition: .15s; }
.code-block-header .copy-btn:hover { color: var(--text); background: var(--border); }
.code-block pre { padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; }
.code-block pre::-webkit-scrollbar { height: 4px; }
.code-block pre::-webkit-scrollbar-track { background: transparent; }
.code-block pre::-webkit-scrollbar-thumb { background: var(--border); }

/* JSON syntax highlighting */
.s { color: #a3e635; }  /* string value */
.k { color: var(--cyan); }   /* key */
.n { color: #fb923c; }  /* number */
.b { color: #818cf8; }  /* boolean / null */
.c { color: var(--text-dim); font-style: italic; } /* comment */

/* ── Response badges ────────────────────────────────────── */
.res-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.res-tab { font-size: 12px; padding: 5px 12px; border-radius: 5px; border: 1px solid var(--border); color: var(--text-muted); background: var(--bg-code); cursor: pointer; font-family: var(--font-mono); transition: .15s; }
.res-tab.s2 { color: var(--green); border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.06); }
.res-tab.s4 { color: var(--red); border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.06); }

/* ── Alert / Note boxes ─────────────────────────────────── */
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 7px; font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; }
.note.info { background: rgba(59,130,246,.08); border-left: 3px solid var(--blue); }
.note.warn { background: rgba(245,158,11,.08); border-left: 3px solid var(--orange); }
.note.danger { background: rgba(239,68,68,.08); border-left: 3px solid var(--red); }
.note-icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }

/* ── Section divider ────────────────────────────────────── */
.section-heading { font-size: 20px; font-weight: 700; margin: 40px 0 16px; display: flex; align-items: center; gap: 10px; }
.section-heading::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Index page cards ───────────────────────────────────── */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.module-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 22px; transition: border-color .2s, transform .15s; cursor: pointer; }
.module-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.module-card .card-icon { font-size: 28px; margin-bottom: 12px; }
.module-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.module-card p { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin-bottom: 14px; }
.module-card .card-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.module-card .tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--bg-code); border: 1px solid var(--border); color: var(--text-dim); font-family: var(--font-mono); }

/* ── Base URL box ───────────────────────────────────────── */
.base-url-box { background: var(--bg-code); border: 1px solid var(--border); border-radius: 7px; padding: 12px 16px; font-family: var(--font-mono); font-size: 13px; margin-bottom: 32px; display: flex; align-items: center; gap: 12px; }
.base-url-box .label { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.base-url-box .url { color: var(--cyan); }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { padding: 24px 20px 60px; }
  .module-grid { grid-template-columns: 1fr; }
}
