/* ==============================================================================
   AXION IA - FLOATING CHAT WIDGET (CSS)
   Design: Dark Mode Glassmorphism com Acentos Neon Ciano/Azul Elétrico
   ============================================================================== */

:root {
  --axion-bg: #0B0E14;
  --axion-card: #0F172A;
  --axion-border: #1E293B;
  --axion-border-glow: rgba(6, 182, 212, 0.4);
  --axion-cyan: #06B6D4;
  --axion-cyan-glow: 0 0 15px rgba(6, 182, 212, 0.5);
  --axion-blue: #3B82F6;
  --axion-emerald: #10B981;
  --axion-text: #F1F5F9;
  --axion-muted: #94A3B8;
}

/* Floating Trigger Button */
.axion-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.4), 0 0 20px rgba(6, 182, 212, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.axion-chat-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 35px rgba(6, 182, 212, 0.6), 0 0 30px rgba(6, 182, 212, 0.5);
}

.axion-chat-trigger .trigger-icon {
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.axion-chat-trigger.active .trigger-icon {
  transform: rotate(90deg);
}

.axion-chat-pulse {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background-color: #10b981;
  border: 2px solid #0b0e14;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: axion-pulse 2s infinite;
}

@keyframes axion-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Floating Window Container */
.axion-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(6, 182, 212, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.axion-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.axion-chat-header {
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.7) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.axion-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.axion-bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid #06b6d4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.axion-bot-details h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.axion-badge-ai {
  font-size: 9px;
  padding: 2px 6px;
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 9999px;
  font-weight: 700;
  text-transform: uppercase;
}

.axion-bot-status {
  font-size: 11px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #10b981;
}

.axion-header-actions button {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.axion-header-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Quick Topic Chips */
.axion-topic-chips {
  padding: 10px 16px;
  background: rgba(11, 14, 20, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.axion-topic-chips::-webkit-scrollbar {
  height: 4px;
}
.axion-topic-chips::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

.axion-chip {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.axion-chip:hover {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border-color: rgba(6, 182, 212, 0.4);
}

/* Chat Messages Stream */
.axion-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.03), transparent 60%);
  scrollbar-width: thin;
}

.axion-chat-body::-webkit-scrollbar {
  width: 5px;
}
.axion-chat-body::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

.axion-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: axion-fade-in 0.25s ease-out;
}

@keyframes axion-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.axion-msg.user {
  align-self: flex-end;
}

.axion-msg.bot {
  align-self: flex-start;
}

.axion-msg-bubble {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.axion-msg.user .axion-msg-bubble {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.axion-msg.bot .axion-msg-bubble {
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.axion-msg-bubble p {
  margin: 0 0 6px 0;
}
.axion-msg-bubble p:last-child {
  margin-bottom: 0;
}

.axion-msg-bubble ul, .axion-msg-bubble ol {
  margin: 6px 0;
  padding-left: 18px;
}

.axion-msg-bubble li {
  margin-bottom: 4px;
}

.axion-msg-bubble code {
  background: rgba(0, 0, 0, 0.35);
  color: #38bdf8;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.axion-msg-meta {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.axion-msg.user .axion-msg-meta {
  justify-content: flex-end;
}

.axion-rag-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 9px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Typing Indicator */
.axion-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.85);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #06b6d4;
  border-radius: 50%;
  animation: typing-bounce 1.2s infinite ease-in-out;
}

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

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Chat Footer / Input */
.axion-chat-footer {
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.axion-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 14, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.axion-input-group:focus-within {
  border-color: #06b6d4;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.axion-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 13px;
  outline: none;
  padding: 8px 0;
  resize: none;
  font-family: inherit;
  max-height: 80px;
}

.axion-chat-input::placeholder {
  color: #64748b;
}

.axion-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.axion-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.axion-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.axion-footer-brand {
  font-size: 10px;
  color: #475569;
  text-align: center;
  margin-top: 6px;
}
