/* ============================================
   ROOKIE API — Design System
   ============================================ */

:root {
  --bg:           #0d1117;
  --bg-surface:   #161b22;
  --bg-elevated:  #1c2330;
  --border:       #30363d;
  --accent:       #f97316;
  --accent-dark:  #c2510b;
  --accent-glow:  rgba(249,115,22,.18);
  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --text-subtle:  #656d76;
  --green:        #3fb950;
  --blue:         #58a6ff;
  --radius:       10px;
  --radius-lg:    16px;
  --sidebar-w:    260px;
  --topbar-h:     60px;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1,h2,h3,h4,h5,h6 {
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

p { color: var(--text-muted); }

code {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--bg-elevated);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  font-family: var(--font-mono);
  background: #010409;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
  color: #c9d1d9;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ---- Topbar ---- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(13,17,23,.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  gap: 16px;
}

.topbar-logo { display: flex; align-items: center; }
.topbar-logo img { height: 36px; width: auto; }

.topbar-spacer { flex: 1; }

.topbar-nav { display: flex; align-items: center; gap: 4px; }

.topbar-nav .nav-link {
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: color .15s, background .15s;
}
.topbar-nav .nav-link:hover {
  color: var(--text);
  background: var(--bg-surface);
  text-decoration: none;
}
.topbar-nav .nav-link.active { color: var(--text); }

/* hamburger for mobile topbar */
.topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  line-height: 1;
}
.topbar-toggle:hover { background: var(--bg-surface); color: var(--text); }

/* Mobile nav — always hidden until opened on mobile */
.mobile-nav { display: none; }

/* ---- Buttons ---- */
.btn-orange {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-orange:hover { background: var(--accent-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-orange:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 8px 20px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover { color: var(--text); border-color: #6e7681; background: var(--bg-surface); text-decoration: none; }

/* ---- Badge ---- */
.badge-get  { background: rgba(56,139,253,.15); color: #58a6ff; border: 1px solid rgba(56,139,253,.3); font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; letter-spacing: .04em; }

/* ---- Cards ---- */
.card-dark {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color .2s, box-shadow .2s;
}
.card-dark:hover {
  border-color: #6e7681;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

/* ---- Divider ---- */
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-subtle);
}
.site-footer strong { color: var(--text-muted); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #6e7681; }

/* ====================================================
   HOMEPAGE
   ==================================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--topbar-h);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(249,115,22,.12) 0%, transparent 65%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  border: 1px solid rgba(249,115,22,.3);
  border-radius: 99px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-title span { color: var(--accent); }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-image-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-image-wrap img {
  max-width: 420px;
  width: 100%;
  filter: drop-shadow(0 0 60px rgba(249,115,22,.2));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* Feature cards */
.features-section {
  padding: 80px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.feature-icon {
  width: 44px; height: 44px;
  background: var(--accent-glow);
  border: 1px solid rgba(249,115,22,.25);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

/* Stats */
.stats-section { padding: 80px 0; }
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* CTA strip */
.cta-section {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  margin: 0 0 80px;
}

/* ====================================================
   LOGIN
   ==================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--topbar-h) + 24px) 16px 40px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  bottom: -150px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(249,115,22,.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  position: relative;
}

.login-card .logo-wrap {
  display: flex; justify-content: center; margin-bottom: 28px;
}
.login-card .logo-wrap img { width: 120px; }

.login-card h2 {
  font-size: 1.3rem;
  text-align: center;
  margin-bottom: 6px;
}
.login-card .subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-subtle);
  margin-bottom: 28px;
}

.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-field .input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.form-field .input-icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  font-size: 13px;
  pointer-events: none;
}
.form-field input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px 10px 36px;
  font-size: 14px;
  color: var(--text);
  font-family: var(--font);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-field input::placeholder { color: var(--text-subtle); }
.form-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-row-end {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}
.form-row-end a { font-size: 13px; color: var(--text-subtle); }
.form-row-end a:hover { color: var(--accent); text-decoration: none; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  font-size: 12px;
  color: var(--text-subtle);
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.login-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-subtle);
  margin-top: 20px;
}
.login-footer-text a { color: var(--accent); }

/* ====================================================
   SOBRE
   ==================================================== */
.page-header {
  padding: calc(var(--topbar-h) + 48px) 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}
.page-header .breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-subtle);
  margin-bottom: 14px; list-style: none; padding: 0;
}
.page-header .breadcrumb li + li::before { content: '/'; margin-right: 6px; color: var(--border); }
.page-header .breadcrumb a { color: var(--text-subtle); }
.page-header .breadcrumb a:hover { color: var(--text); text-decoration: none; }

.about-body { max-width: 760px; }
.about-body p { font-size: 15px; line-height: 1.8; color: var(--text-muted); margin-bottom: 18px; }
.about-body h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin: 36px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.alert-warning-dark {
  background: rgba(249,115,22,.08);
  border: 1px solid rgba(249,115,22,.25);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text-muted);
  margin: 24px 0;
}
.alert-warning-dark strong { color: var(--accent); }

.usage-list {
  list-style: none; padding: 0; margin: 14px 0 20px;
}
.usage-list li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-size: 14px;
}
.usage-list li:last-child { border-bottom: none; }
.usage-list li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ====================================================
   DOCS — SIDEBAR LAYOUT
   ==================================================== */

/* Sidebar + content wrapper */
.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--topbar-h);
}

/* ---- Sidebar ---- */
.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 0 40px;
  z-index: 200;
  transition: transform .25s ease;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }

