/* 1322 Docs - dark theme, teal accent */
/* Nuclear override: vue theme defaults to light; override every content area */
html,
body,
#app,
#main,
.content,
.sidebar,
.markdown-body,
.markdown-section,
.theme-default-content,
[class*="content"],
[class*="section"] {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #f1f5f9 !important;
}

body .content,
body .markdown-section {
  background: transparent !important;
}

/* Force dark on ALL table content - vue theme overrides with white */
body .content table,
body .content table th,
body .content table td,
body .content .markdown-section table,
body .content .markdown-section table th,
body .content .markdown-section table td,
.markdown-section table,
.markdown-section table th,
.markdown-section table td {
  background-color: #1e293b !important;
  background: #1e293b !important;
  color: #f1f5f9 !important;
}

body .content .markdown-section thead th,
.markdown-section thead th {
  background: rgba(20, 184, 166, 0.1) !important;
  color: #94a3b8 !important;
}

/* Every element inside table cells - no white text */
body .content table td *,
body .content .markdown-section table td * {
  color: inherit !important;
}

body .content table td,
body .content .markdown-section table td {
  color: #f1f5f9 !important;
}

:root {
  --theme: #14b8a6;
  --theme-dim: #0d9488;
  --theme-bg: rgba(20, 184, 166, 0.12);
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-elevated: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html {
  background: var(--bg) !important;
}

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

#app {
  position: relative;
  z-index: 1;
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* Sidebar - 1322 banner + nav */
.sidebar {
  background: var(--bg-card) !important;
  border-right: 1px solid var(--border) !important;
  padding-top: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  min-width: 220px;
}

/* Sidebar toggle - ensure visible on mobile */
.sidebar-toggle {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border);
}

.app-name,
.app-name-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, transparent 100%) !important;
  color: var(--text) !important;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none !important;
  min-height: 56px;
}

.app-name-link .app-logo,
.app-name-link img {
  max-height: 36px;
  width: auto;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  overflow: visible !important;
}

.sidebar-nav > ul {
  overflow: visible !important;
}

.sidebar-nav li {
  list-style: none;
}

.sidebar-nav li a {
  display: block !important;
  visibility: visible !important;
}

.sidebar-nav li a {
  color: var(--text-muted) !important;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar-nav li a:hover {
  color: var(--theme) !important;
  background: var(--theme-bg);
}

.sidebar-nav li.active > a {
  color: var(--theme) !important;
  background: var(--theme-bg);
  font-weight: 600;
}

/* Main content */
.markdown-section {
  background: transparent !important;
  color: var(--text) !important;
  max-width: 720px;
  padding: 2.5rem 2rem 4rem !important;
}

.markdown-section h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text) !important;
  border: none !important;
}

.markdown-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted) !important;
  border: none !important;
  margin: 2.5rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.markdown-section h2:first-of-type { margin-top: 0; }

.markdown-section hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

.markdown-section p {
  color: var(--text-muted) !important;
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
}

.markdown-section a {
  color: var(--theme) !important;
  text-decoration: none;
}

.markdown-section strong {
  color: var(--text) !important;
}

.markdown-section li {
  color: var(--text-muted) !important;
  margin: 0.25rem 0;
}

