/* ============================================
   SISTEMA DE AYUDA - ESTILOS PERSONALIZADOS
   ============================================ */

:root {
    /* Colores principales del sistema */
    --help-primary: #2563eb;
    --help-primary-dark: #1d4ed8;
    --help-secondary: #64748b;
    --help-success: #059669;
    --help-info: #0284c7;
    --help-warning: #d97706;
    --help-danger: #dc2626;
    
    /* Colores de fondo */
    --help-bg-primary: #ffffff;
    --help-bg-secondary: #f8fafc;
    --help-bg-tertiary: #e2e8f0;
    
    /* Colores de texto */
    --help-text-primary: #1e293b;
    --help-text-secondary: #475569;
    --help-text-muted: #94a3b8;
    
    /* Bordes y sombras */
    --help-border-color: #e2e8f0;
    --help-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --help-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --help-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Espaciado reducido para mayor densidad */
    --help-spacing-xs: 0.125rem;
    --help-spacing-sm: 0.25rem;
    --help-spacing-md: 0.5rem;
    --help-spacing-lg: 0.75rem;
    --help-spacing-xl: 1.25rem;
    
    /* Transiciones */
    --help-transition: all 0.3s ease;
    --help-transition-fast: all 0.15s ease;
}

/* Tema oscuro */
[data-help-theme="dark"] {
    --help-bg-primary: #1e1e1e;
    --help-bg-secondary: #2d2d2d;
    --help-bg-tertiary: #3e3e3e;
    
    --help-text-primary: #f8f9fa;
    --help-text-secondary: #adb5bd;
    --help-text-muted: #6c757d;
    
    --help-border-color: #495057;
}

/* ============================================
   COMPONENTES PRINCIPALES
   ============================================ */

/* Sistema de ayuda general */
.help-system {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--help-text-primary);
    background-color: var(--help-bg-primary);
    line-height: 1.6;
}

/* Contenedor principal */
.help-container {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* ============================================
   BARRA LATERAL DE NAVEGACIÓN
   ============================================ */

.help-sidebar {
    background-color: var(--help-bg-secondary);
    border-right: 1px solid var(--help-border-color);
    transition: var(--help-transition);
    display: flex;
    flex-direction: column;
}

.help-sidebar-header {
    padding: var(--help-spacing-lg);
    border-bottom: 1px solid var(--help-border-color);
    background: linear-gradient(135deg, var(--help-primary), var(--help-primary-dark));
    color: white;
}

.help-sidebar-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--help-spacing-sm);
}

.help-sidebar-content {
    flex: 1;
    padding: var(--help-spacing-md);
    overflow-y: auto;
}

/* Buscador en la barra lateral */
.help-search {
    margin-bottom: var(--help-spacing-lg);
}

.help-search-input {
    width: 100%;
    padding: var(--help-spacing-sm) var(--help-spacing-md);
    border: 1px solid var(--help-border-color);
    border-radius: 0.375rem;
    background-color: var(--help-bg-primary);
    color: var(--help-text-primary);
    font-size: 0.875rem;
    transition: var(--help-transition-fast);
}

.help-search-input:focus {
    outline: none;
    border-color: var(--help-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ============================================
   ÁREA DE CONTENIDO
   ============================================ */

.help-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--help-bg-primary);
    overflow: hidden;
}

.help-content-header {
    padding: var(--help-spacing-md) var(--help-spacing-lg);
    border-bottom: 1px solid var(--help-border-color);
    background-color: var(--help-bg-secondary);
}

.help-content-body {
    flex: 1;
    padding: var(--help-spacing-lg);
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.help-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--help-spacing-sm);
    font-size: 0.875rem;
    color: var(--help-text-secondary);
    margin-bottom: var(--help-spacing-md);
}

.help-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--help-spacing-xs);
}

.help-breadcrumb-item:not(:last-child)::after {
    content: '>';
    margin-left: var(--help-spacing-sm);
    color: var(--help-text-muted);
}

.help-breadcrumb-link {
    color: var(--help-primary);
    text-decoration: none;
    transition: var(--help-transition-fast);
}

.help-breadcrumb-link:hover {
    text-decoration: underline;
    color: var(--help-primary-dark);
}

/* ============================================
   CONTENIDO DE DOCUMENTACIÓN
   ============================================ */

.help-content h1 {
    color: var(--help-text-primary);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: var(--help-spacing-md);
    padding-bottom: var(--help-spacing-sm);
    border-bottom: 1px solid var(--help-border-color);
    line-height: 1.3;
}

.help-content h2 {
    color: var(--help-text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: var(--help-spacing-lg);
    margin-bottom: var(--help-spacing-sm);
    line-height: 1.4;
}

.help-content h3 {
    color: var(--help-text-secondary);
    font-size: 1.125rem;
    font-weight: 500;
    margin-top: var(--help-spacing-md);
    margin-bottom: var(--help-spacing-xs);
    line-height: 1.4;
}

.help-content h4 {
    color: var(--help-text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-top: var(--help-spacing-md);
    margin-bottom: var(--help-spacing-xs);
    line-height: 1.4;
}

.help-content p {
    margin-bottom: var(--help-spacing-sm);
    line-height: 1.6;
    color: var(--help-text-primary);
}

.help-content ul, .help-content ol {
    margin-bottom: var(--help-spacing-sm);
    padding-left: var(--help-spacing-lg);
}

.help-content li {
    margin-bottom: var(--help-spacing-xs);
    line-height: 1.5;
}

/* Código y elementos pre */
.help-content code {
    background-color: var(--help-bg-tertiary);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    color: var(--help-text-primary);
    border: 1px solid var(--help-border-color);
}

.help-content pre {
    background-color: var(--help-bg-secondary);
    padding: var(--help-spacing-md);
    border-radius: 0.375rem;
    border: 1px solid var(--help-border-color);
    overflow-x: auto;
    margin-bottom: var(--help-spacing-md);
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
}

.help-content pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    color: var(--help-text-primary);
}

/* Blockquotes - más profesionales */
.help-content blockquote {
    margin: var(--help-spacing-md) 0;
    padding: var(--help-spacing-md);
    border-left: 3px solid var(--help-primary);
    background-color: var(--help-bg-secondary);
    font-style: normal;
    color: var(--help-text-secondary);
    border-radius: 0 0.375rem 0.375rem 0;
}

/* Tablas */
.help-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--help-spacing-md);
    background-color: var(--help-bg-primary);
    border: 1px solid var(--help-border-color);
    border-radius: 0.375rem;
    overflow: hidden;
    font-size: 0.875rem;
}

