/*
 ClicPay API Docs - Dark Modern Theme
 Scoped to body.cpdocs-root to avoid leaking styles to other pages.
 Safe overrides layered on top of Scribe's default theme.
*/

/* CSS Variables (scoped) */
.cpdocs-root {
  /* Brand palette */
  --primary-color: #7c3aed; /* violet-600 */
  --primary-700: #6d28d9;
  --secondary-color: #5ec9e0; /* cyan toned down */
  --accent-color: #9bd7e6; /* lighter accent for executive look */

  /* Surface & text */
  --bg-primary: #0a0d12; /* charcoal */
  --bg-secondary: #0f141c; /* charcoal+ */
  --bg-tertiary: #141b25; /* panels/inputs */
  --bg-card: #0d131b; /* cards */
  --border-color: #1b2430;
  --border-light: #253244;

  --text-primary: #f1f5f9; /* slate-100 */
  --text-secondary: #cbd5e1; /* slate-300 */
  --text-muted: #8aa0bd; /* slate-400 */

  /* States */
  --success-color: #10b981; /* emerald-500 */
  --error-color: #ef4444;   /* red-500 */
  --warning-color: #f59e0b; /* amber-500 */
  --info-color: #3b82f6;    /* blue-500 */

  /* Shadows */
  --shadow-1: 0 6px 20px rgba(2, 6, 23, 0.35);
  --shadow-2: 0 10px 30px rgba(2, 6, 23, 0.45);
}

/* Base */
.cpdocs-root {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Tipografia: Inter como primária, com fallback moderna e suporte a sistemas */
  font-family: 'Inter', 'Inter var', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif !important;
  font-size: 16px;
  line-height: 1.6;
}

/* Links */
.cpdocs-root a { color: var(--accent-color); text-decoration: none; }
.cpdocs-root a:hover { color: var(--secondary-color); text-decoration: underline; }
/* Ensure strong contrast for inline links on dark bg */
.cpdocs-root .content a { color: #bcdff0; }
.cpdocs-root .content a:hover { color: #d6ecf6; }
/* Evitar sobreposição de cores em links dentro de code/blockquote */
.cpdocs-root .content pre a,
.cpdocs-root .content blockquote a { color: var(--accent-color) !important; border-bottom: 1px dashed rgba(255,255,255,0.25); }

/* Sidebar (TOC) */
.cpdocs-root .tocify-wrapper {
  background-color: var(--bg-secondary) !important;
  border-right: 1px solid var(--border-color) !important;
  box-shadow: none; /* remover sombras pesadas para manter minimalismo */
  width: 280px; /* mais respiro */
}
.cpdocs-root .tocify-wrapper a { 
  color: var(--text-secondary) !important; 
  display: block; 
  padding: 8px 16px; 
  border-left: 2px solid transparent; 
  position: relative;
}
.cpdocs-root .tocify-wrapper .tocify-item > a:hover { 
  color: var(--text-primary) !important; 
  background: rgba(255,255,255,0.03);
}
/* garantir que o hover não sobreponha o active */
.cpdocs-root .tocify-wrapper .tocify-item.active > a:hover { 
  background: inherit !important; 
}
/* Hierarchy & toggles (clean, right-aligned chevrons only if has children) */
.cpdocs-root .tocify-wrapper .tocify-item.level-1 > a { font-weight: 600; letter-spacing: .02em; }
.cpdocs-root .tocify-wrapper .tocify-item.level-1 > a::before { content: none; }
.cpdocs-root .tocify-wrapper .tocify-item.level-1 > a::after { content: none; }
.cpdocs-root .tocify-wrapper .tocify-item.level-1.has-children > a::after {
  content: '\25B8'; /* right triangle */
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
}
.cpdocs-root .tocify-wrapper .tocify-item.level-1.open.has-children > a::after { content: '\25BE'; /* down triangle */ }

/* remove bullets on subitems */
.cpdocs-root .tocify-wrapper .tocify-item.level-2 > a { padding-left: 28px; font-weight: 500; }
.cpdocs-root .tocify-wrapper .tocify-item.level-2 > a::before { content: none; }

.cpdocs-root .tocify-wrapper .tocify-item.level-3 > a { padding-left: 40px; font-weight: 400; }
.cpdocs-root .tocify-wrapper .tocify-item.level-3 > a::before { content: none; }
/* Active vs Open highlighting distinct */
/* Active (selected) */
.cpdocs-root .tocify-wrapper .tocify-item.active > a,
.cpdocs-root .tocify-wrapper a.tocify-focus {
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, rgba(124,58,237,0.24), rgba(124,58,237,0.12)) !important;
  color: #f5f3ff !important;
  border-left-color: var(--primary-color);
  border-radius: 12px !important;
  overflow: hidden;
}
/* Open (parent expanded), subtle neutral */
.cpdocs-root .tocify-wrapper .tocify-item.open > a {
  background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03)) !important;
  color: var(--text-secondary) !important;
  border-left-color: var(--border-light);
  border-radius: 10px;
  font-weight: 700;
}
/* se ativo e aberto, priorizar visual do ativo */
.cpdocs-root .tocify-wrapper .tocify-item.open.active > a { 
  background: linear-gradient(90deg, rgba(124,58,237,0.24), rgba(124,58,237,0.12)) !important;
  color: #f5f3ff !important;
  border-left-color: var(--primary-color) !important;
}
/* remove right dot marker entirely */
.cpdocs-root .tocify-wrapper .tocify-item.active > a::after { content: none; }
.cpdocs-root .tocify-wrapper .tocify-subheader { background: transparent !important; }
/* neutralizar quaisquer fundos no li para não esconder os cantos arredondados do link */
.cpdocs-root .tocify-wrapper .tocify-item { background: transparent !important; }
/* Remove separators between items/groups */
.cpdocs-root .tocify-wrapper .tocify-header { border-top: none; margin-top: 4px; padding-top: 4px; }
.cpdocs-root .tocify-wrapper .search input {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
}
.cpdocs-root .tocify-wrapper .search-results { background: var(--bg-secondary) !important; }

