/* WeCleaned Chatbot Widget */

.wclcb-root {
  position: fixed;
  z-index: 9999;
  right: 16px;
  bottom: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
  color: #111827;
}

/* Toggle bubble */
.wclcb-toggle {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  position: relative; /* for unread red dot positioning */
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.wclcb-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.35);
}
.wclcb-bubble {
  font-size: 22px;
  line-height: 1;
  color: #fff;
}

/* Panel */
.wclcb-panel {
  position: fixed;
  right: 16px;
  bottom: 84px; /* above the toggle */
  width: 360px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  overflow: hidden;
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

/* Open state */
.wclcb-open .wclcb-panel {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.wclcb-header {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wclcb-title {
  font-weight: 700;
  font-size: 15px;
}
.wclcb-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.wclcb-cta {
  background: #fff;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 9999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.4);
}
.wclcb-cta:hover {
  background: #f8fafc;
}
.wclcb-close {
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
}

/* Messages area */
.wclcb-messages {
  background: #f8fafc;
  padding: 12px;
  height: 360px;
  overflow-y: auto;
}
.wclcb-msg {
  display: flex;
  margin: 8px 0;
}
.wclcb-user {
  justify-content: flex-end;
}
.wclcb-assistant {
  justify-content: flex-start;
}
.wclcb-bubble-msg {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #e5edff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  word-wrap: break-word;
  white-space: pre-wrap;
}
.wclcb-user .wclcb-bubble-msg {
  background: #2563eb;
  color: #ffffff;
}
.wclcb-text {
  font-size: 14px;
  line-height: 1.35;
}
.wclcb-image {
  display: block;
  max-width: 220px;
  border-radius: 10px;
  margin-bottom: 6px;
  border: 1px solid rgba(0,0,0,0.06);
}

/* Input bar */
.wclcb-inputbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}
.wclcb-input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.wclcb-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.wclcb-upload {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3f4f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.wclcb-upload::before {
  content: "📎";
  font-size: 16px;
}
.wclcb-send {
  background: #16a34a;
  color: #fff;
  border: none;
  height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 600;
  cursor: pointer;
}
.wclcb-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mobile styles: full width bottom sheet */
@media (max-width: 640px) {
  .wclcb-root {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .wclcb-toggle {
    position: fixed;
    right: 12px;
    bottom: 12px;
  }
  .wclcb-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 76px;
    max-height: calc(100vh - 120px);
  }
  .wclcb-bubble-msg {
    max-width: 90%;
  }
}

/* Attachments preview (input bar) */
.wclcb-att {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.wclcb-att-item {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.wclcb-att-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wclcb-att-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Multi-image group inside bubbles */
.wclcb-imgs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.wclcb-imgs .wclcb-image {
  max-width: 120px;
}

/* Focus states */
.wclcb-close:focus,
.wclcb-send:focus,
.wclcb-upload:focus,
.wclcb-att-remove:focus {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

/* Small tweak so send button doesn't shrink too much */
.wclcb-send {
  min-width: 84px;
}

/* Unread red dot on the toggle bubble */
.wclcb-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border: 2px solid #ffffff;
  border-radius: 9999px;
  display: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Rich text styles inside assistant messages */
.wclcb-text a {
  color: #1d4ed8;
  text-decoration: underline;
}
.wclcb-user .wclcb-text a {
  color: #ffffff;
  text-decoration: underline;
}
.wclcb-text strong {
  font-weight: 700;
}
.wclcb-text em {
  font-style: italic;
}
.wclcb-text code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.06);
  padding: 2px 4px;
  border-radius: 4px;
}
