/* ═══════════════════════════════════════════════════════════════════
   SafeGuard Pro — Widget Flotante de Ayuda
   ═══════════════════════════════════════════════════════════════════
   Botón flotante siempre visible + modal con opciones de ayuda.
   Diseñado para no interferir con el layout existente.
*/

/* Botón flotante */
.sgp-help-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--am, #FF8F00);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 143, 0, 0.4);
  font-family: inherit;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.sgp-help-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(255, 143, 0, 0.5);
}
.sgp-help-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  font-size: 12px;
  font-weight: 700;
}

/* Modal backdrop */
.sgp-help-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9991;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}
.sgp-help-modal.open {
  display: flex;
  opacity: 1;
}

/* Modal box */
.sgp-help-box {
  background: var(--gris, #263238);
  border: 1px solid var(--bo, #30363D);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 28px;
  color: var(--tx, #E6EDF3);
  font-family: inherit;
}

.sgp-help-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.sgp-help-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--tx, #E6EDF3);
  letter-spacing: -0.01em;
}
.sgp-help-close {
  background: none;
  border: none;
  color: var(--td, #8B949E);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.sgp-help-close:hover {
  background: rgba(255,255,255,0.08);
  color: var(--tx, #E6EDF3);
}
.sgp-help-sub {
  font-size: 12.5px;
  color: var(--td, #8B949E);
  margin-bottom: 20px;
  line-height: 1.55;
}

/* Option cards */
.sgp-help-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sgp-help-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--bo, #30363D);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--tx, #E6EDF3);
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
  width: 100%;
}
.sgp-help-option:hover {
  border-color: var(--am, #FF8F00);
  background: rgba(255,143,0,0.08);
}
.sgp-help-option:active {
  transform: translateY(1px);
}
.sgp-help-option-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.sgp-help-option-body {
  flex: 1;
  min-width: 0;
}
.sgp-help-option-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx, #E6EDF3);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sgp-help-option-desc {
  font-size: 12px;
  color: var(--td, #8B949E);
  line-height: 1.5;
}
.sgp-help-completed-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(0, 200, 83, 0.15);
  color: var(--ve, #00C853);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sgp-help-divider {
  height: 1px;
  background: var(--bo, #30363D);
  margin: 16px 0 12px;
}

.sgp-help-footer-note {
  font-size: 11px;
  color: var(--td, #8B949E);
  text-align: center;
  margin-top: 16px;
  line-height: 1.5;
}

/* Ocultar botón flotante mientras un tour está corriendo (para no estorbar) */
body.sgp-tutorial-active .sgp-help-fab { display: none; }

@media (max-width: 640px) {
  .sgp-help-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 12.5px;
  }
  .sgp-help-box {
    padding: 20px 22px;
  }
}
