/* Documentacion publica - WA API
   Paleta: WhatsApp green + indigo + blanco, mobile-first
*/

:root {
    --docs-green: #25D366;
    --docs-green-dark: #128C7E;
    --docs-green-darker: #075E54;
    --docs-primary: #6366F1;
    --docs-primary-dark: #4F46E5;
    --docs-text: #111827;
    --docs-text-secondary: #4B5563;
    --docs-text-muted: #9CA3AF;
    --docs-bg: #FFFFFF;
    --docs-bg-soft: #F9FAFB;
    --docs-border: #E5E7EB;
    --docs-code-bg: #1F2937;
    --docs-code-text: #E5E7EB;
    --docs-method-get: #10B981;
    --docs-method-post: #3B82F6;
    --docs-method-put: #F59E0B;
    --docs-method-delete: #EF4444;
    --docs-radius: 8px;
    --docs-radius-md: 12px;
    --docs-radius-lg: 16px;
    --docs-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
    --docs-shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--docs-text);
    background: var(--docs-bg-soft);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--docs-primary); text-decoration: none; transition: color 150ms; }
a:hover { color: var(--docs-primary-dark); }
code {
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
    font-size: 13px;
    background: var(--docs-bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--docs-text);
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }

/* Header */
.docs-header {
    background: white;
    border-bottom: 1px solid var(--docs-border);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--docs-shadow);
}
.docs-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.docs-logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; color: var(--docs-text); font-size: 18px;
    text-decoration: none;
}
.docs-logo-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white;
}
.docs-search {
    flex: 1; min-width: 200px;
    position: relative;
    max-width: 480px;
}
.docs-search input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    font-size: 14px;
    background: var(--docs-bg-soft);
    transition: all 150ms;
}
.docs-search input:focus {
    outline: none;
    border-color: var(--docs-green);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}
.docs-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--docs-text-muted); pointer-events: none;
}
.docs-nav {
    display: flex; gap: 16px;
}
.docs-nav a {
    color: var(--docs-text-secondary);
    font-weight: 500;
    font-size: 14px;
    padding: 6px 0;
}
.docs-nav a:hover { color: var(--docs-green); }

/* Main */
.docs-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.docs-breadcrumb {
    font-size: 13px;
    color: var(--docs-text-muted);
    margin-bottom: 20px;
}
.docs-breadcrumb a { color: var(--docs-text-secondary); }
.docs-breadcrumb a:hover { color: var(--docs-green); }

/* Hero */
.docs-hero {
    text-align: center;
    padding: 40px 0 50px;
}
.docs-hero h1 {
    font-size: 42px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #075E54 0%, #128C7E 50%, #25D366 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.docs-hero p {
    font-size: 18px;
    color: var(--docs-text-secondary);
    max-width: 640px;
    margin: 0 auto 24px;
}
.docs-hero-actions {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

.docs-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 20px;
    border-radius: var(--docs-radius);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 150ms;
    border: 1px solid transparent;
}
.docs-btn-primary {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}
.docs-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4); }
.docs-btn-secondary {
    background: white;
    color: var(--docs-text);
    border-color: var(--docs-border);
}
.docs-btn-secondary:hover { border-color: var(--docs-primary); color: var(--docs-primary); }

/* Features */
.docs-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}
.docs-feature {
    background: white;
    border-radius: var(--docs-radius-md);
    padding: 20px;
    box-shadow: var(--docs-shadow);
    border: 1px solid var(--docs-border);
    transition: all 200ms;
}
.docs-feature:hover { transform: translateY(-2px); box-shadow: var(--docs-shadow-md); }
.docs-feature-icon {
    width: 48px; height: 48px;
    border-radius: var(--docs-radius);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.docs-feature h3 { font-size: 15px; margin-bottom: 6px; }
.docs-feature p { font-size: 13px; color: var(--docs-text-secondary); margin: 0; }

/* Section */
.docs-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--docs-border);
}
.docs-section-header h2 { font-size: 24px; }

.docs-section { margin-bottom: 40px; }
.docs-section h2 { font-size: 22px; margin-bottom: 16px; }