.help-content th,
.help-content td {
    padding: var(--help-spacing-sm) var(--help-spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--help-border-color);
}

.help-content th {
    background-color: var(--help-bg-secondary);
    font-weight: 600;
    color: var(--help-text-primary);
    font-size: 0.875rem;
}

.help-content td {
    font-size: 0.875rem;
}

/* Enlaces más profesionales */
.help-content a {
    color: var(--help-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: var(--help-transition-fast);
}

.help-content a:hover {
    border-bottom-color: var(--help-primary);
}

/* ============================================
   ALERTAS Y AVISOS
   ============================================ */

.help-alert {
    padding: var(--help-spacing-md);
    margin-bottom: var(--help-spacing-md);
    border-radius: 0.375rem;
    border: 1px solid;
    background-color: var(--help-bg-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.help-alert-info {
    border-color: var(--help-info);
    background-color: rgba(2, 132, 199, 0.05);
    color: var(--help-text-primary);
}

.help-alert-success {
    border-color: var(--help-success);
    background-color: rgba(5, 150, 105, 0.05);
    color: var(--help-text-primary);
}

.help-alert-warning {
    border-color: var(--help-warning);
    background-color: rgba(217, 119, 6, 0.05);
    color: var(--help-text-primary);
}

.help-alert-danger {
    border-color: var(--help-danger);
    background-color: rgba(220, 38, 38, 0.05);
    color: var(--help-text-primary);
}

/* ============================================
   NAVEGACIÓN DE PÁGINAS
   ============================================ */

.help-page-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--help-spacing-xl);
    padding-top: var(--help-spacing-lg);
    border-top: 1px solid var(--help-border-color);
}

.help-nav-button {
    padding: var(--help-spacing-sm) var(--help-spacing-md);
    background-color: transparent;
    border: 1px solid var(--help-primary);
    color: var(--help-primary);
    border-radius: 0.375rem;
    text-decoration: none;
    transition: var(--help-transition-fast);
    font-size: 0.875rem;
    font-weight: 500;
}

.help-nav-button:hover {
    background-color: var(--help-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--help-shadow-sm);
}

.help-nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   BOTÓN VOLVER ARRIBA
   ============================================ */

.help-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background-color: var(--help-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--help-shadow);
    transition: var(--help-transition);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.help-back-to-top:hover {
    background-color: var(--help-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--help-shadow-lg);
}

/* ============================================
   WIDGET FLOTANTE DE AYUDA
   ============================================ */

.help-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
}

.help-widget-button {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, var(--help-primary), var(--help-primary-dark));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: var(--help-shadow);
    transition: var(--help-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    position: relative;
}

.help-widget-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--help-shadow-lg);
}

.help-widget-button::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg, var(--help-primary), var(--help-primary-dark));
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    animation: help-pulse 2s infinite;
}

@keyframes help-pulse {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .help-container {
        flex-direction: column;
    }
    
    .help-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--help-border-color);
        max-height: 50vh;
    }
    
    .help-content-body {
        padding: var(--help-spacing-md);
    }
    
    .help-content h1 {
        font-size: 1.5rem;
    }
    
    .help-content h2 {
        font-size: 1.25rem;
    }
    
    .help-page-navigation {
        flex-direction: column;
        gap: var(--help-spacing-sm);
    }
    
    .help-back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .help-widget-button {
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .help-sidebar-header {
        padding: var(--help-spacing-md);
    }
    
    .help-sidebar-title {
        font-size: 1rem;
    }
    
    .help-content-body {
        padding: var(--help-spacing-sm);
    }
    
    .help-content h1 {
        font-size: 1.25rem;
    }
    
    .help-breadcrumb {
        font-size: 0.75rem;
    }
}

/* ============================================
   TEMA DE ALTO CONTRASTE
   ============================================ */

@media (prefers-contrast: high) {
    :root {
        --help-primary: #0000ff;
        --help-primary-dark: #000080;
        --help-border-color: #000000;
        --help-text-primary: #000000;
        --help-bg-primary: #ffffff;
    }
    
    [data-help-theme="dark"] {
        --help-bg-primary: #000000;
        --help-text-primary: #ffffff;
        --help-border-color: #ffffff;
    }
}

/* ============================================
   ANIMACIONES Y TRANSICIONES
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .help-widget-button::before {
        animation: none;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */

.help-text-center { text-align: center; }
.help-text-left { text-align: left; }
.help-text-right { text-align: right; }

.help-d-flex { display: flex; }
.help-d-none { display: none; }
.help-d-block { display: block; }

.help-justify-center { justify-content: center; }
.help-justify-between { justify-content: space-between; }
.help-align-center { align-items: center; }

.help-mt-auto { margin-top: auto; }
.help-mb-auto { margin-bottom: auto; }

.help-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
} 