/* ==========================================================================
   IMIGO DIGI AI TECHNOLOGIES — ASK IMIGO AI CHAT HUD
   Floating Button, Cybernetic Drawer, Qualification Flow, and Dossier Builder
   Theme: Deep Charcoal + Royal Plum (#37003c)
   ========================================================================== */

/* Floating Trigger Button */
#btn-chat-trigger {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-brand);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px var(--neon-brand-soft);
  border-radius: 40px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  z-index: 8000;
  transition: all var(--transition-normal);
}

#btn-chat-trigger:hover {
  transform: translateY(-4px);
  border-color: var(--neon-brand);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 35px var(--neon-brand-glow);
}

.chat-trigger-orb {
  position: relative;
  width: 16px;
  height: 16px;
}

.chat-trigger-orb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon-brand);
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 0 10px var(--neon-brand);
}

.chat-trigger-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--neon-brand);
  animation: radar-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radar-ping {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.chat-trigger-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-transform: uppercase;
}

.chat-trigger-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #ffffff;
  background: var(--neon-brand);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
}

/* Chat HUD Slide-out Drawer */
#chat-drawer {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 440px;
  max-width: calc(100vw - 40px);
  height: 620px;
  max-height: calc(100vh - 60px);
  background: rgba(10, 13, 22, 0.96);
  border: 1px solid var(--border-brand);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 45px rgba(55, 0, 60, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  z-index: 9000;
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

#chat-drawer.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(14, 18, 28, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--neon-brand) 0%, #0c0f1a 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--neon-brand-soft);
}

.chat-header-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.chat-header-status {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--neon-brand);
}

.chat-header-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}

.chat-header-close:hover {
  color: var(--neon-brand);
}

/* Chat Message Body */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
}

.chat-msg.agent {
  align-self: flex-start;
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.chat-msg.agent .chat-bubble {
  background: rgba(18, 24, 38, 0.9);
  border: 1px solid var(--border-subtle);
  color: #e6ebf5;
  border-bottom-left-radius: 2px;
}

.chat-msg.user .chat-bubble {
  background: var(--brand-purple);
  color: #ffffff;
  font-weight: 500;
  border: 1px solid rgba(217, 70, 239, 0.4);
  border-bottom-right-radius: 2px;
  box-shadow: 0 0 15px rgba(55, 0, 60, 0.8), 0 0 8px rgba(217, 70, 239, 0.3);
}

/* Growth Plan Dossier Card Generated in Chat */
.chat-dossier-card {
  background: #0d111d;
  border: 1px solid var(--border-brand);
  border-radius: 8px;
  padding: 16px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.dossier-title {
  color: var(--neon-brand);
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dossier-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.dossier-item span:first-child {
  color: var(--text-muted);
}
.dossier-item span:last-child {
  color: #ffffff;
  font-weight: 600;
}

/* Quick Prompt Suggestion Chips */
.chat-chips-row {
  display: flex;
  gap: 8px;
  padding: 0 20px 14px 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chat-chips-row::-webkit-scrollbar {
  display: none;
}

.chat-chip {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-chip:hover {
  background: rgba(55, 0, 60, 0.45);
  border-color: var(--border-brand);
  color: var(--neon-brand-bright);
}

/* Typing Indicator */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(18, 24, 38, 0.7);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--neon-brand);
  align-self: flex-start;
}

/* Chat Input Bar */
.chat-input-area {
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(12, 16, 26, 0.85);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-input-field {
  flex: 1;
  background: rgba(18, 23, 36, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input-field:focus {
  border-color: var(--neon-brand);
}

.chat-send-btn {
  background: var(--neon-brand);
  border: none;
  border-radius: 6px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: all var(--transition-fast);
}

.chat-send-btn:hover {
  background: var(--neon-brand-bright);
  box-shadow: 0 0 12px var(--neon-brand);
}
