/* ============================================================
   ARVAUM Studio — Documentation Stylesheet
   ============================================================ */

/* ---------- CSS Tokens / Variables ---------- */
:root {
  --color-bg:        #080C12;
  --color-surface:   #0F1520;
  --color-surface-2: #161E2C;
  --color-surface-3: #1c2536;
  --color-teal:      #00B2E3;
  --color-teal-dim:  rgba(0,178,227,0.15);
  --color-text:      #E6E7E8;
  --color-text-muted:#8a93a6;
  --color-border:    #1e2a3a;
  --color-amber:     #fbbf24;
  --sidebar-width:   280px;
  --nav-height:      72px;
  --font-heading:    'CocogoosePro', 'Inter', sans-serif;
  --font-body:       'Inter', sans-serif;
  --font-mono:       'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ---------- @font-face: CocogoosePro ---------- */
@font-face {
  font-family: 'CocogoosePro';
  src: url('/api/static/fonts/CocogoosePro-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'CocogoosePro';
  src: url('/api/static/fonts/CocogoosePro-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'CocogoosePro';
  src: url('/api/static/fonts/CocogoosePro-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--color-teal); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .85; }

img { max-width: 100%; height: auto; }

/* ---------- Top Navigation ---------- */
.docs-topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(8,12,18,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 1000;
}

.docs-topnav .nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.docs-topnav .nav-logo img {
  height: 36px;
  width: auto;
}

.docs-topnav .nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.docs-topnav .nav-logo-text .brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  letter-spacing: 1.5px;
}

.docs-topnav .nav-logo-text .brand-tagline {
  font-size: 10px;
  color: var(--color-text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.docs-topnav .nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.docs-topnav .nav-links a {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}

.docs-topnav .nav-links a:hover,
.docs-topnav .nav-links a.active {
  color: #fff;
}

.docs-topnav .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-teal);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 8px;
  transition: background .2s, transform .15s;
}
.docs-topnav .nav-cta:hover {
  background: #009bc7;
  opacity: 1;
  transform: translateY(-1px);
}

/* Mobile hamburger (top nav) */
.docs-topnav .nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
}

/* ---------- Layout Wrapper ---------- */
.docs-layout {
  display: flex;
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

/* ---------- Sidebar ---------- */
.docs-sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #0a0e14;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: 24px 0 40px;
  z-index: 900;
  transition: transform .3s ease;
}

/* Custom scrollbar */
.docs-sidebar::-webkit-scrollbar { width: 5px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

.docs-sidebar .sidebar-group { margin-bottom: 8px; }

.docs-sidebar .sidebar-group-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--color-text-muted);
  padding: 12px 24px 6px;
  user-select: none;
}

.docs-sidebar .sidebar-link {
  display: block;
  padding: 7px 24px 7px 26px;
  font-size: 13.5px;
  color: var(--color-text-muted);
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
  line-height: 1.5;
}

.docs-sidebar .sidebar-link:hover {
  color: var(--color-text);
  background: rgba(255,255,255,0.03);
  opacity: 1;
}

.docs-sidebar .sidebar-link.active {
  color: var(--color-teal);
  border-left-color: var(--color-teal);
  background: rgba(0,178,227,0.06);
}

/* Sidebar toggle button (mobile) */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 950;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-teal);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,178,227,0.4);
  transition: transform .2s;
}
.sidebar-toggle:hover { transform: scale(1.1); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 899;
}

/* ---------- Main Content ---------- */
.docs-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 48px 40px 80px;
  display: flex;
  justify-content: center;
}

.docs-content {
  max-width: 860px;
  width: 100%;
}

/* ---------- Typography ---------- */
.docs-content h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 28px;
  color: #fff;
  margin-top: 56px;
  margin-bottom: 10px;
  padding-bottom: 12px;
  position: relative;
}
.docs-content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--color-teal);
  border-radius: 2px;
}
.docs-content h2:first-child { margin-top: 0; }

.docs-content h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  color: #fff;
  margin-top: 40px;
  margin-bottom: 8px;
}

.docs-content p {
  margin-bottom: 16px;
  color: var(--color-text);
}

