/* ───────────────────────────────────────────
   Wizen AI Chat Widget
─────────────────────────────────────────── */

@keyframes chatBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-6px); }
}

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

/* Outer fixed wrapper */
.chat-widget {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* ── Panel ── */
.chat-panel {
  width: 360px;
  height: 500px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

/* ── Header ── */
.chat-header {
  background: linear-gradient(135deg, #1a237e 0%, #1565c0 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.chat-status {
  font-size: 12px;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #69f0ae;
  display: inline-block;
}

.chat-close-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chat-close-btn:hover {
  opacity: 1;
}

/* ── Messages ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5f6fa;
}

.chat-message-row {
  display: flex;
}

.chat-message-row--user {
  justify-content: flex-end;
}

.chat-message-row--assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.55;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  white-space: pre-wrap;
}

.chat-bubble--user {
  border-radius: 18px 18px 4px 18px;
  background: #1a237e;
  color: #fff;
}

.chat-bubble--assistant {
  border-radius: 18px 18px 18px 4px;
  background: #fff;
  color: #2d2d2d;
}

/* ── Typing indicator ── */
.chat-typing {
  display: flex;
  justify-content: flex-start;
}

.chat-typing-bubble {
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  display: flex;
  gap: 5px;
  align-items: center;
}

.chat-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a237e;
  display: inline-block;
  animation: chatBounce 1.2s infinite ease-in-out;
}

/* ── Input area ── */
.chat-input-area {
  padding: 12px 14px;
  border-top: 1px solid #e8eaf0;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  border: 1px solid #dde1ec;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  background: #f5f6fa;
  color: #2d2d2d;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #1a237e;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1a237e;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Toggle button ── */
.chat-toggle-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a237e 0%, #1565c0 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26, 35, 126, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(26, 35, 126, 0.55);
}
