/* chatbot.css — Jawwad AI assistant widget */

/* ─── FAB ──────────────────────────────────────────────────────────────────── */
.cw-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 1001;
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 28px color-mix(in oklab, var(--accent), transparent 45%);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s ease, background 0.2s;
}
.cw-fab:hover { transform: scale(1.1); box-shadow: 0 8px 36px color-mix(in oklab, var(--accent), transparent 35%); }
.cw-fab-active { background: var(--card-2); box-shadow: 0 4px 20px rgba(0,0,0,.4); }
.cw-fab-active:hover { transform: scale(1.06); }

/* notification dot */
.cw-badge {
  position: absolute; top: 9px; right: 9px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--success); border: 2px solid var(--bg);
  animation: cw-pulse 2s ease-in-out infinite;
}
@keyframes cw-pulse {
  0%,100% { box-shadow: 0 0 0 0 color-mix(in oklab,var(--success),transparent 60%); }
  50%      { box-shadow: 0 0 0 5px color-mix(in oklab,var(--success),transparent 100%); }
}

/* ─── Panel ────────────────────────────────────────────────────────────────── */
.cw-panel {
  position: fixed; bottom: 96px; right: 28px; z-index: 1000;
  width: 360px; max-height: 540px;
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04);
  animation: cw-in 0.28s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes cw-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ─── Header ───────────────────────────────────────────────────────────────── */
.cw-header {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cw-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in oklab,var(--accent),transparent 70%);
}
.cw-hinfo { flex: 1; min-width: 0; }
.cw-hname { font-size: 13.5px; font-weight: 600; color: var(--text); }
.cw-hstatus {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--success); margin-top: 1px;
}
.cw-online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); display: inline-block; flex-shrink: 0;
}
.cw-close {
  background: transparent; border: 0; color: var(--muted);
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center;
  cursor: pointer; transition: color 0.15s, background 0.15s;
}
.cw-close:hover { color: var(--text); background: var(--surface); }

/* ─── Messages ─────────────────────────────────────────────────────────────── */
.cw-messages {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 9px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.cw-msg {
  max-width: 84%; padding: 10px 13px;
  font-size: 13.5px; line-height: 1.55;
  border-radius: 16px;
  animation: fadeIn 0.18s ease both;
  word-break: break-word;
}
.cw-bot {
  background: var(--surface); color: var(--text-dim);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
  align-self: flex-start;
}
.cw-user {
  background: var(--accent); color: #fff;
  border-bottom-right-radius: 5px;
  align-self: flex-end;
}
.cw-link {
  color: var(--accent-2); text-decoration: underline;
  word-break: break-all;
}
.cw-user .cw-link { color: rgba(255,255,255,0.85); }

/* typing dots */
.cw-typing {
  display: flex; gap: 5px; align-items: center;
  padding: 12px 14px !important;
}
.cw-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); display: inline-block;
  animation: cw-dot 1.2s ease-in-out infinite;
}
.cw-typing span:nth-child(2) { animation-delay: .18s; }
.cw-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes cw-dot {
  0%,60%,100% { transform: translateY(0); opacity: .35; }
  30%         { transform: translateY(-6px); opacity: 1; }
}

/* quick replies */
.cw-quick { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }
.cw-quick-btn {
  font-family: inherit; font-size: 12px;
  padding: 6px 13px; border-radius: 100px;
  background: var(--card-2); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cw-quick-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in oklab,var(--accent),transparent 92%);
}

/* ─── Input row ────────────────────────────────────────────────────────────── */
.cw-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.cw-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 9px 13px;
  color: var(--text); font-family: inherit; font-size: 13.5px;
  transition: border-color 0.15s;
}
.cw-input:focus { outline: none; border-color: var(--accent); }
.cw-input::placeholder { color: var(--muted); }
.cw-input:disabled { opacity: 0.55; cursor: not-allowed; }
.cw-send {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px;
  background: var(--accent); color: #fff; border: 0;
  display: grid; place-items: center; cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.cw-send:hover:not(:disabled) { transform: scale(1.07); }
.cw-send:disabled { opacity: 0.45; cursor: default; }

/* ─── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 440px) {
  .cw-panel { width: calc(100vw - 16px); right: 8px; bottom: 84px; max-height: 72vh; }
  .cw-fab   { bottom: 18px; right: 16px; }
}
