/* API Hub Documentation - Styles */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #1f2937;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Top Bar */
.topbar {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.topbar-title span {
    color: #dc2626;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    font-size: 13px;
    color: #888;
}

.btn-logout {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid #dc2626;
    border-radius: 6px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
    color: #fff;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #1a1a2e;
    overflow-y: auto;
    z-index: 200;
    padding-bottom: 40px;
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a3e;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-header h2 span {
    color: #dc2626;
}

.sidebar-header p {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.sidebar-nav {
    padding: 16px 0;
}

/* Module header na sidebar — nível superior a section (agrupa várias secções) */
.nav-module-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px 10px 24px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 18px;
    background: linear-gradient(180deg, #2a2a3e 0%, #1e1e2e 100%);
    border-top: 1px solid #30303e;
    border-bottom: 2px solid #dc2626;
}

.nav-module-title:first-child {
    margin-top: 0;
}

.nav-module-icon {
    font-size: 15px;
    filter: grayscale(0.1);
}

/* Section title — sub-agrupamento dentro de um módulo */
.nav-section-title {
    padding: 10px 24px 6px 24px;
    font-size: 10px;
    font-weight: 700;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}

.nav-link {
    display: block;
    padding: 7px 24px 7px 32px;
    font-size: 13px;
    color: #999;
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #dc2626;
}

.nav-link.active {
    color: #ffffff;
    background: rgba(220, 38, 38, 0.12);
    border-left-color: #dc2626;
    font-weight: 500;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    margin-top: 60px;
    padding: 40px 48px;
    max-width: 1100px;
}

.doc-section {
    background: #ffffff;
    border-radius: 10px;
    padding: 36px 40px;
    margin-bottom: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #eee;
}

/* Module header — grande banner que introduz um módulo inteiro */
.module-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #2a1a3e 100%);
    border-radius: 12px;
    padding: 32px 40px;
    margin: 48px 0 32px 0;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 8px 24px rgba(26, 26, 46, 0.2);
    position: relative;
    overflow: hidden;
}

.module-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 85% 30%, rgba(220, 38, 38, 0.18), transparent 55%),
        radial-gradient(circle at 15% 80%, rgba(168, 85, 247, 0.12), transparent 50%);
    pointer-events: none;
}

.module-header-icon {
    font-size: 56px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 1;
}

.module-header-content {
    position: relative;
    z-index: 1;
}

.module-header h1 {
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.module-header p {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.65;
    margin: 0;
    max-width: 720px;
}

/* Primeiro module-header no topo da página não precisa do margin-top grande */
main.main-content > .module-header:first-of-type {
    margin-top: 24px;
}

.doc-section h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.doc-section h3 {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-top: 28px;
    margin-bottom: 12px;
}

.doc-section p {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.7;
}

.doc-section ul, .doc-section ol {
    padding-left: 24px;
    margin-bottom: 12px;
}

.doc-section li {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
}

/* Endpoint blocks */
.endpoint {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.method-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-get {
    background: #dcfce7;
    color: #166534;
}

.method-post {
    background: #dbeafe;
    color: #1e40af;
}

.method-put {
    background: #fef3c7;
    color: #92400e;
}

.method-delete {
    background: #fee2e2;
    color: #991b1b;
}

.endpoint-url {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.endpoint-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}

.auth-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Parameters table */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.params-table th {
    background: #f0f0f0;
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #ddd;
}

.params-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.params-table code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    color: #c7254e;
}

.param-required {
    color: #dc2626;
    font-weight: 600;
    font-size: 11px;
}

.param-optional {
    color: #888;
    font-size: 11px;
}

/* ===================================================================
   Code blocks — "One Dark Pro" inspired theme com melhor legibilidade
   =================================================================== */
pre {
    position: relative;
    background: #0d1117;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    margin: 16px 0;
    border: 1px solid #30363d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

/* Fake header com "dots" estilo terminal + label opcional */
pre::before {
    content: '';
    display: block;
    padding: 10px 16px;
    background: linear-gradient(180deg, #21262d 0%, #161b22 100%);
    border-bottom: 1px solid #30363d;
    background-image:
        radial-gradient(circle at 16px 50%, #ff5f57 0 6px, transparent 6px),
        radial-gradient(circle at 34px 50%, #febc2e 0 6px, transparent 6px),
        radial-gradient(circle at 52px 50%, #28c840 0 6px, transparent 6px),
        linear-gradient(180deg, #21262d 0%, #161b22 100%);
    background-repeat: no-repeat;
    height: 36px;
    box-sizing: border-box;
}

pre code {
    display: block;
    padding: 20px 22px 22px 22px;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #c9d1d9;
    overflow-x: auto;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
    tab-size: 4;
    white-space: pre;
    background: transparent;
    border-radius: 0;
}

/* Scrollbar estilizada para blocos de código */
pre code::-webkit-scrollbar {
    height: 10px;
}

pre code::-webkit-scrollbar-track {
    background: #161b22;
}

pre code::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
}

pre code::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* JSON syntax highlighting — cores com mais contraste, inspiradas One Dark */
.json-key { color: #79c0ff; font-weight: 500; }        /* azul claro - chaves */
.json-string { color: #a5d6ff; }                       /* ciano - strings */
.json-number { color: #ffa657; font-weight: 500; }     /* laranja - números */
.json-bool { color: #ff7b72; font-weight: 600; }       /* vermelho-rosa - booleanos */
.json-null { color: #8b949e; font-style: italic; }     /* cinza - null */

/* Inline code — melhor contraste sobre fundo claro */
code {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', 'Cascadia Code', monospace;
    font-size: 12.5px;
    background: #f3f4f6;
    padding: 2px 7px;
    border-radius: 4px;
    color: #dc2626;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

/* Dentro de tabelas e parágrafos, inline code mais discreto */
.params-table code,
.error-table code {
    background: #f9fafb;
    color: #1e40af;
    font-weight: 500;
    border: 1px solid #e5e7eb;
}

/* Language label no canto direito do header do pre */
pre[data-lang]::after {
    content: attr(data-lang);
    position: absolute;
    top: 10px;
    right: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b949e;
    background: rgba(139, 148, 158, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Inter', -apple-system, sans-serif;
    pointer-events: none;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 16px;
}

/* Botão de copiar */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: rgba(139, 148, 158, 0.15);
    border: 1px solid rgba(139, 148, 158, 0.25);
    color: #c9d1d9;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s;
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1;
    height: 22px;
    opacity: 0.6;
}

pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: rgba(139, 148, 158, 0.25);
    border-color: rgba(139, 148, 158, 0.4);
    color: #ffffff;
}

.copy-btn.copied {
    background: rgba(35, 134, 54, 0.25);
    border-color: rgba(35, 134, 54, 0.5);
    color: #7ee787;
    opacity: 1;
}

.copy-btn svg {
    flex-shrink: 0;
}

/* Error code table */
.error-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
}

.error-table th {
    background: #f0f0f0;
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #ddd;
}

.error-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.error-table code {
    font-size: 12px;
}

/* Alert/info boxes */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
    color: #1e40af;
}

.warning-box {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
    color: #92400e;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    .topbar {
        left: 240px;
    }
    .main-content {
        margin-left: 240px;
        padding: 32px 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .topbar {
        left: 0;
    }
    .main-content {
        margin-left: 0;
        padding: 24px 16px;
    }
    .doc-section {
        padding: 24px 20px;
    }
}
