/* Seenn Docs - Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Light theme (default) */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-code: #f3f4f6;
  --border-color: #e5e7eb;
  --border-hover: #d1d5db;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --header-bg: rgba(255, 255, 255, 0.8);
  --card-bg: rgba(249, 250, 251, 0.5);
  --card-hover: rgba(243, 244, 246, 0.8);
  --code-bg: #1f2937;
  --code-border: #374151;

  /* Colors */
  --blue-400: #3b82f6;
  --blue-500: #2563eb;
  --violet-400: #8b5cf6;
  --violet-500: #7c3aed;
  --green-400: #22c55e;
  --green-500: #16a34a;
  --orange-400: #f97316;
  --cyan-400: #06b6d4;
  --red-400: #ef4444;
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-code: #1f2937;
  --border-color: rgba(31, 41, 55, 0.5);
  --border-hover: #374151;
  --text-primary: #ffffff;
  --text-secondary: #e5e7eb;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;
  --header-bg: rgba(10, 10, 10, 0.8);
  --card-bg: rgba(17, 24, 39, 0.3);
  --card-hover: rgba(17, 24, 39, 0.5);
  --code-bg: #111827;
  --code-border: #1f2937;

  /* Dark mode colors (brighter) */
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --violet-400: #a78bfa;
  --violet-500: #8b5cf6;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --orange-400: #fb923c;
  --cyan-400: #22d3ee;
  --red-400: #f87171;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

::selection {
  background: var(--blue-500);
  color: white;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

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

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 64px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 6px;
}

.header-logo-icon svg {
  width: 100%;
  height: 100%;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: 32px;
}

.header-nav a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--text-primary);
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  width: 256px;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 16px;
  background: var(--bg-primary);
}

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

.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 8px;
  padding: 0 12px;
}

.sidebar-link {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
}

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

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

.sidebar-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 4px;
  margin-left: 8px;
}

.sidebar-badge.backend {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green-400);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.sidebar-badge.client {
  background: rgba(96, 165, 250, 0.1);
  color: var(--blue-400);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 256px;
  min-height: calc(100vh - 64px);
}

.content-wrapper {
  max-width: 896px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-faint);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--text-primary);
}

.breadcrumb-current {
  color: var(--text-muted);
}

/* Doc Action Buttons */
.doc-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.doc-action-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.doc-action-btn svg {
  opacity: 0.7;
}

.doc-action-btn:hover svg {
  opacity: 1;
}

/* Typography */
h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}

h2, h3 {
  position: relative;
}

h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 16px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

/* Anchor Links */
.anchor-link {
  position: absolute;
  left: -1.5em;
  padding-right: 0.5em;
  color: var(--text-faint);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
  transition: opacity 0.15s, color 0.15s;
}

h2:hover .anchor-link,
h3:hover .anchor-link,
.anchor-link:focus {
  opacity: 1;
}

.anchor-link:hover {
  color: var(--blue-400);
}

.subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

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

/* Code Blocks */
.code-block {
  position: relative;
  margin: 16px 0 24px;
}

.code-block pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}

.code-block code {
  font-family: 'JetBrains Mono', monospace;
  color: #e5e7eb;
}

.code-block .copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.15s;
  border-radius: 6px;
}

.code-block .copy-btn:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* Code Tabs */
.code-tabs {
  margin: 24px 0;
}

.code-tabs-header {
  display: flex;
  gap: 4px;
}

.code-tab-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.code-tab-btn.active {
  color: white;
  background: var(--code-bg);
  border-radius: 8px 8px 0 0;
}

.code-tab-content {
  display: none;
}

.code-tab-content.active {
  display: block;
}

.code-tab-content pre {
  border-radius: 0 12px 12px 12px;
}

/* Inline Code */
code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--blue-400);
}

/* Syntax Highlighting */
.token-keyword { color: var(--violet-400); }
.token-string { color: var(--green-400); }
.token-function { color: var(--blue-400); }
.token-method { color: #fbbf24; }
.token-comment { color: var(--dark-500); }
.token-number { color: var(--orange-400); }
.token-variable { color: white; }
.token-type { color: var(--cyan-400); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.card {
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.card-icon.blue {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: var(--blue-400);
}

.card-icon.green {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--green-400);
}

.card-icon.violet {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--violet-400);
}

.card-icon.orange {
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.2);
  color: var(--orange-400);
}

.card h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* SDK Cards (larger) */
.sdk-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.sdk-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.15s;
}

.sdk-card:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
}

.sdk-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.sdk-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sdk-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.sdk-card-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

.sdk-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

.sdk-card code {
  display: block;
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--code-bg);
  border-radius: 8px;
  font-size: 12px;
  color: #e5e7eb;
  text-align: center;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--card-bg);
}

/* Method Reference */
.method-block {
  margin: 32px 0;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.method-signature {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.method-description {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.params-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.param-item {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.param-item:last-child {
  border-bottom: none;
}

.param-name {
  font-family: 'JetBrains Mono', monospace;
  color: var(--blue-400);
  min-width: 120px;
}

.param-type {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-faint);
  min-width: 100px;
}

.param-desc {
  color: var(--text-muted);
}

.param-required {
  color: var(--orange-400);
  font-size: 11px;
  margin-left: 4px;
}

/* Callouts */
.callout {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  display: flex;
  gap: 12px;
}

.callout-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.callout-content {
  font-size: 14px;
}

.callout.info {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
}

.callout.info .callout-icon {
  color: var(--blue-400);
}

.callout.warning {
  background: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.2);
}

.callout.warning .callout-icon {
  color: var(--orange-400);
}

/* Search Modal */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.search-modal.active {
  display: block;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.search-dialog {
  position: relative;
  top: 20%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

[data-theme="dark"] .search-dialog {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-color);
}

.search-input {
  flex: 1;
  padding: 16px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.search-section-title {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: background 0.15s;
}

.search-result:hover {
  background: var(--bg-tertiary);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  margin-top: 64px;
}

.footer-content {
  max-width: 896px;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-faint);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.pagination-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.pagination-link:hover {
  color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

/* Scrollbar for dark mode */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #374151;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .card-grid,
  .sdk-cards {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 28px;
  }
}
