/* ============================================================
   Help Widget - Posso ajudar? (Mini Chat de Pesquisa)
   Dashboard
   ============================================================ */

.help-widget-trigger {
  position: fixed;
  bottom: 24px;
  left: calc(var(--app-sidebar-width, 250px) + 24px);
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #316AFF, #2555cc);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(49, 106, 255, 0.4);
  transition: all 0.3s ease;
}

.help-widget-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(49, 106, 255, 0.5);
}

.help-widget-trigger i {
  font-size: 18px;
}

.help-widget-card {
  position: fixed;
  bottom: 80px;
  left: calc(var(--app-sidebar-width, 250px) + 24px);
  width: 380px;
  max-width: calc(100vw - 48px);
  max-height: 520px;
  background: var(--bs-body-bg);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  z-index: 99998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  animation: helpWidgetSlideUp 0.3s ease-out;
}

.help-widget-card.is-open {
  display: flex;
}

@keyframes helpWidgetSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.help-widget-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #316AFF, #2555cc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-widget-header h6 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-widget-header h6 i {
  font-size: 18px;
}

.help-widget-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.help-widget-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.help-widget-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--bs-border-color);
}

.help-widget-search .form-control {
  border-radius: 10px;
  padding: 10px 14px 10px 40px;
  font-size: 14px;
}

.help-widget-search .input-wrapper {
  position: relative;
}

.help-widget-search .input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-secondary-color);
  font-size: 16px;
}

.help-widget-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  min-height: 200px;
}

.help-widget-welcome {
  padding: 16px;
  text-align: center;
}

.help-widget-welcome.is-hidden {
  display: none;
}

.help-widget-welcome i {
  font-size: 36px;
  color: var(--bs-primary);
  margin-bottom: 12px;
}

.help-widget-welcome p {
  margin: 0;
  font-size: 14px;
  color: var(--bs-secondary-color);
}

.help-widget-suggestions {
  margin-top: 12px;
}

.help-widget-suggestions-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin-bottom: 8px;
  padding: 0 4px;
}

.help-widget-suggestion-chip {
  display: inline-block;
  padding: 6px 12px;
  margin: 4px 4px 4px 0;
  background: var(--bs-light);
  border-radius: 20px;
  font-size: 12px;
  color: var(--bs-body-color);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.help-widget-suggestion-chip:hover {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}

.help-widget-results {
  display: none;
}

.help-widget-results.is-visible {
  display: block;
}

.help-widget-results-group {
  margin-bottom: 16px;
}

.help-widget-results-group:last-child {
  margin-bottom: 0;
}

.help-widget-results-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
  margin-bottom: 8px;
  padding: 0 4px;
}

.help-widget-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--bs-body-color);
  transition: background 0.2s;
  margin-bottom: 4px;
}

.help-widget-result-item:hover {
  background: var(--bs-light);
}

.help-widget-result-item i {
  font-size: 18px;
  color: var(--bs-primary);
  width: 24px;
  text-align: center;
}

.help-widget-result-item span {
  font-size: 14px;
  font-weight: 500;
}

.help-widget-empty {
  display: none;
  padding: 24px 16px;
  text-align: center;
}

.help-widget-empty.is-visible {
  display: block;
}

.help-widget-empty i {
  font-size: 40px;
  color: var(--bs-danger);
  margin-bottom: 12px;
}

.help-widget-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--bs-secondary-color);
}

/* Portal: sem sidebar, botão no canto esquerdo */
.portal-body .help-widget-trigger,
.portal-body .help-widget-card {
  left: 24px;
}

/* Mobile: sidebar é overlay, botão no canto esquerdo */
@media (max-width: 1199.98px) {
  .help-widget-trigger {
    left: 24px;
  }

  .help-widget-card {
    left: 24px;
  }
}
