/* AXIOM Chatbot Widget */

#axiom-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #C9A96E;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(201, 169, 110, 0.4);
  transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  color: #0F0D0B;
}

#axiom-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(201, 169, 110, 0.5);
}

#axiom-chat-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 9998;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #0F0D0B;
  border: 1px solid rgba(201, 169, 110, 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#axiom-chat-window.axiom-chat-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.axiom-chat-header {
  padding: 20px;
  border-bottom: 1px solid rgba(250, 247, 242, 0.06);
  background: linear-gradient(135deg, rgba(24, 58, 43, 0.3), rgba(15, 13, 11, 0.95));
}

.axiom-chat-title {
  font-family: 'Playfair Display', sans-serif;
  font-size: 1.1rem;
  color: #C9A96E;
  font-weight: 600;
}

.axiom-chat-subtitle {
  font-size: 0.75rem;
  color: #78716C;
  margin-top: 2px;
}

/* Messages */
.axiom-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.axiom-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0.3);
  border-radius: 2px;
}

.axiom-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  animation: axiomMsgIn 0.3s ease forwards;
  opacity: 0;
}

@keyframes axiomMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.axiom-chat-msg-assistant {
  background: rgba(250, 247, 242, 0.06);
  color: #FAF7F2;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.axiom-chat-msg-user {
  background: rgba(201, 169, 110, 0.15);
  color: #D4B87A;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.axiom-chat-typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
}

.axiom-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #C9A96E;
  animation: axiomTyping 1.4s ease-in-out infinite;
}

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

@keyframes axiomTyping {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

/* Powered by */
.axiom-chat-powered {
  text-align: center;
  font-size: 0.65rem;
  color: #78716C;
  padding: 6px 16px 2px;
  font-style: italic;
}

/* Input */
.axiom-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.axiom-chat-input input {
  flex: 1;
  background: rgba(250, 247, 242, 0.05);
  border: 1px solid rgba(250, 247, 242, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  color: #FAF7F2;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.axiom-chat-input input:focus {
  border-color: rgba(201, 169, 110, 0.4);
}

.axiom-chat-input input::placeholder {
  color: #78716C;
}

.axiom-chat-input button {
  background: #C9A96E;
  color: #0F0D0B;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.axiom-chat-input button:hover {
  background: #D4B87A;
}

/* Light Mode */
html.light #axiom-chat-window {
  background: #FAF7F2;
  border-color: rgba(28, 25, 23, 0.1);
  box-shadow: 0 20px 60px rgba(28, 25, 23, 0.15);
}

html.light .axiom-chat-header {
  background: linear-gradient(135deg, rgba(240, 235, 225, 0.8), rgba(250, 247, 242, 0.95));
  border-bottom-color: rgba(28, 25, 23, 0.06);
}

html.light .axiom-chat-msg-assistant {
  background: rgba(28, 25, 23, 0.04);
  color: #1C1917;
}

html.light .axiom-chat-msg-user {
  background: rgba(201, 169, 110, 0.12);
  color: #402C21;
}

html.light .axiom-chat-input input {
  background: rgba(28, 25, 23, 0.03);
  border-color: rgba(28, 25, 23, 0.1);
  color: #1C1917;
}

html.light .axiom-chat-input input::placeholder {
  color: #A8A29E;
}

html.light .axiom-chat-input {
  border-top-color: rgba(28, 25, 23, 0.06);
}

html.light .axiom-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 110, 0.4);
}

/* Mobile */
@media (max-width: 480px) {
  #axiom-chat-window {
    bottom: 80px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    height: 60vh;
  }

  #axiom-chat-btn {
    bottom: 16px;
    right: 16px;
  }
}