/* Endpoint cards */
.docs-category { margin-bottom: 32px; }
.docs-category-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--docs-text-muted); font-weight: 600;
    margin-bottom: 12px;
}
.docs-category-bullet {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--docs-green);
}
.docs-category-count {
    background: var(--docs-bg-soft);
    color: var(--docs-text-secondary);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    margin-left: 4px;
}
.docs-endpoints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.docs-endpoint-card {
    background: white;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius-md);
    padding: 20px;
    text-decoration: none;
    color: var(--docs-text);
    transition: all 200ms;
    display: block;
}
.docs-endpoint-card:hover {
    border-color: var(--docs-green);
    transform: translateY(-2px);
    box-shadow: var(--docs-shadow-md);
}
.docs-endpoint-card-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
}
.docs-method {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
}
.docs-method-get { background: var(--docs-method-get); }
.docs-method-post { background: var(--docs-method-post); }
.docs-method-put { background: var(--docs-method-put); }
.docs-method-delete { background: var(--docs-method-delete); }
.docs-endpoint-card-path {
    font-size: 12px;
    background: transparent;
    padding: 0;
    color: var(--docs-text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.docs-endpoint-card h3 { font-size: 15px; margin-bottom: 4px; }
.docs-endpoint-card p { font-size: 13px; color: var(--docs-text-secondary); margin: 0 0 12px; }
.docs-endpoint-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px;
    color: var(--docs-text-muted);
}
.docs-tag {
    background: var(--docs-bg-soft);
    color: var(--docs-text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.docs-arrow { color: var(--docs-green); font-weight: 500; }

/* Endpoint detail */
.docs-endpoint-header { margin-bottom: 32px; }
.docs-endpoint-header h1 { font-size: 32px; margin-bottom: 8px; }
.docs-endpoint-header > p { color: var(--docs-text-secondary); font-size: 16px; margin-bottom: 16px; }
.docs-endpoint-summary {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 18px;
    background: white;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}
.docs-endpoint-path { background: transparent; padding: 0; color: var(--docs-text); font-weight: 500; }
.docs-endpoint-auth {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: auto;
    color: var(--docs-text-muted);
    font-size: 12px;
    font-family: inherit;
}

/* Params table */
.docs-params-table-wrap { overflow-x: auto; }
.docs-params-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--docs-radius);
    overflow: hidden;
    box-shadow: var(--docs-shadow);
}
.docs-params-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--docs-text-muted);
    font-weight: 600;
    background: var(--docs-bg-soft);
    border-bottom: 1px solid var(--docs-border);
}
.docs-params-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--docs-border);
    vertical-align: top;
}
.docs-params-table tr:last-child td { border-bottom: none; }
.docs-param-name {
    background: rgba(99, 102, 241, 0.08);
    color: var(--docs-primary-dark);
    font-weight: 500;
}
.docs-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.docs-type-string { background: #DBEAFE; color: #1E40AF; }
.docs-type-int { background: #FEF3C7; color: #92400E; }
.docs-type-boolean { background: #D1FAE5; color: #065F46; }
.docs-type-date { background: #FCE7F3; color: #9D174D; }
.docs-req-yes { color: #DC2626; font-weight: 600; font-size: 13px; }
.docs-req-no { color: var(--docs-text-muted); font-size: 13px; }

/* Response */
.docs-response {
    background: white;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    overflow: hidden;
    margin-bottom: 12px;
}
.docs-response-header {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    background: var(--docs-bg-soft);
    border-bottom: 1px solid var(--docs-border);
}
.docs-status {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    color: white;
    font-family: 'JetBrains Mono', monospace;
}
.docs-status-2xx { background: var(--docs-method-get); }
.docs-status-4xx { background: var(--docs-method-delete); }
.docs-status-5xx { background: #6B7280; }
.docs-response-label { font-size: 13px; color: var(--docs-text-secondary); }

/* Code blocks */
.docs-code-block {
    position: relative;
    background: var(--docs-code-bg);
    border-radius: var(--docs-radius);
    overflow: hidden;
    margin-bottom: 12px;
}
.docs-code-block .docs-code { margin: 0; padding: 16px; background: transparent; }
.docs-code-block .docs-code code { background: transparent; color: var(--docs-code-text); padding: 0; font-size: 13px; line-height: 1.5; }
.docs-code {
    background: var(--docs-code-bg);
    color: var(--docs-code-text);
    padding: 16px;
    border-radius: var(--docs-radius);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
}
.docs-code code { background: transparent; padding: 0; color: inherit; }
.docs-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 150ms;
    z-index: 1;
}
.docs-copy-btn:hover { background: rgba(255,255,255,0.2); }

/* Tabs */
.docs-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--docs-border);
    margin-bottom: 0;
    overflow-x: auto;
    flex-wrap: wrap;
}
.docs-tab {
    background: transparent;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--docs-text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 150ms;
}
.docs-tab:hover { color: var(--docs-text); }
.docs-tab.active {
    color: var(--docs-green);
    border-bottom-color: var(--docs-green);
}
.docs-tab-content { display: none; }
.docs-tab-content.active { display: block; }

/* Related */
.docs-related {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}
.docs-related-card {
    display: flex; align-items: center; gap: 10px;
    background: white;
    border: 1px solid var(--docs-border);
    border-radius: var(--docs-radius);
    padding: 12px 16px;
    text-decoration: none;
    color: var(--docs-text);
    transition: all 150ms;
}
.docs-related-card:hover { border-color: var(--docs-green); transform: translateX(2px); }
.docs-related-card strong { flex: 1; font-size: 14px; font-weight: 500; }
.docs-related-card .docs-arrow { color: var(--docs-text-muted); }

/* CTA */
.docs-cta {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
    border-radius: var(--docs-radius-lg);
    margin: 40px 0;
    border: 1px solid var(--docs-border);
}
.docs-cta h2 { font-size: 28px; margin-bottom: 12px; }
.docs-cta p { color: var(--docs-text-secondary); margin-bottom: 24px; }
.docs-cta .docs-btn { margin: 0 4px; }

/* Footer */
.docs-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    border-top: 1px solid var(--docs-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--docs-text-muted);
    font-size: 13px;
    flex-wrap: wrap;
    gap: 12px;
}
.docs-footer a { color: var(--docs-text-secondary); }

/* Guide content */
.docs-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--docs-radius-lg);
    box-shadow: var(--docs-shadow);
}
.docs-content h1 { font-size: 32px; margin-bottom: 16px; }
.docs-content h2 { font-size: 22px; margin: 32px 0 12px; padding-top: 16px; border-top: 1px solid var(--docs-border); }
.docs-content h2:first-of-type { border-top: none; padding-top: 0; }
.docs-content h3 { font-size: 17px; margin: 20px 0 8px; }
.docs-content p, .docs-content li { color: var(--docs-text-secondary); line-height: 1.7; }
.docs-content ul, .docs-content ol { padding-left: 24px; }
.docs-content code { background: var(--docs-bg-soft); color: var(--docs-primary-dark); font-weight: 500; }
.docs-content .callout {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-left: 4px solid #F59E0B;
    padding: 16px 20px;
    border-radius: 0 var(--docs-radius) var(--docs-radius) 0;
    margin: 20px 0;
    color: #92400E;
}
.docs-content .callout-info {
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    border-color: #3B82F6;
    color: #1E40AF;
}

