/* =============================================================
   Engage Agent – Chat Widget Styles
   ============================================================= */

/* Outer wrapper */
.engage-agent-wrap {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px 28px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Header */
.engage-agent-header {
  margin-bottom: 12px;
}

.engage-agent-title {
  margin: 0 0 4px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
}

/* Chat card */
.engage-agent-chat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px;
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.08),
    0 2px 6px  rgba(15, 23, 42, 0.04);
}

/* Chat log */
.engage-chat-log {
  height: 460px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px;
  background: #fafafa;
  scroll-behavior: smooth;
}

@media (min-height: 900px) {
  .engage-chat-log { height: 520px; }
}

/* Messages */
.engage-msg {
  display: flex;
  margin: 8px 0;
}

.engage-msg--user      { justify-content: flex-end; }
.engage-msg--assistant { justify-content: flex-start; }

.engage-bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #0f172a;
}

.engage-msg--user .engage-bubble {
  background: #e9f2ff;
  border-color: #cfe2ff;
}

/* Typing indicator */
.engage-bubble--typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  min-width: 52px;
}

.engage-bubble--typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: engage-bounce 1.2s infinite ease-in-out;
}

.engage-bubble--typing span:nth-child(2) { animation-delay: 0.2s; }
.engage-bubble--typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes engage-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40%           { transform: scale(1.0); opacity: 1.0; }
}

/* Input row */
.engage-chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
  align-items: start;
}

#engage-chat-message {
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.4;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

#engage-chat-message:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#engage-chat-send {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

#engage-chat-send:hover    { opacity: 0.88; }
#engage-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Status line */
.engage-chat-status {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  min-height: 16px;
}

/* Suggested questions */
.engage-suggested-list {
  display: none; /* shown by JS when questions exist */
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.engage-suggested-btn {
  padding: 7px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.engage-suggested-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Responsive */
@media (max-width: 600px) {
  .engage-chat-input-row {
    grid-template-columns: 1fr;
  }

  #engage-chat-send {
    width: 100%;
  }

  .engage-bubble {
    max-width: 92%;
  }
}
