/* EIE Chatbot Widget - Plug & Play */
:root {
  --eie-chat-primary: #BD2F2B;
  --eie-chat-accent: #BD2F2B;
  --eie-chat-bg: #ffffff;
  --eie-chat-muted: #64748b;
  --eie-chat-border: #e2e8f0;
  --eie-chat-user: #0b0b0c;
  --eie-chat-bot: #f1f5f9;
  --eie-chat-danger: #b42318;
  --eie-chat-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}

.eie-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  width: 125px;
  height: 62px;
  border: none;
  border-radius: 999px;
  background: var(--eie-chat-accent);
  color: white;
  box-shadow: var(--eie-chat-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eie-chat-launcher:hover { transform: translateY(-2px); }
.eie-chat-launcher svg { width: 28px; height: 28px; }

.eie-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 96px;
  z-index: 999999;
  width: min(390px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 130px));
  background: var(--eie-chat-bg);
  border: 1px solid var(--eie-chat-border);
  border-radius: 22px;
  box-shadow: var(--eie-chat-shadow);
  overflow: hidden;
  display: none;
  flex-direction: column;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.eie-chat-panel.eie-chat-open { display: flex; }

.eie-chat-header {
  padding: 16px 18px;
  background: var(--eie-chat-primary);
  color: white;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
}


.eie-chat-title { font-size: 16px; font-weight: 700; margin: 0; }
.eie-chat-subtitle { font-size: 12px; opacity: 0.82; margin-top: 3px; }

.eie-chat-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.eie-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
}

.eie-chat-message {
  margin-bottom: 12px;
  display: flex;
}

.eie-chat-message.user { justify-content: flex-end; }
.eie-chat-message.bot { justify-content: flex-start; }

.eie-chat-bubble {
  max-width: 82%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.eie-chat-message.user .eie-chat-bubble {
  background: var(--eie-chat-user);
  color: white;
  border-bottom-right-radius: 5px;
}

.eie-chat-message.bot .eie-chat-bubble {
  background: var(--eie-chat-bot);
  color: #0f172a;
  border: 1px solid var(--eie-chat-border);
  border-bottom-left-radius: 5px;
}

.eie-chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  background: #f8fafc;
}

.eie-chat-chip {
  border: 1px solid var(--eie-chat-border);
  background: white;
  color: #0f172a;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
}

.eie-chat-chip:hover { border-color: var(--eie-chat-accent); }

.eie-chat-status {
  padding: 0 16px 10px;
  font-size: 12px;
  color: var(--eie-chat-muted);
  background: #f8fafc;
  min-height: 18px;
}

.eie-chat-status.error { color: var(--eie-chat-danger); }

.eie-chat-form {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--eie-chat-border);
  background: white;
}

.eie-chat-input {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 100px;
  border-radius: 14px;
  border: 1px solid var(--eie-chat-border);
  padding: 12px 13px;
  font-size: 16px;
  outline: none;
  font-family: inherit;
}

.eie-chat-input:focus {
  border-color: var(--eie-chat-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.eie-chat-send {
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  background: var(--eie-chat-accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.eie-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.eie-chat-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--eie-chat-accent);
  font-weight: 700;
  text-decoration: none;
}

.eie-chat-link:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .eie-chat-panel {
    right: 14px;
    bottom: 88px;
    height: min(640px, calc(100vh - 112px));
  }
  .eie-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
}
