/* ========== CHAT WIDGET ========== */
#mtrx-chat {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 9999;
}

#mtrx-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #00ff88 0%, #8b5cf6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
  transition: all 0.3s;
  animation: mtrx-pulse 2s infinite;
}

#mtrx-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(0, 255, 136, 0.5);
}

#mtrx-chat-icon {
  font-size: 28px;
}

#mtrx-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff3b30;
  color: white;
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes mtrx-pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3); }
  50% { box-shadow: 0 10px 30px rgba(0, 255, 136, 0.6), 0 0 0 12px rgba(0, 255, 136, 0); }
}

#mtrx-chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 50px);
  background: #131829;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-direction: column;
  overflow: hidden;
}

#mtrx-chat-header {
  background: linear-gradient(135deg, #00ff88 0%, #8b5cf6 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#mtrx-chat-title {
  font-weight: 700;
  font-size: 16px;
}

#mtrx-chat-status {
  font-size: 12px;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.mtrx-online-dot {
  width: 8px;
  height: 8px;
  background: #00ff88;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
  animation: mtrx-dot 2s infinite;
}

@keyframes mtrx-dot {
  0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

#mtrx-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 22px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#mtrx-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

#mtrx-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #0a0e1a;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mtrx-msg {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 80%;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.mtrx-bot {
  background: #1d2438;
  color: white;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.mtrx-user {
  background: linear-gradient(135deg, #00ff88 0%, #8b5cf6 100%);
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  margin-left: 20%;
}

.mtrx-typing {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
}

.mtrx-typing span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: mtrx-typing-bounce 1.4s infinite;
}

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

@keyframes mtrx-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

#mtrx-chat-suggestions {
  padding: 0 16px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #0a0e1a;
}

.mtrx-suggestion {
  background: #1d2438;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.mtrx-suggestion:hover {
  background: #2a334d;
  border-color: #00ff88;
}

#mtrx-chat-input {
  display: flex;
  padding: 12px;
  background: #131829;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 8px;
}

#mtrx-chat-textbox {
  flex: 1;
  background: #1d2438;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

#mtrx-chat-textbox:focus {
  border-color: #00ff88;
}

#mtrx-chat-send {
  width: 40px;
  height: 40px;
  border: none;
  background: linear-gradient(135deg, #00ff88 0%, #8b5cf6 100%);
  color: #0a0e1a;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mtrx-chat-send:hover {
  transform: translateY(-1px);
}

/* Mobile */
@media (max-width: 480px) {
  #mtrx-chat-window {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
    max-height: 100%;
  }

  #mtrx-chat-toggle {
    bottom: 20px;
    right: 20px;
  }
}
