/**
 * Estilos del Centro de Ayuda y Panel Desplegable (Slide-Over Drawer) SISGOPINC
 */

/* ==========================================================================
   1. BOTÓN FLOTANTE UNIVERSAL (FAB)
   ========================================================================== */
.sisgop-help-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #003366 0%, #0284c7 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.25);
    padding: 10px 18px;
    border-radius: 9999px;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.35), 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    user-select: none;
}

.sisgop-help-fab:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 28px rgba(2, 132, 199, 0.45), 0 4px 10px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #002750 0%, #0369a1 100%);
    border-color: rgba(255, 255, 255, 0.4);
}

.sisgop-help-fab:active {
    transform: translateY(0) scale(0.98);
}

.sisgop-help-fab .fab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 0.8rem;
}

.sisgop-help-fab .fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 9999px;
    border: 2px solid #ffffff;
    display: none;
}

/* ==========================================================================
   2. BACKDROP Y CONTENEDOR DEL PANEL SLIDE-OVER
   ========================================================================== */
.sisgop-help-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sisgop-help-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.sisgop-help-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 520px;
    max-width: 95vw;
    background: #f8fafc;
    z-index: 9999;
    box-shadow: -10px 0 35px rgba(0, 35, 71, 0.22);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), width 0.22s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1e293b;
    overflow: hidden;
}

.sisgop-help-drawer.open {
    transform: translateX(0);
}

.sisgop-help-drawer.maximized {
    width: 860px;
}

/* ==========================================================================
   3. ENCABEZADO DEL PANEL (INC DEEP BLUE)
   ========================================================================== */
.sisgop-help-header {
    background: linear-gradient(135deg, #002750 0%, #004b87 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    flex-shrink: 0;
}

.sisgop-help-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sisgop-help-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sisgop-help-main-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: #38bdf8;
    flex-shrink: 0;
}

.sisgop-help-title-text {
    min-width: 0;
}

.sisgop-help-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.25;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sisgop-help-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(56, 189, 248, 0.2);
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 2px 8px;
    border-radius: 9999px;
    margin-top: 3px;
}

.sisgop-help-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sisgop-help-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    outline: none;
}

.sisgop-help-btn-icon:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #38bdf8;
    transform: scale(1.05);
}

.sisgop-help-btn-close:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* Selector de temas y buscador */
.sisgop-help-controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sisgop-help-select {
    width: 100%;
    background: rgba(0, 25, 50, 0.7);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.sisgop-help-select:focus {
    border-color: #38bdf8;
    background: rgba(0, 20, 45, 0.95);
}

.sisgop-help-select option {
    background: #002750;
    color: #ffffff;
}

.sisgop-help-search-box {
    position: relative;
    width: 100%;
}

.sisgop-help-search-input {
    width: 100%;
    background: rgba(0, 25, 50, 0.7);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 7px 10px 7px 28px;
    font-size: 0.8rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s;
}

.sisgop-help-search-input:focus {
    border-color: #38bdf8;
    background: rgba(0, 20, 45, 0.95);
}

.sisgop-help-search-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #94a3b8;
    pointer-events: none;
}

/* ==========================================================================
   4. PESTAÑAS DE NAVEGACIÓN (TABS)
   ========================================================================== */
.sisgop-help-tabs {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    padding: 0 16px;
    gap: 8px;
    flex-shrink: 0;
}

.sisgop-help-tab-btn {
    background: none;
    border: none;
    padding: 12px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    outline: none;
    margin-bottom: -1px;
}

.sisgop-help-tab-btn:hover {
    color: #0284c7;
}

.sisgop-help-tab-btn.active {
    color: #003366;
    border-bottom-color: #0284c7;
}

.sisgop-help-tab-btn .tab-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 9999px;
}

.sisgop-help-tab-btn.active .tab-badge {
    background: #e0f2fe;
    color: #0369a1;
}

/* ==========================================================================
   4.5 BARRA DE AUDIO / ACCESIBILIDAD POR VOZ (TEXT-TO-SPEECH)
   ========================================================================== */
.sisgop-help-audio-bar {
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.sisgop-help-audio-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sisgop-audio-btn-play {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
    transition: all 0.2s ease;
    outline: none;
}

.sisgop-audio-btn-play:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: scale(1.02);
}

