/* Startups UAE AI Assistant — floating chatbot widget */
:root {
  --sua-chat-primary: #005822;
  --sua-chat-primary2: #00732F;
}

#sua-chatbot-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 1000;
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--sua-chat-primary), var(--sua-chat-primary2));
  color: #fff;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 88, 34, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#sua-chatbot-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 32px rgba(0, 88, 34, 0.45); }
#sua-chatbot-fab:focus-visible { outline: 3px solid #97f8a3; outline-offset: 2px; }
#sua-chatbot-fab .material-symbols-outlined { font-size: 28px; }
#sua-chatbot-fab .sua-fab-badge {
  position: absolute; top: -2px; right: -2px; width: 14px; height: 14px;
  background: #ba1a1a; border-radius: 50%; border: 2px solid #fff;
}

@media (max-width: 767px) {
  #sua-chatbot-fab { right: 16px; bottom: 76px; } /* clear the mobile sticky login/nav bars */
}

#sua-chatbot-panel {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 1000;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: min(640px, calc(100vh - 140px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(17, 20, 17, 0.22), 0 2px 8px rgba(17,20,17,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#sua-chatbot-panel.sua-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
@media (max-width: 480px) {
  #sua-chatbot-panel {
    right: 8px; left: 8px; width: auto; bottom: 86px;
    height: min(72vh, calc(100vh - 150px));
  }
}

#sua-chatbot-panel .sua-header {
  background: linear-gradient(135deg, var(--sua-chat-primary), var(--sua-chat-primary2));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
#sua-chatbot-panel .sua-header-icon {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#sua-chatbot-panel .sua-header-text { flex: 1; min-width: 0; }
#sua-chatbot-panel .sua-header-text .sua-title { font-weight: 800; font-size: 15px; line-height: 1.2; }
#sua-chatbot-panel .sua-header-text .sua-subtitle { font-size: 11.5px; opacity: 0.85; line-height: 1.3; }
#sua-chatbot-panel .sua-header-actions { display: flex; align-items: center; gap: 4px; }
#sua-chatbot-panel .sua-header-actions button {
  background: transparent; border: none; color: #fff; cursor: pointer; padding: 6px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  opacity: 0.9;
}
#sua-chatbot-panel .sua-header-actions button:hover { background: rgba(255,255,255,0.15); opacity: 1; }

#sua-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f7f9fc;
}

.sua-msg { display: flex; flex-direction: column; max-width: 86%; }
.sua-msg.sua-user { align-self: flex-end; align-items: flex-end; }
.sua-msg.sua-assistant { align-self: flex-start; align-items: flex-start; }
.sua-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.sua-msg.sua-user .sua-bubble { background: var(--sua-chat-primary); color: #fff; border-bottom-right-radius: 4px; }
.sua-msg.sua-assistant .sua-bubble { background: #fff; color: #191c1e; border: 1px solid #e6e8eb; border-bottom-left-radius: 4px; }
.sua-bubble a { color: var(--sua-chat-primary2); font-weight: 600; text-decoration: underline; }
.sua-msg.sua-user .sua-bubble a { color: #e0f5e4; }

.sua-typing { display: flex; gap: 4px; padding: 10px 14px; background: #fff; border: 1px solid #e6e8eb; border-radius: 16px; border-bottom-left-radius: 4px; width: fit-content; }
.sua-typing span { width: 6px; height: 6px; border-radius: 50%; background: #9aa39a; animation: sua-bounce 1.2s infinite ease-in-out; }
.sua-typing span:nth-child(2) { animation-delay: 0.15s; }
.sua-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes sua-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.sua-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; background: #f7f9fc; }
.sua-quick-actions button, .sua-suggestions button {
  background: #fff; border: 1px solid #becabb; color: var(--sua-chat-primary);
  font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 9999px;
  cursor: pointer; transition: background 0.15s ease;
}
.sua-quick-actions button:hover, .sua-suggestions button:hover { background: #eef7f0; }
.sua-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

#sua-chatbot-error {
  padding: 8px 16px; font-size: 12px; color: #93000a; background: #ffdad6; display: none;
}
#sua-chatbot-error.sua-show { display: block; }

.sua-input-row {
  display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px;
  border-top: 1px solid #e6e8eb; background: #fff;
}
.sua-input-row textarea {
  flex: 1; resize: none; border: 1px solid #becabb; border-radius: 14px;
  padding: 10px 14px; font-size: 13.5px; font-family: inherit; max-height: 100px;
  outline: none;
}
.sua-input-row textarea:focus { border-color: var(--sua-chat-primary); box-shadow: 0 0 0 2px rgba(0,88,34,0.15); }
.sua-input-row button {
  background: var(--sua-chat-primary); color: #fff; border: none; border-radius: 12px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: opacity 0.15s ease;
}
.sua-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

.sua-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
