/* agentseffect.com — floating chat widget */

#ae-chat-root {
  position: fixed;
  z-index: 900;
  bottom: 24px;
  right: 24px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #101217;
}

/* -- Toggle button -------------------------------------------------------- */

#ae-chat-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #18b9b2;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(24, 185, 178, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#ae-chat-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 32px rgba(24, 185, 178, 0.45);
}

#ae-chat-toggle:focus-visible {
  outline: 3px solid #b7e23a;
  outline-offset: 3px;
}

#ae-chat-toggle svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

#ae-chat-toggle .ae-icon-close {
  display: none;
}

#ae-chat-root.is-open #ae-chat-toggle .ae-icon-chat {
  display: none;
}

#ae-chat-root.is-open #ae-chat-toggle .ae-icon-close {
  display: block;
}

/* -- Panel ---------------------------------------------------------------- */

#ae-chat-panel {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 380px;
  max-height: min(520px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #cfe1e0;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(16, 18, 23, 0.12);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#ae-chat-root.is-open #ae-chat-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* -- Header --------------------------------------------------------------- */

#ae-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #f5fafa;
  border-bottom: 1px solid #cfe1e0;
  flex-shrink: 0;
}

#ae-chat-header .ae-chat-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#ae-chat-header .ae-chat-brand-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

#ae-chat-header .ae-chat-logo {
  height: 18px;
  width: auto;
  flex-shrink: 0;
}

#ae-chat-header .ae-brand {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  line-height: 1;
  direction: ltr;
  unicode-bidi: isolate;
}

#ae-chat-header .ae-brand-agents {
  color: #087a78;
}

#ae-chat-header .ae-brand-effect {
  color: #74183a;
}

#ae-chat-header .ae-brand-dot {
  color: #b7e23a;
  font-size: 16px;
  line-height: 1;
  margin-left: 4px;
  margin-right: 0;
}

/* -- Messages area -------------------------------------------------------- */

#ae-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 120px;
  background: #fff;
}

#ae-chat-messages::-webkit-scrollbar {
  width: 5px;
}

#ae-chat-messages::-webkit-scrollbar-thumb {
  background: #cfe1e0;
  border-radius: 3px;
}

/* -- Message bubbles ------------------------------------------------------ */

.ae-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.ae-msg-user {
  align-self: flex-end;
  background: #18b9b2;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ae-msg-assistant {
  align-self: flex-start;
  background: #f5fafa;
  border: 1px solid #eaf4f3;
  border-bottom-left-radius: 4px;
}

.ae-msg-assistant a {
  color: #087a78;
  text-decoration: underline;
}

.ae-msg-error {
  align-self: center;
  background: #fff0e9;
  border: 1px solid #f36a2d;
  color: #3d444d;
  font-size: 13px;
  text-align: center;
}

/* -- Sources -------------------------------------------------------------- */

.ae-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.ae-sources a {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e7f8f7;
  color: #087a78;
  text-decoration: none;
  white-space: nowrap;
}

.ae-sources a:hover {
  background: #18b9b2;
  color: #fff;
}

/* -- Typing indicator ----------------------------------------------------- */

.ae-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
  background: #f5fafa;
  border: 1px solid #eaf4f3;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.ae-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ab9b7;
  animation: ae-bounce 1.2s infinite;
}

.ae-typing span:nth-child(2) { animation-delay: 0.2s; }
.ae-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ae-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* -- Input form ----------------------------------------------------------- */

#ae-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #cfe1e0;
  background: #fff;
  flex-shrink: 0;
}

#ae-chat-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #cfe1e0;
  border-radius: 12px;
  font-size: 14px;
  background: #fbfefe;
  outline: none;
  transition: border-color 0.15s;
}

#ae-chat-input:focus {
  border-color: #18b9b2;
}

#ae-chat-form button[type="submit"] {
  padding: 10px 16px;
  border: none;
  border-radius: 12px;
  background: #18b9b2;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

#ae-chat-form button[type="submit"]:hover {
  background: #087a78;
}

#ae-chat-form button[type="submit"]:disabled {
  background: #cfe1e0;
  cursor: not-allowed;
}

/* -- Welcome message ------------------------------------------------------ */

.ae-welcome {
  text-align: center;
  color: #3d444d;
  font-size: 13px;
  padding: 20px 12px;
}

.ae-welcome strong {
  display: block;
  font-size: 15px;
  color: #101217;
  margin-bottom: 4px;
}

/* -- Quick-question chips -------------------------------------------------- */

.ae-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 0 4px 4px;
}

.ae-chip {
  padding: 6px 12px;
  border: 1px solid #cfe1e0;
  border-radius: 14px;
  background: #fbfefe;
  color: #087a78;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ae-chip:hover {
  background: #e7f8f7;
  border-color: #087a78;
}

.ae-chip:focus-visible {
  outline: 2px solid #b7e23a;
  outline-offset: 2px;
}

/* -- CTA strip (Telegram / email) ----------------------------------------- */

.ae-cta {
  padding: 10px 16px 14px;
  border-top: 1px solid #cfe1e0;
  background: #f5fafa;
  text-align: center;
  flex-shrink: 0;
}

.ae-cta-title {
  display: block;
  font-size: 12px;
  color: #3d444d;
  margin-bottom: 8px;
}

.ae-cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ae-cta-buttons a {
  display: block;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.ae-cta-telegram {
  background: #087a78;
  color: #fff;
}

.ae-cta-telegram:hover {
  background: #065f5d;
}

.ae-cta-email {
  border: 1px solid #087a78;
  color: #087a78;
  background: #fff;
}

.ae-cta-email:hover {
  background: #e7f8f7;
}

/* -- Responsive ----------------------------------------------------------- */

@media (max-width: 560px) {
  #ae-chat-root {
    bottom: 16px;
    right: 16px;
  }

  #ae-chat-panel {
    position: fixed;
    bottom: 80px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 120px);
  }
}