/* Floating nav button (mobile) */
.cpdocs-root #nav-button span {
  background: rgba(30,41,59,0.9) !important;
  color: var(--text-primary) !important;
}

/* Page Wrapper */
.cpdocs-root .page-wrapper {
  background: var(--bg-primary) !important;
  margin-left: 280px; /* acompanha sidebar mais larga */
}
.cpdocs-root .page-wrapper .dark-box { background: var(--bg-secondary) !important; }

/* Language selector */
.cpdocs-root .lang-selector { background: var(--bg-secondary) !important; border-bottom: 1px solid var(--border-color) !important; }
.cpdocs-root .lang-selector button {
  color: var(--text-secondary) !important;
  background: transparent !important;
  transition: all .2s ease !important;
}
.cpdocs-root .lang-selector button:hover,
.cpdocs-root .lang-selector button.active {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border-radius: 6px;
}

/* Content area */
.cpdocs-root .content {
  color: var(--text-secondary) !important;
  text-shadow: none !important; /* remover text-shadow herdado do tema padrão */
}
/* Introduction layout fix: centralizar conteúdo introdutório e primeiro bloco de código */
/* .cpdocs-root .content #introduction { text-align: center; }
.cpdocs-root .content #introduction + p,
.cpdocs-root .content #introduction + p + aside,
.cpdocs-root .content #introduction + aside {
  margin-right: 0 !important;
  float: none !important;
  width: min(900px, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
} */
/* primeiro bloco de código/annotation após a introdução */
.cpdocs-root .content #introduction ~ pre:first-of-type,
.cpdocs-root .content #introduction ~ .annotation:first-of-type {
  float: none !important;
  width: min(900px, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.cpdocs-root .content > * { box-sizing: border-box; }
.cpdocs-root .content h1,
.cpdocs-root .content h2,
.cpdocs-root .content h3,
.cpdocs-root .content h4,
.cpdocs-root .content h5,
.cpdocs-root .content h6 {
  color: var(--text-primary) !important;
  border: none !important;
  background: transparent !important;
  padding-top: .5rem !important;
  padding-bottom: .5rem !important;
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
}
.cpdocs-root .content h1 { font-size: 2.25rem !important; border-bottom: 2px solid var(--primary-color) !important; }
.cpdocs-root .content h2 { font-size: 1.5rem !important; border-bottom: 1px solid var(--border-color) !important; }
.cpdocs-root .content h3 { font-size: 1.125rem !important; color: var(--text-primary) !important; }

/* Paragraphs & lists */
.cpdocs-root .content p, 
.cpdocs-root .content li, 
.cpdocs-root .content dd, 
.cpdocs-root .content dt { color: var(--text-secondary) !important; }

/* Aside blocks (info/warn/success) */
.cpdocs-root .content aside { 
  background: var(--bg-tertiary) !important; 
  color: var(--text-secondary) !important; 
  border: 1px solid var(--border-color) !important;
  border-radius: 10px;
}
.cpdocs-root .content aside.info { background: rgba(59, 130, 246, 0.15) !important; color: #bfdbfe !important; }
.cpdocs-root .content aside.warning { background: rgba(245, 158, 11, 0.15) !important; color: #fde68a !important; }
.cpdocs-root .content aside.success { background: rgba(16, 185, 129, 0.15) !important; color: #a7f3d0 !important; }

/* Badges */
.cpdocs-root .badge { box-shadow: none !important; text-shadow: none !important; }
.cpdocs-root .badge.badge-darkred { background: #b91c1c !important; }
.cpdocs-root .badge.badge-red { background: #ef4444 !important; }
.cpdocs-root .badge.badge-blue { background: #3b82f6 !important; }
.cpdocs-root .badge.badge-darkblue { background: #1e40af !important; }
.cpdocs-root .badge.badge-green { background: #10b981 !important; }
.cpdocs-root .badge.badge-darkgoldenrod { background: #b45309 !important; }
.cpdocs-root .badge.badge-darkgreen { background: #065f46 !important; }
.cpdocs-root .badge.badge-purple { background: #7c3aed !important; }
.cpdocs-root .badge.badge-black { background: #0f172a !important; }
.cpdocs-root .badge.badge-grey { background: #475569 !important; }

/* Tables */
.cpdocs-root .content table { 
  background: var(--bg-card) !important; 
  border: 1px solid var(--border-color) !important; 
  border-radius: 8px; 
  overflow: hidden;
}
.cpdocs-root .content table th { background: var(--bg-tertiary) !important; color: var(--text-primary) !important; border-bottom: 1px solid var(--border-color) !important; }
.cpdocs-root .content table td { color: var(--text-secondary) !important; border-top: 1px solid var(--border-color) !important; }
.cpdocs-root .content table tr:nth-child(odd) > td,
.cpdocs-root .content table tr:nth-child(even) > td { background: transparent !important; }

/* Code blocks & inline code */
.cpdocs-root .content pre,
.cpdocs-root .content blockquote {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px !important;
  box-shadow: none; /* minimalista: sem sombras nos blocos de texto/código */
}
.cpdocs-root .content code { 
  background: rgba(34, 211, 238, 0.08) !important; 
  color: var(--accent-color) !important; 
  border-radius: 6px !important; 
}
.cpdocs-root .hljs { background: var(--bg-tertiary) !important; }

/* Forms and inputs inside docs */
.cpdocs-root .content input,
.cpdocs-root .content select,
.cpdocs-root .content textarea {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  padding: .5rem .75rem !important;
}
.cpdocs-root .content input:focus,
.cpdocs-root .content select:focus,
.cpdocs-root .content textarea:focus {
  outline: none !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25) !important;
}

/* Fancy heading panels */
.cpdocs-root .fancy-heading-panel {
  background: rgba(124, 58, 237, 0.08) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
}

/* Try it out buttons - override inline styles by using attribute selectors */
.cpdocs-root [id^="btn-tryout-"] {
  background: linear-gradient(135deg, var(--info-color), #2563eb) !important;
  color: #fff !important;
  border-radius: 8px !important;
  border: none !important;
  padding: 6px 12px !important;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35) !important;
  transition: transform .15s ease, box-shadow .15s ease !important;
}
.cpdocs-root [id^="btn-tryout-"]:hover { transform: translateY(-1px) !important; box-shadow: 0 10px 24px rgba(59, 130, 246, 0.5) !important; }

.cpdocs-root [id^="btn-canceltryout-"] {
  background: linear-gradient(135deg, var(--error-color), #b91c1c) !important;
  color: #fff !important;
  border-radius: 8px !important;
  border: none !important;
  padding: 6px 12px !important;
}

.cpdocs-root [id^="btn-executetryout-"] {
  background: linear-gradient(135deg, var(--success-color), #059669) !important;
  color: #fff !important;
  border-radius: 8px !important;
  border: none !important;
  padding: 6px 12px !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35) !important;
}

/* Search highlight */
.cpdocs-root .content .search-highlight {
  background: rgba(250, 204, 21, 0.18) !important;
  border: 1px solid rgba(250, 204, 21, 0.35) !important;
  text-shadow: none !important;
}

/* Annotations & response headers blocks */
.cpdocs-root .content .annotation {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
}

/* Horizontal rule */
.cpdocs-root .content hr { border: none !important; height: 1px; background: var(--border-color) !important; }

/* Scrollbar */
.cpdocs-root * { scrollbar-color: var(--border-color) transparent; }
.cpdocs-root *::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
.cpdocs-root *::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 6px; }
.cpdocs-root *::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* Cards look for endpoints: wrap large sections visually */
/* The default HTML nests forms/sections under .content. We'll soften large blocks using subtle separators. */
.cpdocs-root .content form[id^="form-"] {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  margin: 1rem 0 2rem;
  box-shadow: none; /* manter minimalista */
}

/* Make long JSON/code outputs more readable */
.cpdocs-root .content pre code { 
  font-size: 0.95rem !important; 
  line-height: 1.55 !important; 
  text-shadow: none !important; /* garantir sem sombra no texto de código */
}

/* Mobile adjustments */
@media (max-width: 1024px) {
  .cpdocs-root .tocify-wrapper { width: 240px; }
  .cpdocs-root .page-wrapper { margin-left: 240px; }
}
@media (max-width: 930px) {
  .cpdocs-root .tocify-wrapper { left: -240px; width: 240px; position: fixed; z-index: 1000; transition: left .25s ease; }
  .cpdocs-root .tocify-wrapper.open { left: 0; }
  .cpdocs-root #nav-button { display: block; }
  .cpdocs-root .page-wrapper { margin-left: 0; }
}
@media (max-width: 700px) {
  .cpdocs-root .content { padding: 0 14px; }
  .cpdocs-root .content pre,
  .cpdocs-root .content blockquote,
  .cpdocs-root .content .annotation { border-radius: 8px !important; }
  /* touch targets and spacing in sidebar */
  .cpdocs-root .tocify-wrapper a { padding: 10px 18px; }
}
