/* ============================================
   General — Variables, Reset y Base
   Compartido por todas las vistas de Hefesto Docs
   ============================================ */

:root {
    --bg-base: #0a0e17;
    --bg-surface: #131820;
    --bg-card: #131820;
    --bg-card-hover: #171f2b;
    --bg-code: #0d1117;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-primary: #f59e0b;
    --accent-secondary: #fbbf24;
    --accent-hover: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.15);

    --border-color: #1e293b;
    --border-hover: rgba(245, 158, 11, 0.4);

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-code: 'Fira Code', 'Consolas', monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-secondary);
    font-family: var(--font-main);
    margin: 0;
    padding: 0 0 4rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Modal — Reutilizable en todas las vistas
   ============================================ */

.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 1rem;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 2rem 1.75rem;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.7;
}

.modal-content p {
    margin: 0 0 1rem;
}

.modal-content h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

.modal-content p:last-of-type {
    margin-bottom: 0;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-btn-close {
    display: block;
    margin: 1.5rem auto 0;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.modal-btn-close:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

body.modal-open {
    overflow: hidden;
}

/* ============================================
   Footer con enlace a privacidad
   ============================================ */

.privacy-footer {
    text-align: center;
    padding: 2rem 0 1rem;
}

.privacy-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
    cursor: pointer;
}

.privacy-link:hover {
    color: var(--accent-primary);
}

/* ============================================
   Doc — Estilos específicos de páginas de documentación
   (directives, memory, infrastructure y similares)
   ============================================ */

/* ---- Navegación Superior ---- */
.top-nav {
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: opacity 0.2s ease;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-brand span {
    color: var(--accent-primary);
    font-weight: 500;
}

/* ---- Contenedor Principal y Tipografía ---- */
.doc-wrapper {
    max-width: 800px;
    margin: 3rem auto 0;
    padding: 0 1.5rem;
}

h1.doc-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin: 0 0 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2.doc-subtitle {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem;
    font-weight: 600;
}

h3.doc-section-title,
.doc-wrapper h3 {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
    font-weight: 600;
}

p {
    margin: 0 0 1.25rem;
}

/* Enlaces dentro del texto */
.doc-link {
    color: var(--accent-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.doc-link:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

/* Listas */
ul {
    margin: 0 0 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.75rem;
    position: relative;
}

li::marker {
    color: var(--accent-primary);
}

/* ---- Bloques de Código ---- */
/* Bare <pre> (no envuelto en .code-container) */
.doc-wrapper > pre,
.wrapper pre {
    margin: 1.5rem 0;
    border-radius: 8px;
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    color: #c9d1d9;
    font-family: var(--font-code);
    font-size: 0.875rem;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.code-container {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.code-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--accent-primary);
    opacity: 0.5;
}

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

code {
    font-family: var(--font-code);
    font-size: 0.875rem;
    color: #c9d1d9;
    line-height: 1.6;
}

/* Código inline */
p code, li code {
    background: var(--bg-surface);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* ---- Imágenes ---- */
.doc-image-container {
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.doc-image-container img {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0.95;
    transition: opacity 0.3s ease;
}

.doc-image-container img:hover {
    opacity: 1;
}

h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem;
    font-weight: 600;
}

/* ---- Footer ---- */
.doc-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.back-home-btn:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    h1.doc-title {
        font-size: 2rem;
    }
}
