/* Chat Root */
#moc-chat-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999; /* ensure it's always above other overlays */
  font-family: "Segoe UI", sans-serif;
}

/* Floating Button */
.moc-chat-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #0077b6, #00aaff);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
  font-size: 22px;
  z-index: 999999;
  position: relative;
}

/* Chat Window */
.moc-chat-window {
  width: 320px;
  max-height: 500px;
  display: none;
  flex-direction: column;
  background: #0d1b2a;
  color: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  margin-bottom: 10px;
  position: relative;
  z-index: 999999; /* critical fix */
}

/* Header */
.moc-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #0a0f24;
  border-bottom: 1px solid #00aaff;
}
.moc-chat-header img {
  height: 28px;
}
.moc-chat-title {
  font-weight: 600;
  color: #00aaff;
}

/* Body */
.moc-chat-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Messages */
.moc-msg {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.3;
  word-break: break-word; /* fix for long messages */
}
.moc-msg.client {
  background: #0f3460;
  align-self: flex-end;
}
.moc-msg.staff {
  background: #1f4068;
  align-self: flex-start;
}

/* Input Area */
.moc-chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #1b263b;
  background: #0a0f24;
  position: relative;
  z-index: 999999;
}
.moc-chat-input input {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #0f3460;
  color: #fff;
  outline: none; /* ensure focus works */
}
.moc-chat-input button {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #00aaff;
  color: #fff;
  cursor: pointer;
}

/* Initial Prompt (e.g. asking name/email) */
.moc-prompt {
  padding: 12px;
  border-bottom: 1px solid #1b263b;
}
.moc-prompt input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #0f3460;
  color: #fff;
  margin: 6px 0;
  outline: none;
}
.moc-prompt button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #00aaff;
  color: #fff;
  cursor: pointer;
}
