/* ==============================
   AI Chatbot – CSS V1
   Adapted to mgpt-* structure
   ============================== */

#mgpt-chatbot {
  width: 100%;
  max-width: 100%;
}

.mgpt-chatbot-inner {
  --border-radius: 14px;
  --border-width: 4px;
  --spacing: 12px;
  --bg-user: rgba(0, 0, 0, 0.08);
  --bg-bot: rgba(0, 0, 0, 0.03);

  font-family: inherit;
  color: inherit;

  border: var(--border-width) solid transparent;
  border-radius: var(--border-radius);

  background:
  linear-gradient(#ffffff, #ffffff) padding-box,
  linear-gradient(
    135deg,
    #f8f9fb,
    #dfe3e8,
    #cfd4da,
    #eef1f4
  ) border-box;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);

  width: 100%;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
}

/* Message area */
#mgpt-chat-messages {
  padding: var(--spacing);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

/* Messages injected by JS */
.mgpt-message {
  display: flex;
}

/* User message */
.mgpt-message.user {
  justify-content: flex-end;
}

/* Bot message */
.mgpt-message.bot {
  justify-content: flex-start;
}

.mgpt-message.bot,
.mgpt-message.user {
  line-height: 1.6;
}

/* Bubble */
.mgpt-bubble {
  padding: 12px 16px;
  border-radius: var(--border-radius);
  max-width: 75%;
  font-size: 0.95em;
  line-height: 1.6;
}

.mgpt-message.user .mgpt-bubble {
  background: var(--bg-user);
}

.mgpt-message.bot .mgpt-bubble {
  background: var(--bg-bot);
}

/* Form */
#mgpt-chat-form {
  display: flex;
  gap: 8px;
  padding: var(--spacing);
  border-top: 1px solid var(--border-color);
}

#mgpt-chat-input {
  flex: 1;
  font-family: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

#mgpt-chat-form button {
  font-family: inherit;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  cursor: pointer;
}

#mgpt-chat-form button:hover {
  opacity: 0.8;
}