.sidebar-section { margin-bottom: 8px; }

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 8px 20px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: color .12s, background .12s, border-color .12s;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  margin: 1px 8px 1px 0;
  text-decoration: none;
}
.sidebar-link:hover {
  color: var(--text);
  background: var(--bg-elevated);
  text-decoration: none;
}
.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-link .si-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-link .si-badge {
  margin-left: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  color: var(--text-subtle);
  font-weight: 600;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 199;
}

/* ---- Docs main content ---- */
.docs-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 900px;
}

/* Intro cards */
.docs-intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0 48px;
}
.docs-intro-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color .15s;
}
.docs-intro-card:hover { border-color: var(--accent); }
.docs-intro-card h5 { font-size: 14px; margin-bottom: 6px; }
.docs-intro-card p  { font-size: 13px; margin: 0; color: var(--text-subtle); }

/* Endpoint section */
.endpoint-section {
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.endpoint-header h2 {
  font-size: 1.4rem;
  margin: 0;
}

.endpoint-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* URL bar */
.url-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.url-bar .method { color: var(--green); font-weight: 700; }
.url-bar .url { color: var(--text); }
.url-bar .url .param { color: var(--accent); }

/* Tabs (databases) */
.db-tabs { margin-bottom: 0; }
.db-tabs .nav-tabs {
  border-bottom: 1px solid var(--border);
  gap: 2px;
}
.db-tabs .nav-tabs .nav-link {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--text-subtle);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  transition: color .12s, border-color .12s;
  cursor: pointer;
}
.db-tabs .nav-tabs .nav-link:hover { color: var(--text); border-bottom-color: var(--border); }
.db-tabs .nav-tabs .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

.db-tabs .tab-content {
  background: #010409;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0;
}
.db-tabs .tab-content pre {
  margin: 0;
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: transparent;
}

/* Section divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 56px 0;
}

/* Docs page heading */
.docs-page-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 10px;
}
.docs-page-subtitle { font-size: 15px; color: var(--text-muted); margin-bottom: 0; }

/* Inline info cards */
.info-card {
  background: rgba(88,166,255,.06);
  border: 1px solid rgba(88,166,255,.2);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-muted);
  margin: 20px 0;
}
.info-card strong { color: var(--blue); }

.warn-card {
  background: var(--accent-glow);
  border: 1px solid rgba(249,115,22,.25);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-muted);
  margin: 20px 0;
}
.warn-card strong { color: var(--accent); }

/* Copy button on pre */
.pre-wrapper { position: relative; }
.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: color .1s, background .1s;
}
.copy-btn:hover { color: var(--text); background: var(--border); }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 991px) {
  .topbar-nav { display: none; }
  .topbar-toggle { display: flex; }

  /* mobile nav drawer */
  .mobile-nav {
    position: fixed;
    top: var(--topbar-h); left: 0; right: 0; bottom: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 999;
    padding: 16px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  .mobile-nav.open { transform: translateX(0); }

  .mobile-nav .nav-link {
    display: block;
    color: var(--text-muted);
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 4px;
  }
  .mobile-nav .nav-link:hover { background: var(--bg-elevated); color: var(--text); text-decoration: none; }
  .mobile-nav .nav-link.active { color: var(--accent); background: var(--accent-glow); }
  .mobile-nav .btn-orange { width: 100%; justify-content: center; margin-top: 8px; }

  /* docs sidebar → drawer on mobile */
  .docs-sidebar { transform: translateX(-100%); }
  .docs-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .docs-content { margin-left: 0; padding: 24px 20px 60px; }

  /* docs topbar hamburger visible */
  .docs-topbar-toggle { display: flex !important; }
}

@media (max-width: 767px) {
  .hero-image-wrap { display: none; }
  .hero-title { font-size: 2rem; }
  .cta-section { padding: 40px 24px; }
  .docs-content { padding: 20px 16px 60px; }
  .login-card { padding: 32px 24px; }
}

/* docs topbar toggle (always hidden on desktop) */
.docs-topbar-toggle { display: none; }