/* Responsive */
@media (max-width: 768px) {
    .docs-hero h1 { font-size: 28px; }
    .docs-hero p { font-size: 15px; }
    .docs-content { padding: 24px 16px; }
    .docs-endpoint-header h1 { font-size: 24px; }
    .docs-endpoint-summary { font-size: 12px; }
    .docs-endpoint-path { font-size: 12px; word-break: break-all; }
    .docs-cta h2 { font-size: 22px; }
    .docs-footer { flex-direction: column; text-align: center; }
}

/* Utilidades inline-style replacements (CSP-safe, no inline style attr) */
.docs-text-muted { color: #6B7280; }
.docs-text-muted-16 { color: #6B7280; margin-bottom: 16px; }

/* Tabla de busqueda - highlight resultados */
.docs-result-highlight {
    background: linear-gradient(120deg, transparent 0%, #FEF3C7 50%, transparent 100%);
    padding: 0 2px;
}

/* Feature icons con gradientes (sustituye inline styles) */
.docs-feature-icon-grad-1 { background: linear-gradient(135deg, #25D366, #128C7E); }
.docs-feature-icon-grad-2 { background: linear-gradient(135deg, #6366F1, #8B5CF6); }
.docs-feature-icon-grad-3 { background: linear-gradient(135deg, #F59E0B, #EF4444); }
.docs-feature-icon-grad-4 { background: linear-gradient(135deg, #06B6D4, #3B82F6); }

/* Back link y empty state */
.docs-back-link {
    color: #6B7280;
    text-decoration: none;
    font-size: 13px;
}
.docs-back-link:hover { color: #4B5563; }
.docs-empty-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6B7280;
}
.docs-empty-results a { color: #25D366; }
.docs-footer-heart { color: #EF4444; }
