/* Maid Clean website chatbot widget styles.
 * All rules are scoped under .mc-chat to avoid colliding with the host site.
 * Recolor by overriding the CSS variables below. */
.mc-chat {
  --mc-primary: #1f3a4d;       /* deep slate-blue: premium, calm */
  --mc-primary-dark: #162c3a;
  --mc-accent: #c9772f;        /* warm terracotta accent */
  --mc-bot-bg: #f1f3f5;
  --mc-bot-text: #1f2933;
  --mc-user-bg: #1f3a4d;
  --mc-user-text: #ffffff;
  --mc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.mc-chat,
.mc-chat * {
  box-sizing: border-box;
}

/* Floating toggle button */
.mc-chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--mc-primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483000;
  transition: transform 0.15s ease, background 0.15s ease;
}
.mc-chat-toggle:hover {
  background: var(--mc-primary-dark);
  transform: translateY(-2px);
}
.mc-chat-toggle.mc-open {
  background: var(--mc-primary-dark);
}

/* Attention pulse on the bubble (runs a few times, then stops) */
@keyframes mc-pulse {
  0%   { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(31, 58, 77, 0.45); }
  70%  { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 16px rgba(31, 58, 77, 0); }
  100% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(31, 58, 77, 0); }
}
.mc-chat-toggle.mc-pulse {
  animation: mc-pulse 2.2s ease-out 3;
}

/* Teaser greeting bubble above the chat bubble */
.mc-chat-teaser {
  position: fixed;
  right: 20px;
  bottom: 92px;
  max-width: 230px;
  background: #fff;
  color: var(--mc-bot-text);
  font-family: var(--mc-font);
  font-size: 14px;
  line-height: 1.4;
  padding: 12px 32px 12px 14px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  z-index: 2147483000;
  animation: mc-teaser-in 0.35s ease;
}
.mc-chat-teaser[hidden] {
  display: none;
}
.mc-chat-teaser-close {
  position: absolute;
  top: 5px;
  right: 8px;
  background: none;
  border: none;
  font-size: 17px;
  line-height: 1;
  color: #9aa5b1;
  cursor: pointer;
  padding: 0;
}
.mc-chat-teaser-close:hover {
  color: #4b5563;
}
@keyframes mc-teaser-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Chat panel */
.mc-chat-panel {
  position: fixed;
  bottom: 92px;
  right: 20px;
  width: 300px;
  max-width: calc(100vw - 40px);
  height: 430px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483000;
  font-family: var(--mc-font);
}

/* Make the `hidden` attribute actually hide the panel (overrides display: flex). */
.mc-chat-panel[hidden] {
  display: none;
}

.mc-chat-header {
  background: var(--mc-primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mc-chat-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
}
.mc-chat-title span {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 2px;
}
.mc-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}
.mc-chat-close:hover {
  opacity: 1;
}

/* Message log */
.mc-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mc-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.mc-msg-bot {
  background: var(--mc-bot-bg);
  color: var(--mc-bot-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.mc-msg-user {
  background: var(--mc-user-bg);
  color: var(--mc-user-text);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.mc-msg a {
  color: var(--mc-accent);
  font-weight: 600;
  text-decoration: underline;
}
.mc-msg-user a {
  color: #ffd9b8;
}

/* Typing indicator */
.mc-typing {
  display: flex;
  gap: 4px;
  align-items: center;
}
.mc-typing span {
  width: 7px;
  height: 7px;
  background: #9aa5b1;
  border-radius: 50%;
  animation: mc-bounce 1.2s infinite ease-in-out both;
}
.mc-typing span:nth-child(2) { animation-delay: 0.15s; }
.mc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mc-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input form */
.mc-chat-form {
  display: flex;
  border-top: 1px solid #e4e7eb;
  padding: 10px;
  gap: 8px;
  background: #fff;
}
.mc-chat-input {
  flex: 1;
  border: 1px solid #d2d7dd;
  border-radius: 22px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--mc-font);
  outline: none;
}
.mc-chat-input:focus {
  border-color: var(--mc-primary);
}
.mc-chat-input:disabled {
  background: #f1f3f5;
}
.mc-chat-send {
  background: var(--mc-primary);
  color: #fff;
  border: none;
  border-radius: 22px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--mc-font);
}
.mc-chat-send:hover {
  background: var(--mc-primary-dark);
}
.mc-chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Mobile: full-width sheet */
@media (max-width: 480px) {
  .mc-chat-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 85vh;
    max-height: 85vh;
    border-radius: 14px 14px 0 0;
  }
  .mc-chat-toggle {
    bottom: 16px;
    right: 16px;
  }
  .mc-chat-teaser {
    right: 16px;
    bottom: 84px;
    max-width: calc(100vw - 90px);
  }
}
