/**
 * docs-base.css
 * Variáveis CSS, reset básico e tipografia para documentação
 * Parte do sistema modular de documentação da API
 * Versão otimizada com melhorias de legibilidade e UX
 */

/* ========================================
   VARIÁVEIS CSS
   ======================================== */
:root {
    /* =============================================
       ALIASES para compatibilidade com docs-base
       (mapeiam para as variáveis do sistema de temas)
       ============================================= */

    /* Aliases de texto */
    --text-primary: var(--color-text);
    --text-secondary: var(--color-text-muted);
    --text-tertiary: var(--color-text-muted);
    --text-light: #FFFFFF;
    --text-muted: var(--color-text-muted);

    /* Aliases de borda */
    --border-light: var(--border-color);
    --border-dark: var(--border-color-light);

    /* Aliases de fundo */
    --bg-card: var(--bg-surface);
    --bg-code: var(--code-bg);

    /* Aliases de cores de estado */
    --color-success-light: var(--color-success-bg);
    --color-warning-light: var(--color-warning-bg);
    --color-danger-light: var(--color-danger-bg);
    --color-info-light: var(--color-info-bg);

    /* Aliases de cores primárias para docs */
    --color-primary-light: var(--input-focus-shadow);
    --color-secondary-light: rgba(0, 170, 255, 0.1);
    --color-white: #FFFFFF;

    /* Métodos HTTP */
    --method-get: #28a745;
    --method-post: #0099cc;
    --method-put: #c58b2d;
    --method-delete: #dc3545;
    --method-patch: #17a2b8;

    /* Tipografia */
    --font-family: "Roboto", -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;

    /* Tamanhos de fonte */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Pesos de fonte */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Line heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.7;
    --line-height-loose: 2;

    /* Letter spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;

    /* Espaçamento */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --spacing-4xl: 6rem;

    /* Border radius (zerado conforme padrão do projeto) */
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
    --radius-2xl: 0;
    --radius-full: 0;

    /* Sombras */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.1);

    /* Transições */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Z-index */
    --z-base: 0;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* Layout */
    --container-max-width: 1200px;
    --content-max-width: 65ch;
    --sidebar-width: 280px;
    --header-height: 70px;

    /* Scroll */
    --scroll-padding: 80px;
}

/* ========================================
   RESET BÁSICO APRIMORADO
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    scroll-padding-top: var(--scroll-padding);
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    color: var(--color-text);
    background-color: var(--bg-page);
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
}

/* ========================================
   TIPOGRAFIA OTIMIZADA
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    letter-spacing: var(--letter-spacing-tight);
}

h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

h1:first-child {
    margin-top: 0;
}

h2 {
    font-size: var(--font-size-3xl);
    margin-top: var(--spacing-2xl);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-light);
}

h3 {
    font-size: var(--font-size-2xl);
    margin-top: var(--spacing-xl);
}

h4 {
    font-size: var(--font-size-xl);
    margin-top: var(--spacing-lg);
}

h5 {
    font-size: var(--font-size-lg);
    margin-top: var(--spacing-lg);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-top: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

p {
    margin-bottom: var(--spacing-lg);
    line-height: var(--line-height-relaxed);
}

p:last-child {
    margin-bottom: 0;
}

/* Links com melhor feedback visual */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

a:hover {
    color: var(--color-primary-hover);
}

a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 0;
}

a:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

strong, b {
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

mark {
    background-color: var(--color-warning-light);
    color: var(--text-primary);
    padding: 0.1em 0.3em;
    border-radius: 0;
}

/* Code inline com melhor destaque */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.2em 0.5em;
    background-color: var(--bg-code);
    border: 1px solid var(--border-light);
    border-radius: 0;
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

/* Code blocks com melhor legibilidade */
pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    padding: var(--spacing-lg);
    background-color: var(--bg-code);
    border: 1px solid var(--border-light);
    border-radius: 0;
    overflow-x: auto;
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-xs);
}

pre code {
    padding: 0;
    background-color: transparent;
    border: none;
    color: inherit;
    font-size: inherit;
}

/* Code dentro de pre com cor clara */
pre code {
    color: var(--code-text);
    background-color: transparent;
    border: none;
    padding: 0;
}

/* Ajustar cor do texto em elementos pre */
pre {
    color: var(--code-text);
}

