/* ─── Chatbot Floating Widget Styles ──────────────── */

:root {
  --chat-primary: #38bdf8;
  --chat-bg-dark: #0e1420;
  --chat-bg-glass: rgba(14, 20, 32, 0.85);
  --chat-border: rgba(56, 189, 248, 0.15);
  --chat-text-primary: #f0f6ff;
  --chat-text-secondary: #8a9ab8;
  --chat-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(56, 189, 248, 0.08);
}

/* Floating chat button */
#nexus-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chat-primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.4), 0 0 0 1px rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#nexus-chat-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.6), 0 0 0 1px rgba(56, 189, 248, 0.5);
}

#nexus-chat-trigger svg {
  width: 28px;
  height: 28px;
  fill: #050810;
  transition: transform 0.3s ease;
}

#nexus-chat-trigger.active svg {
  transform: rotate(90deg);
}

/* Chat container window */
#nexus-chat-container {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 580px;
  max-height: calc(100vh - 120px);
  border-radius: 12px;
  background: var(--chat-bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--chat-border);
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#nexus-chat-container.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Chat header */
.nexus-chat-header {
  padding: 1.25rem;
  background: rgba(8, 12, 18, 0.8);
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nexus-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexus-chat-header-info h4 {
  margin: 0;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--chat-text-primary);
}

.nexus-chat-header-info span {
  font-size: 0.75rem;
  color: var(--chat-primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nexus-chat-online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Message board */
.nexus-chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nexus-chat-msg {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: messageFadeIn 0.3s ease forwards;
}

.nexus-chat-msg.bot {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--chat-text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.nexus-chat-msg.user {
  background: var(--chat-primary);
  color: #050810;
  font-weight: 500;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

/* Interactive elements in messages (buttons / widgets) */
.nexus-chat-calendly-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #050810;
  color: var(--chat-primary) !important;
  border: 1px solid var(--chat-primary);
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-top: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexus-chat-calendly-btn:hover {
  background: var(--chat-primary);
  color: #050810 !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

/* Typing indicator */
.nexus-chat-typing {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-bottom-left-radius: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nexus-chat-typing span {
  width: 6px;
  height: 6px;
  background: var(--chat-text-secondary);
  border-radius: 50%;
  animation: typing-bubble 1s infinite ease-in-out;
}

.nexus-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.nexus-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

/* Input area */
.nexus-chat-input-area {
  padding: 1rem;
  background: rgba(8, 12, 18, 0.9);
  border-top: 1px solid var(--chat-border);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nexus-chat-input-area textarea {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--chat-border);
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  color: white;
  font-family: inherit;
  font-size: 0.88rem;
  resize: none;
  height: 38px;
  outline: none;
  transition: border-color 0.2s ease;
}

.nexus-chat-input-area textarea:focus {
  border-color: var(--chat-primary);
}

.nexus-chat-send-btn {
  background: var(--chat-primary);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nexus-chat-send-btn:hover {
  background: #7dd3fc;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.nexus-chat-send-btn svg {
  width: 18px;
  height: 18px;
  fill: #050810;
}

/* Animations */
@keyframes messageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes typing-bubble {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Responsive adjustment */
@media (max-width: 450px) {
  #nexus-chat-container {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 88px;
    height: 500px;
  }
}
