/* ==========================================================================
   ONBOARDING & CENTRAL DE AJUDA "COMO FAZER" - HORBACH AGRÍCOLA
   Aparência moderna, profissional e de alta legibilidade
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BANNER DE PRIMEIRO ACESSO (PROGRESSIVO & DISPENSÁVEL)
   -------------------------------------------------------------------------- */
.horbach-onboarding-banner {
  background: linear-gradient(135deg, #15181B 0%, #1E2328 100%);
  color: #FFFFFF;
  border-bottom: 3px solid var(--color-primary, #2E9A38);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 990;
  animation: hbSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hbSlideDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.horbach-onboarding-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.horbach-onboarding-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 260px;
}

.horbach-onboarding-badge {
  background: var(--color-primary, #2E9A38);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.horbach-onboarding-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
  color: #FFFFFF;
}

.horbach-onboarding-desc {
  font-size: 0.8rem;
  color: #ADB5BD;
  margin: 2px 0 0;
}

.horbach-onboarding-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.horbach-step-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: #DEE2E6;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.horbach-step-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
}

.horbach-step-chip.is-completed {
  background: rgba(46, 154, 56, 0.2);
  border-color: var(--color-primary, #2E9A38);
  color: #A3E635;
}

.horbach-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.horbach-step-chip.is-completed .horbach-step-num {
  background: var(--color-primary, #2E9A38);
}

.horbach-onboarding-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-onboarding-help {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-onboarding-help:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #FFFFFF;
}

.btn-onboarding-dismiss {
  background: transparent;
  border: none;
  color: #9CA3AF;
  font-size: 0.78rem;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s;
}

.btn-onboarding-dismiss:hover {
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   2. BOTÃO DE AJUDA NO HEADER
   -------------------------------------------------------------------------- */
.btn-header-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 8px 14px;
  border-radius: 8px;
  color: #1E293B;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-help:hover {
  background: #E2E8F0;
  color: var(--color-primary, #2E9A38);
  border-color: var(--color-primary, #2E9A38);
}

.btn-header-help svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

/* --------------------------------------------------------------------------
   3. GAVETA LATERAL (HELP DRAWER - "COMO FAZER")
   -------------------------------------------------------------------------- */
.horbach-help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.horbach-help-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.horbach-help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 520px;
  background: #FFFFFF;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.horbach-help-overlay.is-open .horbach-help-drawer {
  transform: translateX(0);
}

/* Header da Gaveta */
.horbach-help-header {
  padding: 20px 24px;
  background: #15181B;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--color-primary, #2E9A38);
}

.horbach-help-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.horbach-help-header-title h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: #FFFFFF;
  line-height: 1.2;
}

.horbach-help-header-title p {
  font-size: 0.78rem;
  color: #94A3B8;
  margin: 2px 0 0;
}

.horbach-help-close {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.2s;
}

.horbach-help-close:hover {
  color: #FFFFFF;
}

/* Barra de Busca no Topo do Drawer */
.horbach-help-search-box {
  padding: 16px 24px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.horbach-help-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.88rem;
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.horbach-help-search-input:focus {
  border-color: var(--color-primary, #2E9A38);
  box-shadow: 0 0 0 3px rgba(46, 154, 56, 0.15);
}

.horbach-help-search-wrapper {
  position: relative;
}

.horbach-help-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94A3B8;
}

/* Ações Rápidas de Destaque */
.horbach-help-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 24px;
  background: #FFFFFF;
  border-bottom: 1px solid #F1F5F9;
}

.horbach-quick-card {
  padding: 12px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s;
}

.horbach-quick-card:hover {
  background: #F0FDF4;
  border-color: var(--color-primary, #2E9A38);
  transform: translateY(-1px);
}

.horbach-quick-card strong {
  font-size: 0.84rem;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 6px;
}

.horbach-quick-card span {
  font-size: 0.74rem;
  color: #64748B;
}

/* Corpo da Gaveta */
.horbach-help-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 32px;
}

/* Categorias de Tutoriais */
.horbach-tutorial-group {
  margin-bottom: 24px;
}

.horbach-group-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.horbach-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E2E8F0;
}

/* Item de Tutorial Accordion */
.horbach-tutorial-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.horbach-tutorial-card:hover {
  border-color: #CBD5E1;
}

.horbach-tutorial-card.is-active {
  border-color: var(--color-primary, #2E9A38);
  box-shadow: 0 4px 12px rgba(46, 154, 56, 0.08);
}

.horbach-tutorial-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: #FFFFFF;
  user-select: none;
}

.horbach-tutorial-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1E293B;
  display: flex;
  align-items: center;
  gap: 10px;
}

.horbach-tutorial-chevron {
  width: 18px;
  height: 18px;
  color: #94A3B8;
  transition: transform 0.25s ease;
}

.horbach-tutorial-card.is-active .horbach-tutorial-chevron {
  transform: rotate(180deg);
  color: var(--color-primary, #2E9A38);
}

.horbach-tutorial-content {
  display: none;
  padding: 0 16px 16px;
  font-size: 0.85rem;
  color: #334155;
  border-top: 1px solid #F1F5F9;
  background: #FAFAFA;
}

.horbach-tutorial-card.is-active .horbach-tutorial-content {
  display: block;
}

.horbach-tutorial-content p {
  margin: 12px 0 8px;
  line-height: 1.5;
}

/* Lista de Passos */
.horbach-step-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 14px;
  counter-reset: hb-counter;
}

.horbach-step-list li {
  counter-increment: hb-counter;
  position: relative;
  padding-left: 28px;
  margin-bottom: 8px;
  line-height: 1.45;
}

.horbach-step-list li::before {
  content: counter(hb-counter);
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary, #2E9A38);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.horbach-tutorial-tip {
  background: #FEF3C7;
  border-left: 3px solid #D97706;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #92400E;
  margin-top: 10px;
}

.horbach-tutorial-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 14px;
  border-radius: 6px;
  background: var(--color-primary, #2E9A38);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  transition: opacity 0.2s;
}

.horbach-tutorial-action-btn:hover {
  opacity: 0.9;
}

/* Footer da Gaveta */
.horbach-help-footer {
  padding: 16px 24px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.horbach-help-footer-contact {
  font-size: 0.76rem;
  color: #64748B;
  line-height: 1.35;
}

.horbach-help-footer-contact strong {
  color: #0F172A;
  display: block;
}

/* Botão Flutuante de Ajuda (Mobile ou quando rolado) */
.horbach-float-help {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #15181B;
  color: #FFFFFF;
  border: 2px solid var(--color-primary, #2E9A38);
  border-radius: 999px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  z-index: 950;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.horbach-float-help:hover {
  transform: translateY(-2px);
  background: #20252A;
  box-shadow: 0 8px 24px rgba(46, 154, 56, 0.3);
}

@media (max-width: 768px) {
  .horbach-onboarding-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .horbach-onboarding-steps {
    justify-content: flex-start;
    width: 100%;
  }
  .horbach-help-drawer {
    max-width: 100%;
  }
  .horbach-help-quick-actions {
    grid-template-columns: 1fr;
  }
}
