/* ==========================================================
   ASHA AI Documentation — stylesheet
   Everything is scoped under .asha-docs so documentation styles
   can never leak into the rest of the website.
   ========================================================== */
.asha-docs {
  --asha-primary: #078783;
  --asha-primary-dark: #05605D;
  --asha-primary-light: #59AFAC;
  --asha-primary-soft: #E4F3F2;
  --asha-text-main: #333333;
  --asha-text-secondary: #5F7373;
  --asha-text-tertiary: #8A9899;
  --asha-bg-base: #F3F4F6;
  --asha-surface: #FFFFFF;
  --asha-line: #E3E9EC;
  --asha-radius-sm: 12px;
  --asha-radius-md: 20px;
  --asha-radius-lg: 28px;
  --asha-shadow-soft: 0 1px 2px rgba(2, 40, 36, 0.05), 0 8px 24px rgba(2, 40, 36, 0.06);
  --asha-shadow-lifted: 0 16px 40px rgba(3, 70, 65, 0.10);
}
.asha-docs .docs-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding-block: 40px clamp(56px, 8vw, 96px);
}
.asha-docs .docs-toc-btn { display: none; }
.asha-docs .docs-scrim { display: none; }
.asha-docs .docs-sidebar {
  position: sticky;
  top: 92px;
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--line, #E3E9EC);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(2,40,36,0.05), 0 8px 24px rgba(2,40,36,0.06);
  padding: 18px 14px 10px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
}
.asha-docs .docs-nav-title {
  padding: 6px 10px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary, #8A9899);
}
.asha-docs .docs-group {
  border-bottom: 1px solid #EFF3F4;
  padding-bottom: 4px;
}
.asha-docs .docs-group:last-child { border-bottom: none; }
.asha-docs .docs-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 10px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main, #333333);
}
.asha-docs .docs-group > summary::-webkit-details-marker { display: none; }
.asha-docs .docs-group > summary::after {
  content: "\25BE";
  font-size: 12px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}
.asha-docs .docs-group[open] > summary::after { transform: rotate(180deg); }
.asha-docs .docs-group > summary:hover { background: #E4F3F2; color: #05605D; }
.asha-docs .docs-group-nested > summary {
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 10px;
}
.asha-docs .docs-list {
  position: relative;
  display: grid;
  gap: 0;
  padding: 6px 0 14px;
}
.asha-docs .docs-list::before {
  content: "";
  position: absolute;
  inset-inline-start: 5px;
  inset-block-start: 2px;
  inset-block-end: 12px;
  width: 2px;
  border-radius: 2px;
  background: #D8E0E3;
}
.asha-docs .docs-list > li { position: relative; padding-inline-start: 22px; }
.asha-docs .docs-list > li::before {
  content: "";
  position: absolute;
  inset-inline-start: 5px;
  inset-block-start: 1.25em;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: #D8E0E3;
}
.asha-docs .docs-link {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-secondary, #5F7373);
}
.asha-docs .docs-link:hover { background: #E4F3F2; color: #05605D; }
.asha-docs .docs-link.active {
  background: #E4F3F2;
  color: #05605D;
  font-weight: 700;
}
.asha-docs .docs-link.docs-method { display: flex; align-items: center; gap: 8px; }
.asha-docs .docs-method-badge {
  flex-shrink: 0;
  font-family: monospace;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
}
.asha-docs .docs-method-post .docs-method-badge { background: rgba(37,99,235,0.18); color: #3b82f6; }
.asha-docs .docs-method-post.active .docs-method-badge { background: #3b82f6; color: #0b0b0f; }
.asha-docs .docs-subtitle {
  padding: 12px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
}
.asha-docs .docs-content { min-width: 0; }
.asha-docs .docs-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 16px;
}
/* body scroll lock when drawer is open */
body.asha-docs-drawer-open { overflow: hidden; }
@media (max-width: 767px) {
  .asha-docs .docs-layout { grid-template-columns: 1fr; gap: 16px; }
  .asha-docs .docs-sidebar {
    position: fixed;
    top: 76px; bottom: 0; inset-inline-start: 0;
    z-index: 46;
    width: min(320px, 88vw);
    max-height: none;
    margin: 0;
    border: 1px solid var(--line, #E3E9EC);
    border-inline-start: none;
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    border-start-end-radius: 14px;
    border-end-end-radius: 14px;
    box-shadow: var(--asha-shadow-lifted, 0 16px 40px rgba(3,70,65,0.10));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s ease, visibility 0.3s ease;
  }
  .asha-docs .docs-sidebar.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .asha-docs .docs-toc-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    background: #FFFFFF;
    border: 1px solid #E3E9EC;
    border-radius: 12px;
    box-shadow: var(--asha-shadow-soft, 0 1px 2px rgba(2,40,36,0.05));
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main, #333333);
    cursor: pointer;
    position: relative;
    z-index: 2;
  }
  .asha-docs .docs-toc-btn::after {
    content: "\25BE";
    color: var(--asha-primary, #078783);
    transition: transform 0.2s ease;
  }
  .asha-docs .docs-toc-btn.open::after { transform: rotate(180deg); }
  .asha-docs .docs-scrim {
    position: fixed; inset: 0; z-index: 45;
    display: block;
    background: rgba(11,17,19,0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .asha-docs .docs-scrim.open { opacity: 1; visibility: visible; pointer-events: auto; }
  @media (max-width: 480px) {
    .asha-docs .docs-sidebar { top: 64px; }
  }
}
/* ==========================================================
   Documentation code blocks — copy button with icon (ALL, Persian)
   Single (code-block) and multi-tab (code-tab-pane) both get icon
   ========================================================== */
.asha-docs .code-block { position: relative; }
.asha-docs .code-block-head { display: flex; align-items: center; gap: 12px; }
.asha-docs .code-block-head .code-copy-btn {
  position: static !important;
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.asha-docs .code-block-head .code-copy-btn:hover {
  background: var(--asha-primary, #078783);
  color: #fff;
  border-color: var(--asha-primary, #078783);
}
.asha-docs .code-copy-btn .code-copy-icon { flex-shrink: 0; display: inline-flex; }
.asha-docs .code-copy-btn .code-copy-text { line-height: 1; }
/* Multi-tab panes — each pane gets its own button (Persian) */
.asha-docs .code-tab-pane { position: relative; }
.asha-docs .code-tab-pane .code-copy-btn {
  position: absolute !important;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.asha-docs .code-tab-pane .code-copy-btn:hover {
  background: var(--asha-primary, #078783);
  color: #fff;
  border-color: var(--asha-primary, #078783);
}
/* Fallback for pre without head — keep absolute positioning from theme */
.asha-docs .code-block pre .code-copy-btn,
.asha-docs pre .code-copy-btn {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
}
