/* TOSE Docs - Custom Styles */
:root {
  --green-50: #ecfdf5;
  --green-100: #d1fae5;
  --green-200: #a7f3d0;
  --green-300: #6ee7b7;
  --green-400: #34d399;
  --green-500: #10b981;
  --green-600: #059669;
  --green-700: #047857;
  --green-800: #065f46;
  --green-900: #064e3b;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #4b5563; }

/* Sidebar */
.sidebar { scrollbar-width: thin; }
.sidebar-link {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: #4b5563;
  transition: all 0.15s;
}
.dark .sidebar-link { color: #9ca3af; }
.sidebar-link:hover { background: var(--green-50); color: var(--green-700); }
.dark .sidebar-link:hover { background: #1f2937; color: var(--green-400); }
.sidebar-link.active {
  background: var(--green-50);
  color: var(--green-700);
  font-weight: 600;
}
.dark .sidebar-link.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green-400);
}

.sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  padding: 16px 12px 4px;
}
.dark .sidebar-heading { color: #6b7280; }

/* Code blocks */
pre {
  background: #1e293b !important;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
}
code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
}
:not(pre) > code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--green-700);
}
.dark :not(pre) > code {
  background: #1e293b;
  color: var(--green-400);
}

/* Content */
.content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.dark .content h2 { border-color: #374151; }

.content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content p { margin-bottom: 0.75rem; line-height: 1.7; }
.content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 0.75rem; }
.content li { margin-bottom: 0.25rem; line-height: 1.6; }

/* API method badges */
.method {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
  min-width: 52px;
  text-align: center;
}
.method-get { background: #dbeafe; color: #1d4ed8; }
.method-post { background: #d1fae5; color: #047857; }
.method-put { background: #fef3c7; color: #b45309; }
.method-delete { background: #fee2e2; color: #dc2626; }
.method-ws { background: #ede9fe; color: #7c3aed; }

.dark .method-get { background: rgba(59,130,246,0.15); color: #60a5fa; }
.dark .method-post { background: rgba(16,185,129,0.15); color: #34d399; }
.dark .method-put { background: rgba(245,158,11,0.15); color: #fbbf24; }
.dark .method-delete { background: rgba(239,68,68,0.15); color: #f87171; }
.dark .method-ws { background: rgba(139,92,246,0.15); color: #a78bfa; }

/* Endpoint row */
.endpoint-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}
.dark .endpoint-row { border-color: #1f2937; }
.endpoint-path {
  font-family: monospace;
  font-size: 13px;
  color: #374151;
}
.dark .endpoint-path { color: #d1d5db; }

/* Table */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 8px 0 16px;
}
.param-table th {
  text-align: left;
  padding: 8px 12px;
  background: #f9fafb;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
}
.dark .param-table th {
  background: #111827;
  color: #9ca3af;
  border-color: #374151;
}
.param-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f3f4f6;
}
.dark .param-table td { border-color: #1f2937; }

/* Mobile sidebar toggle */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 1023px) {
  .sidebar-container {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 50;
    transition: left 0.3s;
    background: white;
  }
  .dark .sidebar-container { background: #111827; }
  .sidebar-container.open { left: 0; }
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(255,255,255,0.1);
  color: #94a3b8;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,0.2); }

/* Copy for AI dropdown */
.ai-dropdown {
  position: relative;
  display: inline-block;
}
.ai-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  transition: all 0.15s;
}
.dark .ai-dropdown-btn {
  background: #1f2937;
  color: #d1d5db;
  border-color: #374151;
}
.ai-dropdown-btn:hover {
  background: #e5e7eb;
}
.dark .ai-dropdown-btn:hover {
  background: #374151;
}
.ai-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 300px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  z-index: 100;
  overflow: hidden;
}
.dark .ai-dropdown-menu {
  background: #1a1a2e;
  border-color: #2d2d44;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.ai-dropdown-menu.show { display: block; }

.ai-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.ai-dropdown-item:hover {
  background: #f9fafb;
}
.dark .ai-dropdown-item:hover {
  background: #252540;
}
.ai-dropdown-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.ai-dropdown-item-text {
  flex: 1;
  min-width: 0;
}
.ai-dropdown-item-title {
  font-weight: 600;
  font-size: 14px;
}
.ai-dropdown-item-desc {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 1px;
}
.ai-dropdown-divider {
  border-top: 1px solid #e5e7eb;
  margin: 0;
}
.dark .ai-dropdown-divider {
  border-color: #2d2d44;
}
.ai-dropdown-label {
  padding: 10px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}
.ai-copied-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #10b981;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
  pointer-events: none;
}
.ai-copied-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
