/* ==========================================================================
   Aiffinity Docs — styles.css
   ========================================================================== */

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

:root {
  --bg-body: #0D0D0D;
  --bg-surface: #161616;
  --bg-elevated: #1C1C1C;
  --text-primary: #F5F5F5;
  --text-secondary: #949A9C;
  --text-muted: #798183;
  --orange: #FF9021;
  --orange-dim: rgba(255, 144, 33, 0.15);
  --border: #2C2C2C;
  --border-light: #404040;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 280px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}


/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 32px 24px 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-logo svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-logo .logo-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

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

.sidebar-group-title {
  padding: 8px 24px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar-link {
  display: block;
  padding: 10px 24px 10px 32px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.15s ease, background 0.15s ease;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.sidebar-link.active {
  color: var(--orange);
  border-left-color: var(--orange);
  background: var(--orange-dim);
}

.sidebar-back {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.sidebar-back:hover {
  color: var(--orange);
}


/* ==========================================================================
   MOBILE MENU
   ========================================================================== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.hamburger {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger svg {
  width: 24px;
  height: 24px;
}

.mobile-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
}


/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */
.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.content {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 40px 80px;
}


/* ==========================================================================
   DOCS HUB (index)
   ========================================================================== */
.docs-hero {
  margin-bottom: 48px;
}

.docs-hero h1 {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.docs-hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.docs-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.docs-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
}

.docs-card-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.docs-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.docs-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}


/* ==========================================================================
   ARTICLE CONTENT
   ========================================================================== */
.article h1 {
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.article h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

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

.article ul, .article ol {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 24px;
}

.article li {
  margin-bottom: 8px;
}

.article a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article a:hover {
  opacity: 0.8;
}

.article strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

.article pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.7;
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.article th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.article td {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.article .todo-marker {
  display: inline-block;
  background: var(--orange-dim);
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

.method-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  padding: 3px 8px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

.method-get {
  background: rgba(46, 160, 67, 0.15);
  color: #3fb950;
}

.method-post {
  background: rgba(56, 132, 255, 0.15);
  color: #58a6ff;
}

.method-put {
  background: rgba(210, 153, 34, 0.15);
  color: #d29922;
}

.method-delete {
  background: rgba(248, 81, 73, 0.15);
  color: #f85149;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .mobile-header {
    display: flex;
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 80px 20px 60px;
  }

  .docs-hero h1 {
    font-size: 1.8rem;
  }

  .docs-cards {
    grid-template-columns: 1fr;
  }

  .article h1 {
    font-size: 1.6rem;
  }

  .article h2 {
    font-size: 1.25rem;
  }

  .article pre {
    padding: 16px;
  }
}
