/* Zeon Infotech — Chatbot widget */

.zeon-chatbot {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  right: max(1.25rem, env(safe-area-inset-right));
  z-index: 1040;
  font-family: var(--font-body, "Inter", sans-serif);
}

.zeon-chatbot__toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--gradient-btn, linear-gradient(45deg, #040dae, #2b4df6));
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 6px 24px rgba(43, 77, 246, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.zeon-chatbot__toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 32px rgba(43, 77, 246, 0.55);
}
.zeon-chatbot__toggle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(43, 77, 246, 0.35);
  animation: chatbotPulse 2s ease-out infinite;
}
@keyframes chatbotPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.25); opacity: 0; }
}

.zeon-chatbot__panel {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 2rem);
  max-height: min(520px, calc(100vh - 140px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(4, 19, 53, 0.18);
  border: 1px solid var(--border, #e9e8ec);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  transform-origin: bottom right;
}
.zeon-chatbot__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.zeon-chatbot__header {
  background: var(--gradient-banner, linear-gradient(to top, #040dae, #000033));
  color: #fff;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.zeon-chatbot__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.zeon-chatbot__header-text h3 {
  margin: 0;
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 1rem;
  font-weight: 700;
}
.zeon-chatbot__header-text p {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.85;
}
.zeon-chatbot__header-text p::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.zeon-chatbot__close {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.zeon-chatbot__close:hover { background: rgba(255,255,255,0.25); }

.zeon-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 200px;
  max-height: 280px;
  background: #f8f9fc;
  -webkit-overflow-scrolling: touch;
}

.zeon-chatbot__msg {
  max-width: 88%;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.zeon-chatbot__msg a {
  color: var(--primary, #2b4df6) !important;
  font-weight: 600;
  text-decoration: underline;
}
.zeon-chatbot__msg--bot {
  align-self: flex-start;
  background: #fff;
  color: var(--text, #041335);
  border: 1px solid var(--border, #e9e8ec);
  border-bottom-left-radius: 4px;
}
.zeon-chatbot__msg--user {
  align-self: flex-end;
  background: var(--primary, #2b4df6);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.zeon-chatbot__typing {
  display: flex;
  gap: 4px;
  padding: 0.85rem 1rem;
}
.zeon-chatbot__typing span {
  width: 7px;
  height: 7px;
  background: var(--text-muted, #96a1ba);
  border-radius: 50%;
  animation: chatbotDot 1.2s infinite ease-in-out;
}
.zeon-chatbot__typing span:nth-child(2) { animation-delay: 0.15s; }
.zeon-chatbot__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatbotDot {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.zeon-chatbot__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem 1rem 0;
  flex-shrink: 0;
}
.zeon-chatbot__chip {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(43, 77, 246, 0.35);
  background: rgba(43, 77, 246, 0.06);
  color: var(--primary, #2b4df6);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.zeon-chatbot__chip:hover {
  background: rgba(43, 77, 246, 0.12);
  border-color: var(--primary, #2b4df6);
}

.zeon-chatbot__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border, #e9e8ec);
  background: #fff;
  flex-shrink: 0;
}
.zeon-chatbot__input {
  flex: 1;
  border: 1px solid var(--border, #e9e8ec);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  outline: none;
  min-width: 0;
}
.zeon-chatbot__input:focus {
  border-color: var(--primary, #2b4df6);
  box-shadow: 0 0 0 3px rgba(43, 77, 246, 0.12);
}
.zeon-chatbot__send {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--gradient-btn, linear-gradient(45deg, #040dae, #2b4df6));
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.zeon-chatbot__send:hover { transform: scale(1.05); }

@media (max-width: 420px) {
  .zeon-chatbot {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
  .zeon-chatbot__panel {
    width: calc(100vw - 1.5rem);
    right: -0.25rem;
  }
}