/* Blockquotes */
blockquote {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    border-left: 4px solid var(--color-primary);
    background-color: var(--bg-secondary);
    border-radius: 0;
    font-style: italic;
    color: var(--text-secondary);
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* ========================================
   LISTAS OTIMIZADAS
   ======================================== */
ul, ol {
    margin-bottom: var(--spacing-lg);
    padding-left: var(--spacing-xl);
}

li {
    margin-bottom: var(--spacing-sm);
    line-height: var(--line-height-relaxed);
}

li:last-child {
    margin-bottom: 0;
}

ul ul, ol ol, ul ol, ol ul {
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

/* Listas sem marcadores */
ul.list-none,
ol.list-none {
    list-style: none;
    padding-left: 0;
}

/* ========================================
   TABELAS APRIMORADAS
   ======================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-xl);
    font-size: var(--font-size-sm);
}

th, td {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: var(--font-weight-semibold);
    background-color: var(--color-primary);
    color: #FFFFFF;
    text-transform: uppercase;
    font-size: var(--font-size-xs);
    letter-spacing: var(--letter-spacing-wide);
}

tbody tr {
    transition: background-color var(--transition-fast);
}

tbody tr:hover {
    background-color: var(--bg-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Zebra striping para melhor leitura */
tbody tr:nth-child(even) {
    background-color: var(--bg-secondary);
}

tbody tr:nth-child(even):hover {
    background-color: var(--bg-tertiary);
}

/* ========================================
   IMAGENS E MÍDIA
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
}

svg {
    max-width: 100%;
    height: auto;
}

/* SVG icons dentro de botões devem usar stroke, não fill */
.btn-icon svg {
    fill: none !important;
    stroke: currentColor;
}

figure {
    margin: var(--spacing-xl) 0;
}

figcaption {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
}

/* ========================================
   FORMULÁRIOS
   ======================================== */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    transition: all var(--transition-fast);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

button:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   UTILITÁRIOS DE ACESSIBILIDADE
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: var(--spacing-md);
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-lg);
    text-decoration: none;
    border-radius: 0;
    z-index: var(--z-tooltip);
    font-weight: var(--font-weight-semibold);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--spacing-md);
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

/* Focus visible para todos os elementos interativos */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 0;
}

/* ========================================
   UTILITÁRIOS DE LAYOUT
   ======================================== */
.container {
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-lg);
    flex: 1;
}

.content-wrapper {
    flex: 1;
}

/* ========================================
   SCROLLBAR CUSTOMIZADA
   ======================================== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 0;
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 0;
    border: 2px solid var(--bg-secondary);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

::-webkit-scrollbar-thumb:active {
    background: var(--text-primary);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) var(--bg-secondary);
}

/* ========================================
   SELEÇÃO DE TEXTO
   ======================================== */
::selection {
    background-color: var(--color-primary);
    color: var(--color-white);
    text-shadow: none;
}

::-moz-selection {
    background-color: var(--color-primary);
    color: var(--color-white);
    text-shadow: none;
}

/* ========================================
   UTILITÁRIOS DE ESPAÇAMENTO
   ======================================== */
.mt-0 { margin-top: 0 !important; }
.mt-sm { margin-top: var(--spacing-sm) !important; }
.mt-md { margin-top: var(--spacing-md) !important; }
.mt-lg { margin-top: var(--spacing-lg) !important; }
.mt-xl { margin-top: var(--spacing-xl) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-sm { margin-bottom: var(--spacing-sm) !important; }
.mb-md { margin-bottom: var(--spacing-md) !important; }
.mb-lg { margin-bottom: var(--spacing-lg) !important; }
.mb-xl { margin-bottom: var(--spacing-xl) !important; }

.pt-0 { padding-top: 0 !important; }
.pt-sm { padding-top: var(--spacing-sm) !important; }
.pt-md { padding-top: var(--spacing-md) !important; }
.pt-lg { padding-top: var(--spacing-lg) !important; }
.pt-xl { padding-top: var(--spacing-xl) !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-sm { padding-bottom: var(--spacing-sm) !important; }
.pb-md { padding-bottom: var(--spacing-md) !important; }
.pb-lg { padding-bottom: var(--spacing-lg) !important; }
.pb-xl { padding-bottom: var(--spacing-xl) !important; }

/* ========================================
   TEMA CLARO — OVERRIDES DE LEGIBILIDADE (docs-base)
   ======================================== */
[data-theme="light"] body {
    color: #1a1a1a;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
    color: #1a1a1a;
}

[data-theme="light"] p,
[data-theme="light"] li,
[data-theme="light"] td,
[data-theme="light"] th {
    color: #1a1a1a;
}

[data-theme="light"] small,
[data-theme="light"] figcaption,
[data-theme="light"] blockquote {
    color: #555555;
}

[data-theme="light"] strong,
[data-theme="light"] b {
    color: #1a1a1a;
}

[data-theme="light"] a {
    color: #0077aa;
}

[data-theme="light"] a:hover {
    color: #005588;
}

[data-theme="light"] code {
    background-color: #f0ece8;
    border-color: #c8c0b8;
    color: #0077aa;
}

[data-theme="light"] pre {
    background-color: #f0ece8;
    border-color: #c8c0b8;
    color: #1a1a1a;
}

[data-theme="light"] pre code {
    color: #1a1a1a;
    background-color: transparent;
    border: none;
}