.sisgop-audio-btn-play.playing {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.sisgop-audio-btn-stop {
    background: #e2e8f0;
    color: #475569;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.sisgop-audio-btn-stop:hover {
    background: #ef4444;
    color: #ffffff;
}

.sisgop-help-audio-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #0369a1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Animación de ondas sonoras */
.sisgop-audio-wave {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 14px;
}

.sisgop-audio-wave span {
    width: 3px;
    height: 100%;
    background: #0284c7;
    border-radius: 3px;
    animation: sisgopWave 1.2s ease-in-out infinite;
}

.sisgop-audio-wave span:nth-child(1) { animation-delay: 0.0s; }
.sisgop-audio-wave span:nth-child(2) { animation-delay: 0.2s; }
.sisgop-audio-wave span:nth-child(3) { animation-delay: 0.4s; }
.sisgop-audio-wave span:nth-child(4) { animation-delay: 0.1s; }

@keyframes sisgopWave {
    0%, 100% { height: 4px; }
    50% { height: 14px; }
}

/* Tarjeta de paso actualmente leída en voz alta */
.sisgop-help-step-card.sisgop-step-reading {
    border: 2px solid #0284c7 !important;
    background: #f0fdf4 !important;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.25) !important;
    transform: scale(1.01);
    transition: all 0.25s ease;
}

.sisgop-help-step-card.sisgop-step-reading .sisgop-help-step-badge {
    background: #0284c7 !important;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.6);
}

/* ==========================================================================
   5. CUERPO DE CONTENIDO
   ========================================================================== */
.sisgop-help-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

/* Scrollbar estilizado */
.sisgop-help-body::-webkit-scrollbar {
    width: 6px;
}
.sisgop-help-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.sisgop-help-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.sisgop-help-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Banner de Descripción del Módulo */
.sisgop-help-intro-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0284c7;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sisgop-help-intro-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.sisgop-help-intro-desc {
    font-size: 0.83rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

/* ==========================================================================
   6. PASOS DETALLADOS (STEP CARDS)
   ========================================================================== */
.sisgop-help-steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.sisgop-help-step-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    position: relative;
}

.sisgop-help-step-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 10px rgba(0, 51, 102, 0.06);
}

.sisgop-help-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sisgop-help-step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #003366;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sisgop-help-step-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sisgop-help-step-title i {
    color: #0284c7;
    font-size: 0.88rem;
}

.sisgop-help-step-text {
    font-size: 0.84rem;
    color: #334155;
    line-height: 1.55;
    margin: 0 0 10px 0;
}

/* Subítems */
.sisgop-help-subitems {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 10px 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sisgop-help-subitems li {
    font-size: 0.8rem;
    color: #334155;
    position: relative;
    padding-left: 18px;
    line-height: 1.45;
}

.sisgop-help-subitems li::before {
    content: "▶";
    position: absolute;
    left: 0;
    top: 1px;
    font-size: 0.6rem;
    color: #0284c7;
}

/* Tips y Alertas dentro del paso */
.sisgop-help-tips-box {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sisgop-help-tip-item {
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 8px;
    line-height: 1.45;
    background: #f0fdf4;
    border-left: 3px solid #10b981;
    color: #166534;
}

.sisgop-help-tip-item b {
    color: #14532d;
}

.sisgop-help-tip-item.warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.sisgop-help-tip-item.danger {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

/* ==========================================================================
   7. PREGUNTAS FRECUENTES (FAQ)
   ========================================================================== */
.sisgop-help-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sisgop-help-faq-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.sisgop-help-faq-header {
    padding: 14px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: #ffffff;
    transition: background 0.2s;
    user-select: none;
}

.sisgop-help-faq-header:hover {
    background: #f8fafc;
    color: #0284c7;
}

.sisgop-help-faq-header i.faq-icon {
    color: #0284c7;
    font-size: 0.95rem;
}

.sisgop-help-faq-header i.faq-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.sisgop-help-faq-card.open .sisgop-help-faq-header i.faq-chevron {
    transform: rotate(180deg);
}

.sisgop-help-faq-body {
    padding: 0 16px 14px 40px;
    font-size: 0.83rem;
    color: #475569;
    line-height: 1.55;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
    display: block;
}

.sisgop-help-faq-card:not(.open) .sisgop-help-faq-body {
    display: none;
}

/* ==========================================================================
   8. PROCEDIMIENTO OFICIAL ARTICULADO (iDempiere + SISGOP)
   ========================================================================== */
.sisgop-help-proc-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.sisgop-help-proc-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.sisgop-help-proc-badge.idempiere {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.sisgop-help-proc-badge.sisgop {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.sisgop-help-proc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.sisgop-help-proc-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.83rem;
    color: #334155;
    line-height: 1.6;
}

/* ==========================================================================
   9. PIE DEL PANEL (FOOTER)
   ========================================================================== */
.sisgop-help-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #64748b;
    flex-shrink: 0;
}

.sisgop-help-footer-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sisgop-help-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
}

/* ==========================================================================
   10. MEDIA QUERIES (RESPONSIVIDAD Y PRINT)
   ========================================================================== */
@media (max-width: 640px) {
    .sisgop-help-fab {
        bottom: 16px;
        right: 16px;
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    .sisgop-help-drawer {
        width: 100vw;
        max-width: 100vw;
    }
    .sisgop-help-controls-row {
        grid-template-columns: 1fr;
    }
}

@media print {
    .sisgop-help-fab,
    .sisgop-help-backdrop,
    .sisgop-help-header-top,
    .sisgop-help-controls-row,
    .sisgop-help-tabs,
    .sisgop-help-footer {
        display: none !important;
    }
    .sisgop-help-drawer {
        position: static !important;
        width: 100% !important;
        transform: none !important;
        box-shadow: none !important;
    }
    .sisgop-help-body {
        overflow: visible !important;
        padding: 0 !important;
    }
}