.docs-content ul, .docs-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}
.docs-content li {
  margin-bottom: 6px;
}
.docs-content li::marker {
  color: var(--color-teal);
}

.docs-content strong {
  color: #fff;
  font-weight: 600;
}

/* ---------- Inline Code ---------- */
.docs-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(0,178,227,0.08);
  border: 1px solid rgba(0,178,227,0.2);
  color: var(--color-teal);
  padding: 2px 7px;
  border-radius: 5px;
}

/* ---------- kbd ---------- */
.docs-content kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  color: var(--color-text);
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

/* ---------- Tip & Warning Boxes ---------- */
.docs-tip, .docs-warning {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.65;
}

.docs-tip {
  background: rgba(0,178,227,0.06);
  border-left: 3px solid var(--color-teal);
}
.docs-tip .tip-icon {
  color: var(--color-teal);
  margin-right: 8px;
}

.docs-warning {
  background: rgba(251,191,36,0.06);
  border-left: 3px solid var(--color-amber);
}
.docs-warning .warning-icon {
  color: var(--color-amber);
  margin-right: 8px;
}

/* ---------- Tables ---------- */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.docs-content thead th {
  background: var(--color-surface);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}
.docs-content tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.docs-content tbody tr:hover td {
  background: var(--color-surface-2);
}

/* ---------- Steps / Ordered lists in guides ---------- */
.docs-content ol.steps {
  counter-reset: step-counter;
  list-style: none;
  padding-left: 0;
}
.docs-content ol.steps li {
  counter-increment: step-counter;
  padding-left: 40px;
  position: relative;
  margin-bottom: 14px;
}
.docs-content ol.steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0; top: 1px;
  width: 26px; height: 26px;
  background: var(--color-teal);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Section divider ---------- */
.docs-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 48px 0;
}

/* ---------- Footer ---------- */
.docs-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 48px 32px 32px;
  margin-left: var(--sidebar-width);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand .brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.footer-brand p {
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: var(--color-text-muted);
  font-size: 13.5px;
  padding: 4px 0;
  transition: color .2s;
}
.footer-col a:hover { color: #fff; opacity: 1; }

.footer-bottom {
  max-width: 1100px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-muted);
}
.footer-socials { display: flex; gap: 16px; }
.footer-socials a {
  color: var(--color-text-muted);
  font-size: 16px;
  transition: color .2s;
}
.footer-socials a:hover { color: var(--color-teal); opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .docs-sidebar {
    transform: translateX(-100%);
  }
  .docs-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .docs-main {
    margin-left: 0;
    padding: 32px 20px 60px;
  }
  .docs-footer {
    margin-left: 0;
  }
  .docs-topnav .nav-links { display: none; }
  .docs-topnav .nav-cta { display: none; }
  .docs-topnav .nav-hamburger { display: block; }
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 480px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .docs-content h2 { font-size: 22px; }
  .docs-content h3 { font-size: 17px; }
}

/* ---------- Mobile nav dropdown ---------- */
.mobile-nav-dropdown {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: rgba(8,12,18,0.97);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  z-index: 999;
  flex-direction: column;
  gap: 8px;
}
.mobile-nav-dropdown.open {
  display: flex;
}
.mobile-nav-dropdown a {
  color: var(--color-text-muted);
  font-size: 15px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav-dropdown a:last-child { border-bottom: none; }
.mobile-nav-dropdown a:hover { color: #fff; }
.mobile-nav-dropdown .mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-teal);
  color: #fff;
  font-weight: 600;
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
}

/* ---------- Anchor link icon ---------- */
.docs-content h2 .anchor-link,
.docs-content h3 .anchor-link {
  opacity: 0;
  margin-left: 8px;
  color: var(--color-text-muted);
  font-size: 0.75em;
  transition: opacity .2s;
}
.docs-content h2:hover .anchor-link,
.docs-content h3:hover .anchor-link {
  opacity: 1;
}

/* ---------- Back-to-top ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 950;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 18px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.back-to-top.visible {
  display: flex;
}
.back-to-top:hover {
  background: var(--color-teal);
  color: #fff;
  border-color: var(--color-teal);
}
