/* Variables específicas para la sección API */
:root {
    --api-bg: #0f172a;       /* Slate 900 */
    --api-sidebar: #1e293b;  /* Slate 800 */
    --api-text: #f1f5f9;     /* Slate 100 */
    --api-muted: #94a3b8;    /* Slate 400 */
    --api-border: #334155;   /* Slate 700 */
    --api-accent: #f97316;   /* Orange 500 */
    --api-code-bg: #020617;  /* Slate 950 */
}

/* Wrapper Principal */
.api-wrapper {
    display: flex;
    background-color: var(--api-bg);
    color: var(--api-text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    position: relative;
    padding-top: 20px; /* Espacio para el header fijo si es necesario */
}

/* Sidebar Izquierdo */
.api-sidebar {
    width: 260px;
    background-color: var(--api-bg);
    border-right: 1px solid var(--api-border);
    position: sticky;
    top: 80px; /* Altura del header principal */
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 2rem;
    flex-shrink: 0;
}

.version-badge {
    background: rgba(249, 115, 22, 0.2);
    color: var(--api-accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.nav-group { margin-bottom: 2rem; }
.nav-group h3 {
    color: var(--api-text);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 1rem;
}

.nav-item {
    display: block;
    color: var(--api-muted);
    text-decoration: none;
    padding: 0.4rem 0;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    color: var(--api-accent);
    padding-left: 5px;
}

.nav-item.disabled {
    color: #475569;
    cursor: not-allowed;
    opacity: 0.6;
}

.badge-dev {
    background: #3b82f6;
    color: white;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
}

/* Contenido Central */
.api-content {
    flex-grow: 1;
    padding: 3rem 4rem;
    max-width: 900px;
}

.content-section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
}

.content-section h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -0.03em; }
.content-section h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 1rem; margin-top: 2rem; color: white; border-bottom: 1px solid var(--api-border); padding-bottom: 0.5rem; }
.content-section p { color: var(--api-muted); line-height: 1.7; margin-bottom: 1rem; font-size: 1.05rem; }

.lead { font-size: 1.2rem; color: #cbd5e1 !important; }

/* Cajas de Info */
.info-box, .warning-box {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
    align-items: start;
}

.info-box { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); }
.warning-box { background: rgba(249, 115, 22, 0.1); border: 1px solid rgba(249, 115, 22, 0.2); }

.info-box p, .warning-box p { margin: 0; font-size: 0.95rem; color: #e2e8f0; }

/* Bloques de Código */
.code-block {
    background: var(--api-code-bg);
    border: 1px solid var(--api-border);
    border-radius: 8px;
    margin: 1.5rem 0;
    overflow: hidden;
}

.code-header {
    background: #0f172a;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--api-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header .lang {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--api-muted);
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--api-border);
    color: var(--api-muted);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover { border-color: var(--api-accent); color: var(--api-accent); }

pre {
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
}

/* Badges de Método */
.method-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    vertical-align: middle;
}
.method-badge.post { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.method-badge.get { background: rgba(59, 130, 246, 0.2); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.4); }

.endpoint code {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--api-accent);
}

/* Tabs de Código */
.tabbed-code {
    background: var(--api-code-bg);
    border: 1px solid var(--api-border);
    border-radius: 8px;
    margin: 1.5rem 0;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--api-border);
}

.tab {
    background: transparent;
    border: none;
    color: var(--api-muted);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-right: 1px solid var(--api-border);
    transition: all 0.2s;
}

.tab:hover { background: #1e293b; color: white; }
.tab.active { background: #1e293b; color: var(--api-accent); border-bottom: 2px solid var(--api-accent); }

.code-content { display: none; }
.code-content.active { display: block; }

/* TOC Derecho */
.api-toc {
    width: 220px;
    position: sticky;
    top: 100px;
    height: fit-content;
    padding-right: 2rem;
    border-left: 1px solid var(--api-border);
    padding-left: 2rem;
    display: none;
}

@media (min-width: 1280px) {
    .api-toc { display: block; }
}

.api-toc h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: white;
    font-weight: 700;
    margin-bottom: 1rem;
}

.api-toc ul { list-style: none; padding: 0; }
.api-toc li { margin-bottom: 0.5rem; }
.api-toc a {
    color: var(--api-muted);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}
.api-toc a:hover { color: var(--api-accent); }

.btn-dashboard {
    display: inline-block;
    width: 100%;
    padding: 0.75rem;
    background: var(--api-accent);
    color: white;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s;
}
.btn-dashboard:hover { background: #ea580c; }

/* Responsive */
@media (max-width: 768px) {
    .api-wrapper { flex-direction: column; }
    .api-sidebar { width: 100%; height: auto; position: relative; top: 0; border-right: none; border-bottom: 1px solid var(--api-border); }
    .api-content { padding: 2rem 1.5rem; }
}