/* ===== QWO CHATBOT WIDGET ===== */

/* Toggle Button */
.qwo-chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,76,0.3);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--obsidian);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(201,168,76,0.25);
  transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}
.qwo-chat-toggle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 36px rgba(201,168,76,0.4);
}
.qwo-chat-toggle svg {
  width: 26px;
  height: 26px;
  transition: transform 0.3s;
}
.qwo-chat-toggle.active {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
}

/* Chat Window */
.qwo-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 8999;
  width: 380px;
  max-height: 560px;
  display: flex;
  flex-direction: column;
  background: rgba(13,13,13,0.97);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(201,168,76,0.1);
  box-shadow: 0 16px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,168,76,0.05);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
}
.qwo-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.qwo-chat-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.qwo-chat-avatar {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(201,168,76,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  flex-shrink: 0;
}
.qwo-chat-header-info {
  flex: 1;
}
.qwo-chat-header-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--marble-white);
}
.qwo-chat-header-status {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}
.qwo-chat-close {
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid rgba(201,168,76,0.15);
  color: var(--marble-vein);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
  border-radius: 0;
}
.qwo-chat-close svg {
  width: 16px;
  height: 16px;
}
.qwo-chat-close:hover {
  color: var(--gold);
  border-color: rgba(201,168,76,0.4);
}

/* Messages Area */
.qwo-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
  max-height: 360px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,168,76,0.15) transparent;
}
.qwo-chat-messages::-webkit-scrollbar {
  width: 4px;
}
.qwo-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.qwo-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(201,168,76,0.15);
  border-radius: 2px;
}

/* Message Bubbles */
.qwo-msg {
  max-width: 85%;
  animation: qwoChatFadeIn 0.4s ease-out;
}
.qwo-msg-bot {
  align-self: flex-start;
}
.qwo-msg-user {
  align-self: flex-end;
}
.qwo-msg-bubble {
  padding: 14px 18px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--marble-white);
}
.qwo-msg-bot .qwo-msg-bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.06);
  border-radius: 0 12px 12px 12px;
}
.qwo-msg-user .qwo-msg-bubble {
  background: linear-gradient(135deg, rgba(201,168,76,0.12), rgba(201,168,76,0.06));
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 12px 0 12px 12px;
  color: var(--gold-pale);
}

/* Typing Indicator */
.qwo-typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.06);
  border-radius: 0 12px 12px 12px;
}
.qwo-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
  animation: qwoTyping 1.4s infinite;
}
.qwo-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.qwo-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Button Options */
.qwo-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  animation: qwoChatFadeIn 0.4s ease-out;
}
.qwo-option-btn {
  padding: 10px 18px;
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.15);
  color: var(--gold-pale);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 20px;
}
.qwo-option-btn:hover {
  background: rgba(201,168,76,0.15);
  border-color: rgba(201,168,76,0.35);
  color: var(--gold);
  transform: translateY(-1px);
}
.qwo-option-btn:active {
  transform: translateY(0);
}

/* Text Input Area */
.qwo-chat-input {
  padding: 16px 20px;
  border-top: 1px solid rgba(201,168,76,0.08);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}
.qwo-chat-input input {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.1);
  color: var(--marble-white);
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 13px;
  padding: 12px 16px;
  border-radius: 0;
  outline: none;
  transition: border-color 0.3s;
}
.qwo-chat-input input::placeholder {
  color: var(--marble-vein);
  opacity: 0.5;
}
.qwo-chat-input input:focus {
  border-color: rgba(201,168,76,0.4);
}
.qwo-chat-input button {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none;
  color: var(--obsidian);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}
.qwo-chat-input button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,168,76,0.3);
}
.qwo-chat-input button svg {
  width: 18px;
  height: 18px;
}
.qwo-chat-input.disabled input {
  opacity: 0.3;
  pointer-events: none;
}
.qwo-chat-input.disabled button {
  opacity: 0.3;
  pointer-events: none;
}

/* Animations */
@keyframes qwoChatFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes qwoTyping {
  0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-4px); }
}

/* Pulse on toggle for attention */
.qwo-chat-toggle::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0;
  animation: qwoPulse 3s ease-out infinite;
  animation-delay: 2s;
}
.qwo-chat-toggle.active::after {
  display: none;
}
@keyframes qwoPulse {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.4); }
}

/* Responsive */
@media (max-width: 640px) {
  .qwo-chat-window {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: none;
    border: none;
    border-radius: 0;
  }
  .qwo-chat-window.open {
    border-radius: 0;
  }
  .qwo-chat-messages {
    flex: 1;
    max-height: none;
    min-height: 0;
  }
  .qwo-chat-input {
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .qwo-chat-input input {
    min-width: 0;
    font-size: 16px; /* prevents iOS zoom on focus */
  }
  .qwo-chat-input button {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  .qwo-chat-toggle {
    bottom: 20px;
    right: 20px;
  }
}
