/* =========================================================
   Telecall Partners API — Documentation Styles
   ========================================================= */

:root {
  --sidebar-width: 300px;
  --sidebar-bg: #061e33;
  --sidebar-border: #0a3456;
  --sidebar-text: #8ab0c8;
  --sidebar-text-active: #f0f8ff;
  --sidebar-hover: #082840;
  --sidebar-active: #0c4b77;

  --content-bg: #ffffff;
  --content-text: #1e293b;
  --heading-color: #0c4b77;
  --border-color: #e2e8f0;
  --code-bg: #f8fafc;
  --code-border: #e2e8f0;

  --accent: #0c4b77;
  --accent-light: #dce9f3;

  --method-get: #16a34a;
  --method-get-bg: #dcfce7;
  --method-post: #0c4b77;
  --method-post-bg: #dce9f3;
  --method-put: #d97706;
  --method-put-bg: #fef3c7;
  --method-patch: #0891b2;
  --method-patch-bg: #cffafe;
  --method-delete: #a90829;
  --method-delete-bg: #fce4e8;

  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--content-text);
  background: var(--content-bg);
  line-height: 1.6;
}

/* ── Layout ── */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.brand-icon { width: 22px; height: 22px; color: #6da8d4; }
.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #f0f8ff;
  letter-spacing: -0.2px;
}

.version-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--sidebar-text);
}
.version-row select {
  flex: 1;
  background: #082840;
  border: 1px solid #0a3d68;
  color: #c8dde9;
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}
.version-row select:focus { border-color: var(--accent); }

/* ── Language Selector ── */
.lang-row {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.lang-btn {
  flex: 1;
  background: #082840;
  border: 1px solid #0a3d68;
  color: #8ab0c8;
  padding: 4px 0;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.lang-btn:hover { background: #0c3d5a; color: #c8dde9; }
.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #f0f8ff;
}

.search-wrap {
  position: relative;
}
.search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #4a6e85;
  pointer-events: none;
}
#search-input {
  width: 100%;
  background: #082840;
  border: 1px solid #0a3d68;
  color: #c8dde9;
  padding: 7px 10px 7px 30px;
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
#search-input:focus { border-color: var(--accent); }
#search-input::placeholder { color: #3a5f75; }

/* ── Sidebar Nav ── */
#sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
}
#sidebar-nav::-webkit-scrollbar { width: 4px; }
#sidebar-nav::-webkit-scrollbar-track { background: transparent; }
#sidebar-nav::-webkit-scrollbar-thumb { background: #0a3d68; border-radius: 2px; }

.nav-overview {
  display: flex;
  align-items: center;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.nav-overview:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
.nav-overview.active {
  color: #4d9bc4;
  border-left-color: #4d9bc4;
  background: rgba(12, 75, 119, 0.15);
}

/* Folder */
.nav-folder { margin-bottom: 2px; }

.nav-folder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4a6e85;
  cursor: pointer;
  transition: color 0.15s;
  user-select: none;
}
.nav-folder-header:hover { color: #8ab4d4; }
.nav-folder-header.active {
  color: #4d9bc4;
  background: rgba(12, 75, 119, 0.15);
}
.nav-folder-header .arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.nav-folder.open .nav-folder-header .arrow { transform: rotate(90deg); }

.nav-folder-children { display: none; }
.nav-folder.open .nav-folder-children { display: block; }

/* Endpoint link */
.nav-endpoint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 28px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.12s;
  min-width: 0;
}
.nav-endpoint:hover { background: var(--sidebar-hover); }
.nav-endpoint.active {
  background: rgba(12, 75, 119, 0.18);
  border-left-color: var(--accent);
}
.nav-endpoint .endpoint-name {
  font-size: 12.5px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.nav-endpoint.active .endpoint-name,
.nav-endpoint:hover .endpoint-name { color: var(--sidebar-text-active); }

/* Sub-folder (nested) */
.nav-sub-folder { margin-left: 8px; }

/* ── Method Badge ── */
.method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 3px;
  flex-shrink: 0;
  min-width: 38px;
}
.method-badge.large {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius);
  min-width: 60px;
}

.method-get    { background: var(--method-get-bg);    color: var(--method-get);    }
.method-post   { background: var(--method-post-bg);   color: var(--method-post);   }
.method-put    { background: var(--method-put-bg);    color: var(--method-put);    }
.method-patch  { background: var(--method-patch-bg);  color: var(--method-patch);  }
.method-delete { background: var(--method-delete-bg); color: var(--method-delete); }

/* ── Main Content ── */
.content {
  flex: 1;
  overflow-y: auto;
  background: var(--content-bg);
  scroll-behavior: smooth;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Overview / Endpoint pages ── */
.page-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 48px 80px;
}

