/* ============================================================
   guias.css - Módulo de Guías (HelpModule)
   Hero + grid de tarjetas + detalle con diagrama de flujo
   ============================================================ */

/* ═══════ LISTADO ═══════ */
.guias { padding: 24px; max-width: 1400px; margin: 0 auto; }

.guias__hero {
  display: flex; align-items: center; gap: 20px;
  padding: 32px; border-radius: 16px; margin-bottom: 24px;
  background: linear-gradient(135deg, #084734 0%, #014651 100%);
  color: #fff; box-shadow: 0 4px 20px rgba(8,71,52,0.3);
}
.guias__hero-icon {
  font-size: 48px; width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15); border-radius: 16px;
}
.guias__hero-title { font-size: 28px; margin: 0 0 6px; font-weight: 700; }
.guias__hero-sub { font-size: 15px; margin: 0; opacity: .9; }
.guias__hero--skeleton { height: 144px; background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 37%, #e5e7eb 63%); background-size: 200% 100%; animation: shine 1.5s infinite; }

.guias__body { display: flex; flex-direction: column; gap: 32px; }

.guias__cat-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 2px solid var(--border-color, #e5e7eb);
}
.guias__cat-head i:first-child { font-size: 22px; color: var(--accent-color, #93C11F); }
.guias__cat-head h2 { font-size: 18px; margin: 0 0 2px; font-weight: 600; color: var(--text-primary, #111); }
.guias__cat-head p { font-size: 13px; margin: 0; color: var(--text-secondary, #6b7280); }
.guias__cat-count {
  margin-left: auto; background: var(--accent-color, #93C11F); color: #fff;
  padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 700;
}

.guias__grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.guias__card {
  background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 14px; padding: 20px; cursor: pointer;
  transition: all .2s; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.guias__card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); border-color: var(--accent-color, #93C11F); }

.guias__card-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: linear-gradient(135deg, #084734, #014651); color: #fff;
}
.guias__card--primary .guias__card-icon { background: linear-gradient(135deg, #084734, #014651); }
.guias__card--accent .guias__card-icon { background: linear-gradient(135deg, #93C11F, #CEF431); color: #084734; }
.guias__card--warn .guias__card-icon { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.guias__card--danger .guias__card-icon { background: linear-gradient(135deg, #DC2626, #EF4444); }
.guias__card--ok .guias__card-icon { background: linear-gradient(135deg, #16A34A, #22C55E); }

.guias__card-title { font-size: 17px; font-weight: 600; margin: 0 0 6px; color: var(--text-primary, #111); }
.guias__card-desc { font-size: 13.5px; margin: 0 0 10px; color: var(--text-secondary, #6b7280); line-height: 1.5; }
.guias__card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-secondary, #6b7280); }
.guias__card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.guias__card-dif--facil { color: #16A34A; }
.guias__card-dif--media { color: #F59E0B; }
.guias__card-dif--avanzada { color: #DC2626; }

.guias__card-cta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; color: var(--accent-color, #93C11F);
  padding-top: 10px; border-top: 1px dashed var(--border-color, #e5e7eb);
}

.guias__card-skeleton { height: 200px; background: #f3f4f6; border-radius: 14px; animation: shine 1.5s infinite; }

.guias__empty { text-align: center; padding: 60px 20px; color: var(--text-secondary, #6b7280); }
.guias__empty i { font-size: 48px; margin-bottom: 16px; opacity: .5; }
.guias__empty h3 { margin: 0 0 8px; font-size: 20px; }

/* ═══════ DETALLE ═══════ */
.guia-det { padding: 24px; max-width: 960px; margin: 0 auto; }

.guia-det__back {
  background: transparent; border: 1px solid var(--border-color, #e5e7eb);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; margin-bottom: 20px;
  font-size: 13px; color: var(--text-secondary, #6b7280);
}
.guia-det__back:hover { background: var(--border-color, #f3f4f6); }

.guia-det__hero {
  background: linear-gradient(135deg, #084734 0%, #014651 100%);
  color: #fff; border-radius: 16px; padding: 32px; margin-bottom: 24px;
}
.guia-det--accent .guia-det__hero { background: linear-gradient(135deg, #84a917 0%, #6b8810 100%); }
.guia-det--warn .guia-det__hero { background: linear-gradient(135deg, #F59E0B, #D97706); }
.guia-det--danger .guia-det__hero { background: linear-gradient(135deg, #DC2626, #991B1B); }

.guia-det__hero-main { display: flex; gap: 20px; align-items: flex-start; }
.guia-det__hero-icon { font-size: 40px; width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.15); border-radius: 14px; flex-shrink: 0; }
.guia-det__hero h1 { font-size: 26px; margin: 0 0 6px; font-weight: 700; }
.guia-det__hero p { font-size: 15px; margin: 0 0 14px; opacity: .9; }
.guia-det__meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.guia-det__meta span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(255,255,255,.15); border-radius: 10px; }

.guia-det__seccion-title { font-size: 20px; margin: 32px 0 16px; display: flex; align-items: center; gap: 10px; color: var(--text-primary, #111); }

.guia-det__prereq {
  background: #FEF3C7; border-left: 4px solid #F59E0B;
  padding: 16px 20px; border-radius: 10px; margin-bottom: 24px;
}
.guia-det__prereq h3 { font-size: 15px; margin: 0 0 10px; color: #92400E; display: flex; align-items: center; gap: 8px; }
.guia-det__prereq ul { margin: 0; padding-left: 22px; color: #78350F; font-size: 14px; }

/* ═══════ DIAGRAMA DE FLUJO ═══════ */
.diag-flow { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px; background: var(--card-bg, #f9fafb); border-radius: 12px; border: 1px dashed var(--border-color, #d1d5db); }
.diag-node {
  min-width: 200px; max-width: 320px; padding: 14px 18px;
  background: #fff; border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05); transition: all .2s;
}
.diag-node[style*="cursor:pointer"]:hover { transform: scale(1.03); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.diag-node__icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: #f3f4f6; font-size: 16px; flex-shrink: 0; }
.diag-node__label { font-size: 14px; font-weight: 500; color: var(--text-primary, #111); }

.diag-node--inicio { background: #084734; color: #fff; border-color: #084734; }
.diag-node--inicio .diag-node__icon { background: rgba(255,255,255,.2); color: #fff; }
.diag-node--inicio .diag-node__label { color: #fff; }
.diag-node--fin { background: #16A34A; color: #fff; border-color: #16A34A; }
.diag-node--fin .diag-node__icon { background: rgba(255,255,255,.2); color: #fff; }
.diag-node--fin .diag-node__label { color: #fff; }
.diag-node--decision { background: #FEF3C7; border-color: #F59E0B; border-style: dashed; }
.diag-node--primary { border-color: #084734; }
.diag-node--accent { border-color: #93C11F; }
.diag-node--warn { border-color: #F59E0B; background: #FFFBEB; }
.diag-node--ok { border-color: #16A34A; background: #F0FDF4; }
.diag-node--danger { border-color: #DC2626; }

.diag-conn { display: flex; flex-direction: column; align-items: center; color: var(--text-secondary, #6b7280); font-size: 18px; padding: 6px 0; }
.diag-conn__label { font-size: 12px; font-weight: 600; padding: 2px 8px; background: #fff; border: 1px solid var(--border-color, #e5e7eb); border-radius: 10px; margin-bottom: 2px; }

/* ═══════ PASOS ═══════ */
.guia-paso { display: flex; gap: 16px; padding: 20px; background: var(--card-bg, #fff); border-radius: 12px; border: 1px solid var(--border-color, #e5e7eb); margin-bottom: 12px; }
.guia-paso__num { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: #084734; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
.guia-paso--info .guia-paso__num { background: #0EA5E9; }
.guia-paso--decision .guia-paso__num { background: #F59E0B; }
.guia-paso--alerta .guia-paso__num { background: #DC2626; }
.guia-paso--tip .guia-paso__num { background: #93C11F; color: #084734; }
.guia-paso__body { flex: 1; min-width: 0; }
.guia-paso__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.guia-paso__head i { color: #084734; }
.guia-paso--info .guia-paso__head i { color: #0EA5E9; }
.guia-paso__head h3 { font-size: 16px; margin: 0; color: var(--text-primary, #111); }
.guia-paso__desc { margin: 0 0 12px; color: var(--text-secondary, #4b5563); line-height: 1.6; font-size: 14px; }

.guia-paso__mod { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #F0FDF4; border-radius: 8px; font-size: 13px; color: #166534; margin-bottom: 10px; flex-wrap: wrap; }
.guia-paso__btn { margin-left: auto; background: #93C11F; color: #084734; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.guia-paso__btn:hover { background: #7ba018; }

.guia-paso__fields { margin: 10px 0; font-size: 13px; }
.guia-paso__fields strong { margin-right: 8px; }
.guia-chip { display: inline-block; background: #E0F2FE; color: #0C4A6E; padding: 3px 10px; border-radius: 12px; font-size: 12px; margin: 2px 4px 2px 0; }
.guia-chip--link { cursor: pointer; background: #FEF3C7; color: #78350F; border: none; }
.guia-chip--link:hover { background: #FDE68A; }

.guia-paso__action { padding: 10px 14px; background: #FEF3C7; border-radius: 8px; font-size: 13px; color: #78350F; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }

.guia-callout { padding: 12px 16px; border-radius: 8px; margin: 10px 0; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.guia-callout--tip { background: #EFF6FF; border-left: 3px solid #3B82F6; color: #1E3A8A; }
.guia-callout--alerta { background: #FEF2F2; border-left: 3px solid #DC2626; color: #991B1B; }

/* ═══════ FAQ ═══════ */
.guia-det__faq { margin-top: 24px; }
.guia-faq-item { background: var(--card-bg, #fff); border: 1px solid var(--border-color, #e5e7eb); border-radius: 10px; padding: 14px 20px; margin-bottom: 8px; }
.guia-faq-item summary { cursor: pointer; font-weight: 600; color: var(--text-primary, #111); }
.guia-faq-item div { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-color, #e5e7eb); color: var(--text-secondary, #4b5563); font-size: 14px; line-height: 1.6; }

.guia-det__next-chips { display: flex; flex-wrap: wrap; gap: 10px; }

/* ═══════ DARK MODE ═══════ */
[data-theme="dark"] .guias__card,
[data-theme="dark"] .guia-paso,
[data-theme="dark"] .guia-faq-item,
[data-theme="dark"] .diag-node { background: #1F2937; border-color: #374151; }
[data-theme="dark"] .diag-flow { background: #111827; border-color: #374151; }
[data-theme="dark"] .diag-node--decision { background: #78350F; }
[data-theme="dark"] .diag-node--warn { background: #78350F; }
[data-theme="dark"] .diag-node--ok { background: #064E3B; }
[data-theme="dark"] .guia-paso__mod { background: #064E3B; color: #A7F3D0; }
[data-theme="dark"] .guia-paso__action { background: #78350F; color: #FCD34D; }
[data-theme="dark"] .guia-chip { background: #1E3A5F; color: #BFDBFE; }

@keyframes shine { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 640px) {
  .guias { padding: 16px; }
  .guias__hero { flex-direction: column; text-align: center; padding: 20px; }
  .guias__grid { grid-template-columns: 1fr; }
  .guia-det__hero-main { flex-direction: column; }
  .diag-node { min-width: 80%; }
}
