/* ==========================================================================
   Axiom Precision - Chatbot Widget Styles
   ========================================================================== */

/* Launcher FAB & Teaser */
.axiom-chat-widget-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1060;
  font-family: var(--axiom-font-body, 'Inter', sans-serif);
}

/* Floating Action Button (Trigger) */
.axiom-chat-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #132434 0%, #1A0B2E 100%);
  border: 2px solid var(--axiom-cyan-accent, #00E5FF);
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.25), 0 4px 12px rgba(19, 36, 52, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  padding: 0;
}

.axiom-chat-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 229, 255, 0.4), 0 6px 16px rgba(19, 36, 52, 0.5);
  border-color: #58e6ff;
}

.axiom-chat-trigger:active {
  transform: scale(0.95);
}

.axiom-chat-trigger .trigger-icon {
  font-size: 26px;
  line-height: 1;
  transition: transform 0.3s ease, opacity 0.2s ease;
  color: #00E5FF;
}

.axiom-chat-trigger.is-open .trigger-icon-chat {
  display: none;
}

.axiom-chat-trigger:not(.is-open) .trigger-icon-close {
  display: none;
}

.axiom-chat-trigger.is-open .trigger-icon-close {
  display: block;
  font-size: 24px;
  color: #ffffff;
}

/* Online Badge Pulse */
.axiom-chat-pulse-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background-color: #10b981;
  border: 2px solid #132434;
  border-radius: 50%;
}

.axiom-chat-pulse-badge::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: axiomChatPulse 2s infinite ease-out;
}

@keyframes axiomChatPulse {
  0% { transform: scale(1); opacity: 0.9; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Teaser / Proactive Greeting Toast */
.axiom-chat-teaser {
  position: absolute;
  bottom: 74px;
  right: 0;
  width: 290px;
  background: rgba(19, 36, 52, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 16px;
  padding: 12px 16px;
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  animation: axiomSlideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.axiom-chat-teaser:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 16px 36px rgba(0, 229, 255, 0.15);
}

.axiom-chat-teaser-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.axiom-chat-teaser-close:hover {
  color: #ffffff;
}

.axiom-chat-teaser-title {
  font-size: 13px;
  font-weight: 700;
  color: #00E5FF;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.axiom-chat-teaser-text {
  font-size: 12px;
  line-height: 1.4;
  color: #e2e8f0;
  margin: 0;
}

/* Chat Window Modal */
.axiom-chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(19, 36, 52, 0.22), 0 0 0 1px rgba(19, 36, 52, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: axiomWindowEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

@keyframes axiomWindowEnter {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes axiomSlideUpFade {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Header */
.axiom-chat-header {
  background: linear-gradient(135deg, #132434 0%, #1A0B2E 100%);
  padding: 16px 18px;
  color: #ffffff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #00E5FF;
}

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

.axiom-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00E5FF;
  font-size: 20px;
  flex-shrink: 0;
}

.axiom-chat-header-title {
  font-family: var(--axiom-font-heading, 'Geist', sans-serif);
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  color: #ffffff;
}

.axiom-chat-header-status {
  font-size: 11px;
  color: #92a4b7;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.axiom-chat-header-status .status-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
}

.axiom-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.axiom-chat-header-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.8);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.axiom-chat-header-btn:hover {
  background: rgba(0, 229, 255, 0.2);
  color: #00E5FF;
}

/* Chat Messages Stream */
.axiom-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: #f8faf6;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.axiom-chat-messages::-webkit-scrollbar {
  width: 5px;
}

.axiom-chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Message Bubble Styles */
.axiom-chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: axiomMsgFade 0.25s ease;
}

@keyframes axiomMsgFade {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

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

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

.axiom-chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.axiom-chat-msg.bot .axiom-chat-bubble {
  background: #ffffff;
  color: #191c1a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.axiom-chat-msg.user .axiom-chat-bubble {
  background: linear-gradient(135deg, #132434 0%, #1f364d 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(19, 36, 52, 0.15);
}

.axiom-chat-bubble p {
  margin: 0 0 8px 0;
}

.axiom-chat-bubble p:last-child {
  margin-bottom: 0;
}

.axiom-chat-bubble strong {
  color: #132434;
  font-weight: 600;
}

.axiom-chat-msg.user .axiom-chat-bubble strong {
  color: #58e6ff;
}

.axiom-chat-bubble ul {
  margin: 6px 0;
  padding-left: 18px;
}

.axiom-chat-bubble li {
  margin-bottom: 4px;
}

.axiom-chat-time {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
  padding: 0 4px;
}

.axiom-chat-msg.user .axiom-chat-time {
  text-align: right;
}

/* Action Buttons inside Bot Message */
.axiom-chat-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.axiom-chat-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  color: #132434;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.axiom-chat-btn-action:hover {
  background: #132434;
  color: #00E5FF;
  border-color: #132434;
  transform: translateY(-1px);
  text-decoration: none;
}

.axiom-chat-btn-action.btn-whatsapp {
  background: #25D366;
  color: #ffffff;
  border-color: #25D366;
}

.axiom-chat-btn-action.btn-whatsapp:hover {
  background: #1eb857;
  color: #ffffff;
  border-color: #1eb857;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.axiom-chat-btn-action.btn-accent {
  background: linear-gradient(135deg, #132434 0%, #1A0B2E 100%);
  color: #00E5FF;
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.axiom-chat-btn-action.btn-accent:hover {
  background: #132434;
  border-color: #00E5FF;
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.25);
}

/* Quick Suggestion Chips */
.axiom-chat-suggestions {
  padding: 8px 16px 10px;
  background-color: #f8faf6;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.axiom-chat-chip {
  background: #ffffff;
  border: 1px solid #d9dad7;
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
  color: #43474c;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.axiom-chat-chip:hover {
  background: #132434;
  color: #00E5FF;
  border-color: #132434;
  transform: translateY(-1px);
}

/* Typing Indicator Animation */
.axiom-chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.axiom-typing-dot {
  width: 6px;
  height: 6px;
  background-color: #94a3b8;
  border-radius: 50%;
  animation: axiomTypingBounce 1.4s infinite ease-in-out both;
}

.axiom-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.axiom-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes axiomTypingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; background-color: #00E5FF; }
}

/* Chat Input Area */
.axiom-chat-footer {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #edeeeb;
}

.axiom-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.axiom-chat-input {
  flex: 1;
  border: 1px solid #d9dad7;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  background: #f8faf6;
  color: #191c1a;
  transition: all 0.2s ease;
}

.axiom-chat-input:focus {
  border-color: #00E5FF;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.axiom-chat-submit {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #132434;
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: #00E5FF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
}

.axiom-chat-submit:hover:not(:disabled) {
  background: #1f364d;
  color: #58e6ff;
  border-color: #00E5FF;
  transform: translateY(-1px);
}

.axiom-chat-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.axiom-chat-branding {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.axiom-chat-branding a {
  color: #006876;
  text-decoration: none;
  font-weight: 600;
}

.axiom-chat-branding a:hover {
  text-decoration: underline;
}

/* Adjust Back to Top button when Chatbot is present so they do not overlap */
#back-to-top {
  right: 96px !important;
  bottom: 24px !important;
  margin: 0 !important;
  transition: all 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .axiom-chat-widget-root {
    bottom: 16px;
    right: 16px;
  }

  .axiom-chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    z-index: 1070;
  }

  .axiom-chat-teaser {
    width: calc(100vw - 32px);
    right: 0;
    bottom: 74px;
  }

  #back-to-top {
    right: 84px !important;
    bottom: 16px !important;
  }
}
