/* ==========================================================================
   EKEKO - CENTRO DE DOCUMENTACIÓN, CAPACITACIÓN Y ADOPCIÓN (SSOT 4-EN-1)
   Ambiente Oficial: bg-gradient-primary (#4e73df -> #224abe)
   ========================================================================== */

:root {
    --ekeko-primary: #4e73df;
    --ekeko-primary-dark: #224abe;
    --ekeko-blue: #2563eb;
    --ekeko-navy: #0f172a;
    --ekeko-green: #16a34a;
    --ekeko-amber: #d97706;
    --ekeko-bg: #f8fafc;
    --ekeko-border: #e2e8f0;
}

.ekeko-docs-wrapper {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

/* Hero / Cabecera de Biblioteca (Estilo bg-gradient-primary oficial) */
.docs-hero {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 65%, #1e293b 100%);
    color: #ffffff;
    border-radius: 14px;
    padding: 1.75rem 2rem;
    box-shadow: 0 10px 25px -5px rgba(34, 74, 190, 0.28);
    position: relative;
    overflow: hidden;
}

.docs-hero .badge-pill-soft {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 0.35rem 0.85rem;
    border-radius: 50rem;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}

/* Buscador Instantáneo Sin Base de Datos */
.docs-search-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    border: 2px solid #93c5fd;
}

.docs-search-input {
    border: none !important;
    box-shadow: none !important;
    font-size: 0.98rem;
    font-weight: 600;
    color: #0f172a;
}

.docs-search-results {
    background: #ffffff;
    border: 1px solid var(--ekeko-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.14);
    max-height: 440px;
    overflow-y: auto;
}

.docs-search-hit {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
    display: block;
    text-decoration: none !important;
    color: #1e293b;
}

.docs-search-hit:hover {
    background: #eff6ff;
}

.docs-search-highlight {
    background: #fef08a;
    color: #854d0e;
    padding: 0 3px;
    border-radius: 3px;
    font-weight: 800;
}

/* Selector de los 4 Formatos (Pestañas de propósito) */
.docs-mode-switcher {
    background: #ffffff;
    border: 1px solid var(--ekeko-border);
    border-radius: 12px;
    padding: 0.45rem;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.docs-mode-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-weight: 700;
    font-size: 0.86rem;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.docs-mode-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.docs-mode-btn.active {
    background: var(--ekeko-primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(78, 115, 223, 0.32);
}

.docs-mode-btn.active[data-mode="comercial"] {
    background: #1d4ed8;
    box-shadow: 0 4px 10px rgba(29, 78, 216, 0.28);
}

.docs-mode-btn.active[data-mode="video"] {
    background: #7c3aed;
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.28);
}

.docs-mode-btn.active[data-mode="rapida"] {
    background: #059669;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.28);
}

/* Ficha Técnica Oficial del SOP */
.sop-meta-card {
    background: #ffffff;
    border: 1px solid var(--ekeko-border);
    border-top: 4px solid var(--ekeko-primary);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.sop-meta-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: 140px;
    padding: 0.55rem 0.85rem !important;
    border-color: var(--ekeko-border) !important;
}

.sop-meta-table td {
    font-size: 0.9rem;
    color: #0f172a;
    padding: 0.55rem 0.85rem !important;
    border-color: var(--ekeko-border) !important;
}

/* Secciones numeradas del SOP */
.sop-section-card {
    background: #ffffff;
    border: 1px solid var(--ekeko-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.sop-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sop-section-num {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 800;
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Tarjetas de Paso a Paso ( Quirúrgicamente independientes ) */
.sop-step-card {
    border: 1px solid var(--ekeko-border);
    border-left: 4px solid var(--ekeko-primary);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background: #ffffff;
    transition: box-shadow 0.15s ease;
    page-break-inside: avoid;
}

.sop-step-card.step-updated-highlight {
    border-left: 4px solid #f59e0b;
    background: #fffdf7;
}

.sop-step-card:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.sop-step-badge {
    background: var(--ekeko-primary);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sop-step-id-tag {
    font-family: monospace;
    font-size: 0.73rem;
    color: #64748b;
    background: #f8fafc;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Contenedor de Captura o Ilustración SVG (Interactivo con Zoom) */
.sop-capture-box {
    margin-top: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    position: relative;
    cursor: zoom-in;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sop-capture-box:hover {
    border-color: var(--ekeko-primary);
    box-shadow: 0 6px 18px rgba(78, 115, 223, 0.16);
}

.sop-capture-box img {
    width: 100%;
    height: auto;
    display: block;
}

.sop-zoom-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 50rem;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.sop-capture-caption {
    background: #f1f5f9;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    color: #475569;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Modal Pantalla Completa / Zoom Táctil para Celulares y PC */
.modal-zoom-docs .modal-dialog {
    max-width: 96vw;
    margin: 0.5rem auto;
}

.modal-zoom-viewport {
    width: 100%;
    max-height: 80vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #0f172a;
    text-align: center;
    padding: 0.75rem;
    border-radius: 0 0 8px 8px;
}

.modal-zoom-viewport img {
    height: auto;
    display: inline-block;
    border-radius: 6px;
    background: #ffffff;
    transition: width 0.15s ease;
}

.sop-capture-placeholder {
    border: 2px dashed #94a3b8;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    background: #f8fafc;
    color: #475569;
    margin-top: 0.85rem;
}

/* Tarjetas de Nivel 1 (Presentación Comercial) */
.pitch-benefit-card {
    background: #ffffff;
    border: 1px solid var(--ekeko-border);
    border-radius: 12px;
    padding: 1.35rem;
    height: 100%;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
    border-top: 4px solid var(--ekeko-primary);
}

.pitch-highlight-box {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 1.5rem;
}

/* Galería de Videos para Usuarios y Tabla de Guion para Admin */
.video-user-card {
    background: #ffffff;
    border: 1px solid var(--ekeko-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    height: 100%;
}

.video-thumb-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #4e73df 100%);
    color: #ffffff;
    padding: 2rem 1.25rem;
    text-align: center;
    position: relative;
}

.video-script-table th {
    background: #4c1d95;
    color: #ffffff;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.video-narration-quote {
    background: #f5f3ff;
    border-left: 4px solid #7c3aed;
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    font-style: normal;
    color: #1e1b4b;
    font-weight: 600;
}

/* Zona de Versiones y Control de Cambios */
.version-timeline-item {
    border-left: 3px solid var(--ekeko-primary);
    padding-left: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.version-timeline-item::before {
    content: '';
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--ekeko-primary);
    position: absolute;
    left: -7px;
    top: 5px;
}

/* Catálogo de Módulos y Fases */
.module-card {
    background: #ffffff;
    border: 1px solid var(--ekeko-border);
    border-radius: 12px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

/* ==========================================================================
   OPTIMIZACIÓN DE IMPRESIÓN / EXPORTACIÓN PDF (@media print)
   ========================================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    #accordionSidebar,
    nav.topbar,
    footer.sticky-footer,
    .no-print,
    .docs-mode-switcher,
    .scroll-to-top {
        display: none !important;
    }
    #content-wrapper,
    #content,
    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    .sop-section-card,
    .sop-step-card,
    .sop-meta-card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .sop-capture-box {
        break-inside: avoid;
        page-break-inside: avoid;
        max-height: 360px;
    }
}
