/* ========================================
   Moclick Bridge - CSS Principal
   ======================================== */

/* 1. VARIÁVEIS E RESET */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --text: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --border: #e5e7eb;
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --sidebar-width: 280px;
    --header-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6; color: var(--text); background: var(--bg);
    font-size: 16px;
}

/* 2. HEADER */
.header {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
    background: var(--bg); border-bottom: 1px solid var(--border); z-index: 1000;
    display: flex; align-items: center; padding: 0 24px;
}
.header-logo {
    display: flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: 16px; color: var(--text); text-decoration: none;
    flex-shrink: 0;
}
.header-logo span { color: var(--primary); font-weight: 700; }
.header-nav { margin-left: auto; display: flex; gap: 24px; }
.header-nav a {
    color: var(--text-secondary); text-decoration: none;
    font-size: 14px; transition: color 0.2s;
}
.header-nav a:hover { color: var(--text); }
.header-nav a.active { color: var(--primary); font-weight: 500; }
.menu-toggle { display: none; }

/* 3. LAYOUT E SIDEBAR */
.layout { display: flex; margin-top: var(--header-height); min-height: calc(100vh - var(--header-height)); }
.sidebar {
    position: fixed; width: var(--sidebar-width); height: calc(100vh - var(--header-height));
    background: var(--bg); border-right: 1px solid var(--border); overflow-y: auto;
    padding: 24px 0; z-index: 100;
}
.sidebar-section { margin-bottom: 32px; padding: 0 20px; }
.sidebar-title {
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
    margin-bottom: 12px; padding: 0 12px;
}
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a {
    display: block; padding: 6px 12px; color: var(--text-secondary);
    text-decoration: none; font-size: 14px; border-radius: 4px;
    transition: all 0.15s;
}
.sidebar-nav a:hover { color: var(--text); background: var(--bg-secondary); }
.sidebar-nav a.active { color: var(--primary); background: var(--primary-light); font-weight: 500; }
.main { margin-left: var(--sidebar-width); flex: 1; max-width: 800px; padding: 48px 48px 80px; }

