/* Hazem assistant widget — scoped under #hazem-root. Reuses site :root tokens
   (--orange, --charcoal, --slate, --white) and the Inter font already loaded. */

#hazem-root, #hazem-root * { box-sizing: border-box; }

#hazem-root {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  z-index: 2147483000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* FAB */
.hz-fab {
  width: 60px; height: 60px; border-radius: 50%;
  border: none; padding: 0; cursor: pointer;
  background: var(--charcoal, #2D3436);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  outline: 2px solid rgba(255,255,255,0.85);
  outline-offset: 0;
}
.hz-fab:hover { transform: scale(1.06); }
.hz-fab:active { transform: scale(0.95); }
.hz-fab img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hz-fab .hz-x { color: #fff; font-size: 28px; line-height: 60px; }

/* Panel */
.hz-panel {
  position: absolute;
  bottom: 74px;
  inset-inline-end: 0;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.30);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
}
#hazem-root[dir="rtl"] { font-family: 'Inter', 'Noto Sans Arabic', sans-serif; }

/* Header */
.hz-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--charcoal, #2D3436); }
.hz-head img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; outline: 2px solid rgba(255,255,255,0.25); }
.hz-head .hz-meta { flex: 1; min-width: 0; }
.hz-head .hz-name { color: #fff; font-size: 14px; font-weight: 700; line-height: 1.2; }
.hz-head .hz-tag { color: rgba(255,255,255,0.6); font-size: 11px; }
.hz-head button { background: transparent; border: none; color: rgba(255,255,255,0.8); cursor: pointer; border-radius: 6px; padding: 4px 8px; font-size: 12px; }
.hz-head button:hover { background: rgba(255,255,255,0.12); }
.hz-head .hz-close { font-size: 20px; line-height: 1; }

/* Tabs */
.hz-tabs { display: flex; border-bottom: 1px solid rgba(0,0,0,0.06); background: #fff; }
.hz-tabs button {
  flex: 1; padding: 11px 6px; border: none; background: transparent; cursor: pointer;
  font: 600 12px 'Inter', sans-serif; color: #9aa0a6; border-bottom: 2px solid transparent;
}
.hz-tabs button.active { color: var(--charcoal, #2D3436); border-bottom-color: var(--orange, #FF8C42); }

/* Body */
.hz-body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.hz-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }
.hz-intro { font-size: 12px; color: #6b7280; margin: 0 0 10px; }

/* Answers (FAQ) */
.hz-faq { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hz-faq li { border: 1px solid rgba(0,0,0,0.07); border-radius: 12px; background: #fafafa; overflow: hidden; }
.hz-faq .hz-q { width: 100%; text-align: start; display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 11px 12px; border: none; background: transparent; cursor: pointer; font: 600 13.5px 'Inter', sans-serif; color: var(--charcoal, #2D3436); }
.hz-faq .hz-q .hz-pm { color: #9aa0a6; font-weight: 400; }
.hz-faq .hz-a { padding: 0 12px 12px; font-size: 13px; line-height: 1.6; color: #555; }
.hz-faq .hz-a .hz-ask { margin-top: 8px; background: none; border: none; padding: 0; cursor: pointer; color: var(--orange, #FF8C42); font: 700 12px 'Inter', sans-serif; }

.hz-cta {
  margin-top: 14px; width: 100%; padding: 11px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--orange, #FF8C42); color: #fff; font: 700 13.5px 'Inter', sans-serif;
}
.hz-cta:hover { filter: brightness(0.96); }

/* Chat */
.hz-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.hz-row { display: flex; }
.hz-row.user { justify-content: flex-end; }
.hz-bubble { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.hz-row.user .hz-bubble { background: var(--charcoal, #2D3436); color: #fff; }
.hz-row.bot .hz-bubble { background: #f1f2f4; color: #333; }
.hz-typing { font-size: 12px; color: #9aa0a6; padding: 0 4px; }
.hz-inputbar { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(0,0,0,0.06); }
.hz-inputbar input { flex: 1; min-width: 0; border: 1px solid rgba(0,0,0,0.12); border-radius: 999px; padding: 9px 13px; font-size: 13px; outline: none; }
.hz-inputbar input:focus { border-color: var(--slate, #607280); }
.hz-inputbar button { border: none; border-radius: 999px; padding: 9px 16px; cursor: pointer; background: var(--orange, #FF8C42); color: #fff; font: 700 13px 'Inter', sans-serif; }
.hz-inputbar button:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 480px) {
  #hazem-root { bottom: 14px; inset-inline-end: 14px; }
  .hz-panel { width: calc(100vw - 28px); height: min(70vh, 520px); }
}