.markdown-section blockquote {
  border-left: 4px solid var(--theme);
  background: rgba(20, 184, 166, 0.08);
  color: var(--text-muted) !important;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.markdown-section a:hover { text-decoration: underline; }

/* Tables - full-width card, no spreadsheet grid */
body .markdown-section table,
.markdown-section table {
  width: 100% !important;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  margin: 1.5rem 0;
  background: rgba(30, 41, 59, 0.6) !important;
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* First column compact (code/param), rest expand to fill */
.markdown-section th:first-child,
.markdown-section td:first-child {
  width: 1%;
  white-space: nowrap;
}

.markdown-section th,
.markdown-section td {
  padding: 1rem 1.25rem;
  text-align: left;
  color: var(--text) !important;
  border: none;
  border-bottom: 1px solid rgba(51, 65, 85, 0.35);
}

.markdown-section tr:last-child th,
.markdown-section tr:last-child td {
  border-bottom: none;
}

.markdown-section thead th {
  background: rgba(20, 184, 166, 0.07) !important;
  color: var(--text-muted) !important;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.markdown-section tbody tr {
  transition: background 0.12s ease;
}

.markdown-section tbody tr:hover td {
  background: rgba(20, 184, 166, 0.04) !important;
}

.markdown-section tbody td:first-child {
  font-weight: 500;
}

.markdown-section td a,
.markdown-section td strong {
  color: inherit !important;
}

.markdown-section td code {
  background: rgba(20, 184, 166, 0.12) !important;
  color: var(--theme) !important;
  padding: 0.2em 0.45em;
  border-radius: 5px;
  font-size: 0.88em;
}

.markdown-section table td a {
  color: var(--theme) !important;
}

/* Code */
.markdown-section code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(20, 184, 166, 0.15);
  color: var(--theme);
  padding: 0.2em 0.45em;
  border-radius: 4px;
}

.markdown-section pre {
  background: var(--bg-card) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem !important;
  margin: 1rem 0;
  overflow-x: auto;
}

.markdown-section pre > code {
  background: none !important;
  color: var(--text) !important;
  padding: 0;
}

/* API endpoint cards */
.markdown-section details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0.5rem 0;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.markdown-section details:hover {
  border-color: rgba(20, 184, 166, 0.3);
}

.markdown-section details[open] {
  border-color: rgba(20, 184, 166, 0.4);
  box-shadow: var(--shadow-lg);
}

.markdown-section details summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s;
}

.markdown-section details summary::-webkit-details-marker,
.markdown-section details summary::marker { display: none; }

.markdown-section details summary::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--theme);
  border-bottom: 2px solid var(--theme);
  transform: rotate(-45deg);
  margin-left: 0.25rem;
  transition: transform 0.2s;
}

.markdown-section details[open] summary::before {
  transform: rotate(45deg);
}

.markdown-section details summary:hover {
  background: rgba(255,255,255,0.03);
}

/* Method badges */
.markdown-section .method {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25em 0.5em;
  border-radius: 4px;
  min-width: 3.2rem;
  text-align: center;
}

.markdown-section .method-get { background: rgba(20, 184, 166, 0.25); color: #5eead4; }
.markdown-section .method-post { background: rgba(59, 130, 246, 0.25); color: #93c5fd; }
.markdown-section .method-delete { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }

/* Endpoint path */
.markdown-section .endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.markdown-section .endpoint-desc {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.9rem;
  margin-left: auto;
}

/* Details content */
.markdown-section .details-content {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

.markdown-section .details-content > *:first-child { margin-top: 0; }

.markdown-section .details-content .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.markdown-section .details-content .meta span {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.markdown-section .details-content .meta strong { color: var(--text); }

/* Search */
.search input {
  background: var(--bg-card) !important;
  border: 1px solid var(--border);
  color: var(--text) !important;
  border-radius: var(--radius-sm);
}

.search .results-panel {
  background: var(--bg-card) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--theme-dim); }

/* Override vue theme - force dark everywhere */
.sidebar,
.content,
.markdown-body,
.theme-default-content {
  background: var(--bg) !important;
  color: var(--text) !important;
}

.content .markdown-section {
  background: transparent !important;
}

/* Search no-results */
.search .no-results,
.search .matching-post,
.search .matching-post .title,
.search .matching-post .title small {
  color: var(--text) !important;
  background: var(--bg-card) !important;
}

.search .results-panel .matching-post {
  color: var(--text) !important;
}

.search .results-panel .matching-post a {
  color: var(--theme) !important;
}

/* Loading state */
#app:empty::after,
.loading {
  color: var(--text-muted) !important;
}

/* Docsify-specific: content wrapper, main area */
.app-name,
.app-name-link,
.sidebar-toggle span,
.sidebar-toggle .sidebar-toggle-button {
  color: var(--text) !important;
}

/* Ensure code blocks in any context */
pre,
pre code,
.markdown-section pre,
.markdown-section pre code {
  color: var(--text) !important;
  background: var(--bg-card) !important;
}

/* Links in table cells - keep teal for URLs */
.markdown-section table td a {
  color: var(--theme) !important;
}