/* 4. TIPOGRAFIA */
h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px; line-height: 1.25; }
h2 { font-size: 24px; font-weight: 600; margin-top: 48px; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h3 { font-size: 18px; font-weight: 600; margin-top: 32px; margin-bottom: 12px; }
p { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.7; }
ul, ol { margin: 16px 0; padding-left: 24px; color: var(--text-secondary); }
li { margin-bottom: 8px; line-height: 1.7; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 5. COMPONENTES GERAIS */
.intro { margin-bottom: 48px; }
.intro p { font-size: 18px; color: var(--text-secondary); line-height: 1.6; }
.note {
    background: var(--bg-secondary); border-left: 3px solid var(--primary);
    padding: 16px 20px; margin: 24px 0;
}
.note p { margin: 0; }
.note p + p { margin-top: 12px; }
.quick-links { margin: 32px 0; }
.quick-links h3 { margin-top: 0; font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.link-list { list-style: none; padding: 0; }
.link-list li { margin-bottom: 12px; }
.link-list a {
    display: flex; align-items: baseline; gap: 8px;
    color: var(--text); font-weight: 500;
}
.link-list a:hover { color: var(--primary); text-decoration: none; }
.link-list a span { color: var(--text-muted); font-weight: 400; }
.footer {
    margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 14px;
}

/* 6. SEÇÃO VANTAGENS */
#vantagens { margin: 48px 0; }
#vantagens h2 { font-size: 24px; font-weight: 600; margin-bottom: 32px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.advantages-list { display: flex; flex-direction: column; gap: 24px; }
.advantage-item { padding: 24px 0; border-bottom: 1px solid var(--border); }
.advantage-item:last-child { border-bottom: none; }
.advantage-item h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; margin-top: 0; }
.advantage-item p { font-size: 15px; line-height: 1.7; color: var(--text-secondary); margin: 0; max-width: 720px; }

/* 7. SEÇÃO INVENTÁRIO */
#inventario { margin: 48px 0; }
#inventario h2 { font-size: 24px; font-weight: 600; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
#inventario h3 { font-size: 18px; font-weight: 600; margin-top: 32px; margin-bottom: 16px; }
.publishers-highlight { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 20px 0; }
.publisher-group h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; margin-top: 0; }
.publisher-group ul { list-style: none; padding: 0; margin: 0; }
.publisher-group li { font-size: 14px; color: var(--text-secondary); padding: 4px 0; border-bottom: 1px solid var(--border); }
.publisher-group li:last-child { border-bottom: none; }

/* 8. RESPONSIVO - MOBILE */
@media (max-width: 1024px) {
    .header { justify-content: flex-start; gap: 16px; }
    .header-nav { display: none; }
    .menu-toggle {
        display: flex; flex-direction: column; justify-content: center; align-items: center;
        background: none; border: none; cursor: pointer; padding: 8px;
        width: 44px; height: 44px; gap: 5px; order: -1;
    }
    .menu-toggle span {
        display: block; width: 22px; height: 2.5px;
        background-color: var(--text); background: var(--text);
        border-radius: 1px; transition: all 0.3s ease;
    }
    .menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
    
    .sidebar {
        position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0;
        width: 100%; height: calc(100vh - var(--header-height));
        background: var(--bg); z-index: 999;
        transform: translateX(-100%); transition: transform 0.3s ease;
        border-right: none; padding-top: 16px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay {
        display: none; position: fixed; top: var(--header-height);
        left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 998;
    }
    .sidebar-overlay.active { display: block; }
    .sidebar-section:not(.mobile-menu) { display: none; }
    .sidebar-section.mobile-menu { display: block; }
    .mobile-menu .sidebar-nav a { padding: 12px 16px; font-size: 16px; border-bottom: 1px solid var(--border); border-radius: 0; }
    .mobile-menu .sidebar-nav a.active { background: var(--primary-light); }
    .main { margin-left: 0; padding: 32px 24px; max-width: 100%; }
    h1 { font-size: 28px; }
    h2 { font-size: 20px; }
}
@media (max-width: 768px) { .publishers-highlight { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .publishers-highlight { grid-template-columns: 1fr; } }
@media (min-width: 1025px) { .sidebar-section.mobile-menu { display: none; } }

/* 9. COMPONENTES DE DOCUMENTAÇÃO TÉCNICA */
.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre;
}

.code-block code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Cores do syntax highlighting */
.code-block .comment { color: #6a9955; }
.code-block .string { color: #ce9178; }
.code-block .keyword { color: #569cd6; }
.code-block .tag { color: #569cd6; }
.code-block .attr { color: #9cdcfe; }
.code-block .function { color: #dcdcaa; }
.code-block .number { color: #b5cea8; }
.code-block .operator { color: #d4d4d4; }
.code-block .variable { color: #9cdcfe; }
.code-block .highlight-slug { color: #fbbf24; font-weight: 600; }

/* Para código puro sem classes (fallback) */
.code-block pre {
    margin: 0;
    white-space: pre;
    word-wrap: normal;
}

/* Endpoint API */
.endpoint {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    margin: 20px 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    font-size: 14px;
    word-break: break-word;
}

.endpoint-method {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

/* Tabelas */
.table-wrap {
    overflow-x: auto;
    margin: 24px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tr:hover td {
    background: var(--bg-secondary);
}

/* Checklist */
.checklist {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    position: relative;
    padding-left: 28px;
}

.checklist li::before {
    content: "□";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 18px;
    line-height: 1.4;
}

/* Elementos inline de código */
code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary-dark);
}

/* Títulos de seção específicos */
h4 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* 10. COMPONENTES DE ARQUITETURA - DESIGN LIMPO */
.component-list {
    margin: 24px 0;
}

.component-item {
    padding: 0;
    margin-bottom: 32px;
    border: none;
    background: transparent;
}

.component-item:last-child {
    margin-bottom: 0;
}

.component-item h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    color: var(--text);
    font-weight: 600;
}

.component-item ul {
    margin: 0;
    padding-left: 20px;
}

.component-item li {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.component-item li:last-child {
    margin-bottom: 0;
}

/* ========================================
   12. COMPONENTES DE FAQ
   ======================================== */

.faq-item {
    margin-bottom: 24px;
}

.faq-question {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    font-size: 16px;
}

.faq-answer {
    color: var(--text-secondary);
}

.faq-answer p {
    margin-bottom: 12px;
}

.faq-answer ul,
.faq-answer ol {
    margin: 12px 0;
}

/* ========================================
   13. COMPONENTES DE TERMOS DE USO
   ======================================== */

.intro-description {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.version-badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.definition-list {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 24px;
    margin: 24px 0;
}

.definition-list dt {
    font-weight: 700;
    margin-top: 16px;
    color: var(--text);
}

.definition-list dt:first-child {
    margin-top: 0;
}

.definition-list dd {
    margin-left: 0;
    margin-top: 4px;
    color: var(--text-secondary);
}

.note-warning {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.note-warning strong {
    color: #d97706;
}

.acceptance-box {
    background: var(--primary);
    color: white;
    padding: 32px;
    border-radius: 8px;
    text-align: center;
    margin: 48px 0;
}

.acceptance-box h3 {
    margin-top: 0;
    font-size: 20px;
    margin-bottom: 12px;
    color: white;
}

.acceptance-box p {
    margin: 0;
    opacity: 0.9;
    color: white;
}