/* ===== Help system — Edge static pages =====
   Modal de ajuda usado nas páginas WMS/MES/APS servidas pelo edge.
   Conteúdo é definido em cada HTML via window.HELP_CONTENT.
   ============================================================ */

#help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
  font-weight: 600;
}
#help-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transform: scale(1.05);
}

#help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
#help-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

#help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9991;
  height: 100%;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms ease-out;
  color: #fff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
#help-drawer.open {
  transform: translateX(0);
}

.help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.help-header .help-category {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4CAF50;
  margin-bottom: 4px;
}
.help-header h2 {
  font-size: 18px;
  margin: 0;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.help-header .help-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.help-header .help-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.help-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

.help-overview {
  font-size: 14px;
  line-height: 1.6;
  color: #ddd;
  margin-bottom: 20px;
}

.help-section {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(8px);
  animation: help-fade-in 280ms ease-out forwards;
}
.help-section:nth-child(2) { animation-delay: 60ms; }
.help-section:nth-child(3) { animation-delay: 120ms; }
.help-section:nth-child(4) { animation-delay: 180ms; }
.help-section:nth-child(5) { animation-delay: 240ms; }

.help-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.help-section h3 .help-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(76, 175, 80, 0.15);
  color: #4CAF50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.help-section p {
  font-size: 13px;
  line-height: 1.6;
  color: #ddd;
  margin: 0 0 8px;
  white-space: pre-line;
}
.help-section ol {
  padding-left: 0;
  list-style: none;
  margin: 8px 0 0;
}
.help-section ol li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: #ddd;
  margin-bottom: 8px;
  line-height: 1.5;
}
.help-section ol li::before {
  content: counter(step-counter);
  counter-increment: step-counter;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.2);
  color: #8BC34A;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.help-section ol { counter-reset: step-counter; }

.help-tip {
  margin-top: 8px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #fde68a;
  line-height: 1.5;
}
.help-tip::before {
  content: "💡 ";
}

.help-warning {
  margin-top: 8px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #fecaca;
  line-height: 1.5;
}
.help-warning::before {
  content: "⚠ ";
}

.help-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 20px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.help-footer kbd {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 10px;
}

@keyframes help-fade-in {
  to { opacity: 1; transform: translateY(0); }
}