/* Loading */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  color: #94a3b8;
}
.nav-loading { padding: 16px; color: #4a6e85; font-size: 13px; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Overview */
.overview-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--heading-color);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.overview-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  color: #64748b;
  font-size: 13px;
}
.overview-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Markdown body */
.md-body h1 { font-size: 22px; font-weight: 700; color: var(--heading-color); margin: 32px 0 12px; }
.md-body h2 { font-size: 18px; font-weight: 700; color: var(--heading-color); margin: 28px 0 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 6px; }
.md-body h3 { font-size: 15px; font-weight: 600; color: var(--heading-color); margin: 22px 0 8px; }
.md-body p  { margin-bottom: 12px; line-height: 1.75; color: #334155; }
.md-body ul, .md-body ol { margin: 0 0 12px 20px; color: #334155; }
.md-body li { margin-bottom: 4px; line-height: 1.7; }
.md-body code { font-family: var(--font-mono); font-size: 12.5px; background: var(--code-bg); border: 1px solid var(--code-border); padding: 1px 5px; border-radius: 3px; color: #be185d; }
.md-body pre { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; margin-bottom: 14px; }
.md-body pre code { background: none; border: none; padding: 0; color: inherit; }
.md-body table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.md-body table th { background: #e8f1f7; font-weight: 600; text-align: left; padding: 8px 12px; border: 1px solid var(--border-color); color: #0c4b77; }
.md-body table td { padding: 8px 12px; border: 1px solid var(--border-color); vertical-align: top; }
.md-body table tr:nth-child(even) td { background: #f0f6fa; }
.md-body a { color: var(--accent); text-decoration: none; }
.md-body a:hover { text-decoration: underline; }
.md-body blockquote { border-left: 4px solid var(--accent); background: var(--accent-light); padding: 10px 16px; border-radius: 0 var(--radius) var(--radius) 0; color: #0c4b77; margin-bottom: 14px; }
.md-body hr { border: none; border-top: 1px solid var(--border-color); margin: 24px 0; }

/* ── Endpoint Detail ── */
.endpoint-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.endpoint-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--heading-color);
  letter-spacing: -0.4px;
  line-height: 1.3;
}

.endpoint-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 28px;
  overflow-x: auto;
}
.endpoint-url-bar code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #0f1f35;
  flex: 1;
  white-space: nowrap;
}

/* Sections */
.section {
  margin-top: 32px;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* Tables */
.params-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 4px;
}
.params-table th {
  background: #e8f1f7;
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  color: #0c4b77;
  font-size: 12px;
}
.params-table td {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  vertical-align: top;
  color: #334155;
}
.params-table tr:nth-child(even) td { background: #f0f6fa; }
.params-table code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #0f1f35;
}
.required-badge {
  display: inline-block;
  background: #fce4e8;
  color: #a90829;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}
.optional-badge {
  display: inline-block;
  background: #e8f1f7;
  color: #4a6e85;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}

/* Code Block */
.code-block {
  position: relative;
  background: #061e33;
  border-radius: var(--radius);
  overflow: hidden;
}
.code-block pre {
  margin: 0;
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
}
.code-block pre code {
  color: #c8e6f7;
  background: none !important;
  border: none;
  padding: 0;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(12, 75, 119, 0.30);
  color: #8ab0c8;
  border: 1px solid rgba(12, 75, 119, 0.45);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { background: rgba(12, 75, 119, 0.55); color: #f0f8ff; }
.copy-btn.copied { color: #34d399; border-color: #34d399; }

/* Responses */
.response-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.response-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #f2f8fc;
  cursor: pointer;
  user-select: none;
}
.response-header:hover { background: #e5f1f9; }
.response-name { font-size: 13px; color: #334155; flex: 1; }
.status-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
}
.status-2xx { background: #dcfce7; color: #16a34a; }
.status-4xx { background: #fee2e2; color: #dc2626; }
.status-5xx { background: #fef3c7; color: #d97706; }
.status-1xx, .status-3xx { background: #e8f1f7; color: #4a6e85; }
.response-body { display: none; }
.response-body.open { display: block; }

/* Tag / label chips */
.tag {
  display: inline-flex;
  align-items: center;
  background: var(--accent-light);
  color: #0c4b77;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Mobile ── */
.menu-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  background: var(--accent);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(12, 75, 119, 0.4);
  align-items: center;
  justify-content: center;
}
.menu-toggle svg { width: 20px; height: 20px; }

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .content { width: 100%; }
  .menu-toggle { display: flex; }
  .page-inner { padding: 32px 20px 60px; }
  .endpoint-title { font-size: 20px; }
}

/* No results */
.no-results {
  padding: 12px 16px;
  font-size: 12px;
  color: #4a7a9b;
  font-style: italic;
}
